Skip to content
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

Line-height for 'body' text is inconsistent #47735

Open
jameskoster opened this issue Feb 3, 2023 · 3 comments
Open

Line-height for 'body' text is inconsistent #47735

jameskoster opened this issue Feb 3, 2023 · 3 comments
Labels
[Feature] Component System WordPress component system General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. Needs Figma Update Needs an update to Figma for design purposes [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Feb 3, 2023

We utilise 13px as the default font size in the block editor. However, different areas of the UI apply different line-height values to this 13px text. Some examples:

UI area Line-height value
Screenshot 2023-02-03 at 12 30 12 1.2
Screenshot 2023-02-03 at 12 31 13 1.4em
Screenshot 2023-02-03 at 12 31 39 1.5

It's a small detail, but these inconsistencies add up to make the UI feel less structured and cohesive.

If we wanted to pick one of the existing values I'd vote for 1.5 because it arguably has the best legibility, and gets us closest to the 4px baseline grid: 13 * 1.5 = 19.5. To be more precise, a value of 1.53846153846 * 13 = 20 🙂

Here's equivalent screenshots of the UI noted above using that value:

Screenshot 2023-02-03 at 12 41 46

Screenshot 2023-02-03 at 12 42 05

Screenshot 2023-02-03 at 12 42 25

cc @WordPress/gutenberg-design

@jameskoster jameskoster added General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. labels Feb 3, 2023
@jasmussen jasmussen added Needs Figma Update Needs an update to Figma for design purposes [Feature] Component System WordPress component system labels Feb 3, 2023
@jasmussen
Copy link
Contributor

Definitely a fan of the line-height rounding to 20px, which fits the 4px grid. Matches very well also to the 40px buttons we are discussing in #46734.

@jasmussen
Copy link
Contributor

CC: @mirka in case this affects componentry.

@mirka
Copy link
Member

mirka commented Feb 3, 2023

Sounds good. From the technical standpoint, the way to propagate this will be to use the Text component. It isn't used a lot in production yet, but we can push for devs to use it more once we update the font-size/line-height presets to match our current needs. It currently has a default of 13px/1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. Needs Figma Update Needs an update to Figma for design purposes [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants