Skip to content

Applying design system foundations to the Block Toolbar #67426

@jameskoster

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.

Image

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:

Image

Side note: Based on the 8px padding there may be an argument to slightly increase radius-medium for perfect nesting:

Image

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

Image

Border Tweaks

With this elevation applied, the need for a heavy outline is reduced. Softening the border offers two key advantages:

  1. 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.
  2. 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.

Image


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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Design SystemIssues related to the system of combining components according to best practices.Needs Design FeedbackNeeds general design feedback.[Package] Components/packages/components[Type] EnhancementA suggestion for improvement.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions