Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Try: Better position wide and fullwide toolbars. #614

Merged
merged 2 commits into from
Nov 16, 2018
Merged

Conversation

jasmussen
Copy link
Collaborator

Toolbars are a bit off when wide and fullwide. This is because the vanilla editor style assumes a centered column, with equal padding left and right when a block goes wide and fullwide.

But TwentyNineteen is smarter than that, and has a fancy left-aligned layout, except for fullwide which is truly fullwide.

This PR tries to make the experience good, but it needs your thoughts.

Before:

screenshot 2018-11-16 at 12 38 43

screenshot 2018-11-16 at 12 38 51

After:

toolbars

However. The following line of code, https://github.com/WordPress/twentynineteen/compare/try/toolbar-fix?expand=1#diff-83a29128607f3783eb58ed25d6760ad6R66, has some hacky CSS that I'd kike for us to not include in this editor style, specifically because the calc math is both obtuse, and likely to break with any future changes to the editor layout.

If I remove lines 66 to 74 in editor-style.scss, we get this:

preferred

Honestly I think we should do that. However I still think it's worth having this discussion, because POSSIBLY this is a change we should make in Gutenberg itself and not here.

To frame it differently, the question is: when the block toolbar is docked to the block, on a wide or fullwide block, should the toolbar remain centered to match non-wide blocks? Or should it always dock to the top left corner of the block, regardless of the width and position?

Your thoughts are much appreciated. Given we're past the UI freeze, I think it might be good to include at least https://github.com/WordPress/twentynineteen/compare/try/toolbar-fix?expand=1#diff-83a29128607f3783eb58ed25d6760ad6R63, as that's a very simple and clean fix that makes the experience a lot better in TwentyNineteen. But good to discuss this regardless.

Toolbars are a bit off when wide and fullwide. This is because the vanilla editor style assumes a centered column, with equal padding left and right when a block goes wide and fullwide.

But TwentyNineteen is smarter than that.

This PR tries to make the experience good, but it needs your thoughts.
@jasmussen jasmussen added the enhancement New feature or request label Nov 16, 2018
@jasmussen jasmussen added this to the RC1 milestone Nov 16, 2018
@jasmussen jasmussen self-assigned this Nov 16, 2018
Copy link
Collaborator

@kjellr kjellr left a comment

Choose a reason for hiding this comment

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

This is awesome — I hadn't thought of fixing these, but I really like it. I left a couple quick notes, and then this should be good to merge. 👍

Thank you!

Copy link
Collaborator

@allancole allancole left a comment

Choose a reason for hiding this comment

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

This is subtle but wonderfully clever :-).

I think its shippable sans this one rule, as Kjell mentioned: https://github.com/WordPress/twentynineteen/pull/614/files#diff-e31d4c0dd7cb9ed81c45783030a20ac5R66

@jasmussen
Copy link
Collaborator Author

Cool. I addressed the feedback. Let's ship and test fullwide blocks, see how it feels. If we want the docked block toolbar inset a bit, we can revisit. 👍 👍

@kjellr kjellr merged commit 0a1c408 into master Nov 16, 2018
@kjellr
Copy link
Collaborator

kjellr commented Nov 16, 2018

Thanks, @jasmussen!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants