WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.32k stars 4.12k forks source link

Shadows / Elevation #63757

Open jameskoster opened 1 month ago

jameskoster commented 1 month ago

Related to https://github.com/WordPress/gutenberg/issues/63703

[!NOTE]
Elevation refers to the vertical distance between two surfaces measured along the z-axis.

As the site editing experience transitions from the Editor to new UIs, there is a need for a more clearly defined elevation scale and shadow styles.

In _variables.scss we find values for modals and popovers only: https://github.com/WordPress/gutenberg/blob/dc93da08a38af14aef07906c63ec11a599d74582/packages/base-styles/_variables.scss#L72-L73

New UIs now exist with custom shadow values, such as the content/preview frame and the Command Palette. The existing variables do not sufficiently cover these additional use cases. Elements like Snackbars and Tooltips may also require reconsideration.

Systematizing elevation will help create a cohesive experience and avoiding maintenance issues in the future.

Proposed elevation scale

Elevation

Does this scale meet the needs of the novel UIs, and does its application / mapping of components make sense? Let's discuss and explore further in this issue.

jasmussen commented 1 month ago

Nice issue. I wonder, can elevation 2 and 3 be merged? This would improve the contrast between elevations to just have 3 (not conting zero): small, medium, large.