-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Applying design system foundations to the Block Toolbar #67426
Comments
Changes to shadow, border, and separators, feels less a clear win, and does not seem a logical conclusion to applying foundations from the design system:
The proposed radius changes make sense, as they follow a clear heuristic of inheritance. But applying the other changes, the toolbar loses some distinctiveness without a clear win. |
There’s definitely room for discussion about whether the toolbar should be an exception to certain system principles. If exceptions are made, it’s important to document them, providing clear reasoning and guidance on when and where specific variants should be used. That said, I believe it's healthy to periodically examine exceptions, as most design systems advocate minimizing them wherever possible. As a provocation; if we believe block toolbars and their menus warrant a strong outline with zero elevation, why aren’t these traits applied consistently to all menus—or to the dark toolbar found in Write mode? If we consider the block toolbar a WP branding element then it's a bit easier to reason about, otherwise I'm not sure. |
I don't know that the border is an exception. I'll support that the principles are missing for the block toolbar pattern, though, but we can create those.
As far as the elevation, this is practically in place since block toolbars and their menus are below the top toolbar and the inspector. Menus that invoke from those, on the other hand, are above both top toolbar, inspector, and canvas, and are thus elevated. I'd think it a value of a design system that it allows some freedom within the boundaries of the guidelines, though the principles of the the dark border are about ensuring contrast between block UI and content, which would also then explain the dark border around the Placeholder component. In true dark mode (as in: user-chosen or set by the operating system), then the Placeholder would likely have a black background too, and should then have a similarly strong light border. I agree there's some work to do on the current iteration of the dark toolbar. |
Also of note, the toolbar should not have blurry edges here; there are a few tricks to avoid this. And medium shadow feels a bit heavy on light backgrounds.
Agree. |
Do y'all think |
To be fair, that's been the case for the classic menus: I'd think menus should be consistent with each other. I'd also lean towards edge to edge there, since the same argument for silhouette applies, though it is less pronounced because of the lighter gray. But this is not a strong opinion. |
The menu details are worth considering, as it can be argued that there's a lot of semantic overlap between toolbars and menus. They're often connected in the UI (I think almost 100% of block toolbars include a menu), so it may be worth creating more cohesion between them. This can be an opportunity for the software to guide the system a bit. Trying a few things...
|
I think it's slightly misleading to show the block toolbar and menus without actual content to surround it, because it's that content—including the role of the placeholder—that originally informed the G2 design (#18667). That's an important aspect to stress test with these explorations. The latter shows the block toolbar being underneath the top toolbar, which is one of the main argument for me as to why this is at elevation zero. |
Since this isn't documented it's a little ambiguous. The arrangement could be interpreted a couple of ways;
It's important to consider because it affects the elevation. If it's the former like you suggest, doesn't that indicate that the top bar should be painted as a level above the canvas in terms of elevation? In other words the block toolbar would be level 1, and the top bar would be level 2. This can help remove the ambiguity by creating clearer separation between the page and the edit UI. |
Yes, the logical consequence of adding elevation to the block toolbar would be adding a higher elevation to the other elements that are above it. But that is a design choice: shadows are not intrinsically necessary to indicate elevation, it's just one way to do it. Other ways are distance, scale, scrims, blur, parallax, and borders. Older Google guidelines provide a decent overview of what their goal with elevation, which is to ensure contrast between different layers, those layers existing separately to aid orchestration such as animation and point of origin. |
Shadows were used only because that's the established treatment we find amongst the existing components (menus, modals, etc). Totally agree there are other approaches we might consider—I quite like how Apple uses blur as a background filter, with varying opacities. The nice thing about formalising the application is that it makes it trivial to quickly try these different options. |
Interesting conversations here. I like the subtle shadow of Regarding the silhouette, edge-to-edge works better for recognizing groups and relationships. The grey divider is a low-contrast decision that needs other visual traits to complement it. In a similar spacing topic, the submenu feels detached when there is a gap with its ancestor. The overlap layout conveys better the meaning of dependency. The menu item height is a great exploration and I do see benefits, but I think this approach belongs to a density level that users set when landing on the admin page for the first time. The current 40px as default works well, especially in big displays. Leaving that to user preferences could be the best path for this spacing treatment. Regarding the top bar elevation, I think that occupying the same level as the canvas. By itself, surrounded by the browser’s UI, and in the browser context where other sites are on the screens, it looks like any site on the web where the header allows to navigate internal pages and the content below lives as a page. In this case, the top bar and side panels frame the canvas like rules placed on the sides of a sheet of paper to extend its characteristics. |
In recent weeks, several components and elements of the block editor have been refreshed to align more closely with core design system foundations, particularly regarding corner radius and elevation. The block toolbar remains one of the last significant UI pieces awaiting this transformation. This issue explores updates to the toolbar that would create a more unified experience by bringing it into harmony with the wider design language.
The mockup above demonstrates some small but impactful changes aimed at refining the toolbar’s appearance.
Increased Corner Radius
Currently, toolbar buttons have a
2px
($radius-small
) corner radius. By increasing the toolbar’s corner radius to4px
($radius-medium
), we achieve a more cohesive look:Side note: Based on the
8px
padding there may be an argument to slightly increaseradius-medium
for perfect nesting:We can discuss that here, or separately. Thanks to the recent efforts around formalising these details and the application thereof, such changes are trivial.
Applied Elevation
elevation-medium
adds a subtle but effective shadow that visually lifts the toolbar from the content below. This update better aligns the toolbar with other contextual components (such as theMenu
), that also leverage this elevation to emphasize actionable items without overwhelming the layout.Border Tweaks
With this elevation applied, the need for a heavy outline is reduced. Softening the border offers two key advantages:
Menu
component integration.Additionally the dividers between button groups are shortened to match the footprint of the adjacent buttons, aligning to a convention applied in the
Menu
component.These adjustments are a step toward a more cohesive and visually refined block editor, enhancing the overall user experience without compromising functionality. They also allow facilitate the simplification of the Menu component by recommending the use of only a single variant.
Let's discuss which changes (if any) have the most merit.
@WordPress/gutenberg-design
The text was updated successfully, but these errors were encountered: