Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/block toolbars with preview #20351

Merged
merged 9 commits into from
Feb 24, 2020
Merged

Conversation

tellthemachines
Copy link
Contributor

@tellthemachines tellthemachines commented Feb 21, 2020

Description

Fix rendering of block toolbars with responsive preview by always fixing them to top on Tablet and Mobile previews.

How has this been tested?

Browser tested only.

Screenshots

Screen Shot 2020-02-21 at 2 34 41 pm

Screen Shot 2020-02-21 at 2 44 55 pm

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@youknowriad
Copy link
Contributor

Thanks for your help on this @tellthemachines we're almost there

Something is off in the style of the top toolbr for mobile/table previews

Capture d’écran 2020-02-21 à 8 16 43 AM

I believe that's most likely because some styling that are meant for contextual toolbars are bleeding to the top toolbar in these previews. The mix might be just moving some styles around.

@tellthemachines
Copy link
Contributor Author

Something is off in the style of the top toolbr for mobile/table previews

Should be fixed now!

@youknowriad
Copy link
Contributor

Thanks, it's better

Capture d’écran 2020-02-24 à 9 23 59 AM

I still see the black borders though, Maybe some wrong CSS. selector not targetting the contextual toolbar. specifically? cc @jasmussen

@jasmussen
Copy link
Contributor

Interesting, the off-borders only happen when the "Top Toolbar" option is not toggled. When it is, they look correct:

Screenshot 2020-02-24 at 09 30 46

In other words, the difference is a classname:

gif

So, to the div that has the following classnames:

edit-post-layout is-mode-visual block-editor-editor-skeleton

... if you add this, it works:

edit-post-layout is-mode-visual block-editor-editor-skeleton has-fixed-toolbar

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tellthemachines While checking this PR, I was wondering something, why the "block-editor" package has to know about the "previewDeviceType" at all? Why it's not just an "edit-post" or "editor" thing?

(That's not something for this PR obviously)

Edit: follow-up here #20409

@youknowriad
Copy link
Contributor

youknowriad commented Feb 24, 2020

@jasmussen while this class would have fixed it, I don't think it was the right fix. Instead, I updated the block-toolbar styles so that the "contextual" style override the default lighter borders instead of the opposite to avoid using something from edit-post in block-editor

@jasmussen
Copy link
Contributor

jasmussen commented Feb 24, 2020

There used to be a separator:

Screenshot 2020-02-24 at 10 05 57

Compare with this screenshot, there was a separator before the mover control.

And there's an issue when you don't have the top toolbar option enabled, where the smart mover thing does its autohide stuff.

@youknowriad
Copy link
Contributor

Good catch, these should be fixed now.

@youknowriad youknowriad merged commit bd1de4d into try/g2 Feb 24, 2020
@youknowriad youknowriad deleted the fix/block-toolbars-with-preview branch February 24, 2020 09:35
@jasmussen
Copy link
Contributor

💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants