Skip to content

Expand the spacing scale #66877

Open
Open
@jameskoster

Description

Officially the spacing scale is based on an 8px base unit. However there are a few situations where values outside of the scale are used, and in these cases the general recommendation is to use values from a 4px baseline. This is achieved with code like:

line-height: $grid-unit-05 * 5;

Couple this with the fact that the scale already includes a couple of values outside of the 8px baseline ($grid-unit-05 and $grid-unit-15), it seems a good moment to consider officially adopting the 'unofficial' 4px baseline.

$grid-unit-05: 0.5 * $grid-unit;
$grid-unit-10: 1 * $grid-unit;
$grid-unit-15: 1.5 * $grid-unit;
$grid-unit-20: 2 * $grid-unit;	
$grid-unit-25: 2.5 * $grid-unit; 🆕
$grid-unit-30: 3 * $grid-unit;
$grid-unit-35: 3.5 * $grid-unit; 🆕
$grid-unit-40: 4 * $grid-unit;
$grid-unit-45: 4.5 * $grid-unit; 🆕
$grid-unit-50: 5 * $grid-unit;
$grid-unit-55: 5.5 * $grid-unit; 🆕
$grid-unit-60: 6 * $grid-unit;
$grid-unit-65: 6.5 * $grid-unit; 🆕
$grid-unit-70: 7 * $grid-unit;	
$grid-unit-75: 7.5 * $grid-unit; 🆕
$grid-unit-80: 8 * $grid-unit;
$grid-unit-85: 8.5 * $grid-unit; 🆕

This would make values 20px, 28px, 36px, 44px, 52px, 60px, and 68px available for use as variables, and allow us to tidy up some of the aforementioned code smells.

What do you think?

cc @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.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions