Applying design system foundations to the Block Toolbar #67426
Description
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 to 4px
($radius-medium
), we achieve a more cohesive look:
- Radius now aligns with the updated Menu component, commonly accessed from the toolbar.
- Buttons ‘nest’ more neatly inside the toolbar:
Side note: Based on the 8px
padding there may be an argument to slightly increase radius-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 the Menu
), that also leverage this elevation to emphasize actionable items without overwhelming the layout.
Applied to components that offer additional actions to the user. This elevation level helps differentiate actionable elements that appear in context without requiring major focus shifts.
https://wordpress.github.io/gutenberg/?path=/docs/foundations-design-language-elevation--page
Border Tweaks
With this elevation applied, the need for a heavy outline is reduced. Softening the border offers two key advantages:
- Simplified Menu Styling: By adopting a subtler outline, we eliminate the need for a custom style variation when the toolbar invokes menus, streamlining
Menu
component integration. - Improved Dark Mode Consistency: The updated border style allows the dark toolbar to maintain a polished look that aligns seamlessly with the light mode toolbar.
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
Metadata
Assignees
Labels
Type
Projects
Status
No status
Activity