-
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
Systematising typography styles in the admin UI #64340
Comments
Looks good, and will be excellent documentation for what's de-facto shipping. I don't know that this necessarily needs a ton of design feedback, as despite the sound of this, there's practically very little news here, all of this is shipping. Which is to say, it'll be good to add this documentation to Storybook. Any changes we make to font sizes or type scales in the future, we can simply update the documentation along with it. |
I've started looking into the implementation for this one. The css/scss side of things seems straight-forward; we can create variables for each token, and mixins for the different text styles, e.g.:
The js is a bit more complicated due to the existing To align with the css, my thinking is that
Which would output a span that is styled according to the properties of the
This example would output a Finally, though niche, it should be possible to not use a preset style at all. Consumers should have the option to create custom styles, using either the supplied tokens, hard-coded values, or a mixture thereof. cc @WordPress/gutenberg-components for thoughts. |
Sounds good to me. We can't use the
Right, a lot of the current props (not just style-related) are unused and don't align with our current needs, so we need to assess whether we can salvage the current component or we should start a second version from scratch. |
I was wondering if those are needed — if we allow folks to specify
Had the same thinking. Also, I'd be tempted to remove truncation features — if consumers need truncation, maybe they can compose the elements themselves? |
Yes, I guess that would be simpler, given how rare it should be to stray from the presets. |
Added the Accessibility label as typography is an essential part of readability and accessibility. |
There are several typographic styles used throughout the editor, including:
However, these styles are not globally registered, leading to inconsistent and ad hoc usage across the interface. For example, in the data views pagination control, the 'label' styling is applied ad hoc to the 'of 3' suffix here:
This means that if the label style is updated in the future, this suffix will not automatically align with the preceding label leading the UI breakage.
Another problem is unique type styles, such as the section headings in the Editor Preferences modal. This is an inevitable consequence of using such a small / rigid scale and leads to inconsistency and fragility in the overall design. Some of these pain points are already felt in Data Views as mentioned above.
Establishing beautiful and consistent typographic rules will be increasingly important as the admin redesign progress and we begin building UIs outside of the Editor interface (settings forms and so on).
Solution
To ensure design consistency and ease of maintenance, we should establish a set of typographic styles that can be utilized throughout the admin interface.
Goals
Let's discuss which type styles we'll need keeping in mind high-density UI's like the block inspector, but also admin pages like settings screens where there can be more breathing room. As we explore properties, ideally
line-height
values should be multiples of 4 to align with the4px
baseline.The text was updated successfully, but these errors were encountered: