Repository navigation
Theme: Refine typography tokens #73931
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
Changes from all commits
6caf9e2
fccf020
587e6c1
6ca8e36
0ecdfb1
ad420d8
72d212d
eafa73f
b057f07
3f476b1
dfc8164
6584a7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, it's a good question. I could have sworn I took inspiration from this somewhere in how the file and top-level grouping was named, but the examples I could find in either the spec or examples in Terrazzo documentation either don't mention it, or do group them as "typography".
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think how I may have been considering it was reserving "typography" as a grouping for the compositions of individual font token values, similar to how it's documented in the specification with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. In my mind, I still think that "type" or "typography" is a better name for this group, and it seems to match how terrazzo and others' approach too (colors, typography, spacing...). That doesn't mean that we can not have In fact, it poses the question of how we should structure those "presets" — are they semantic tokens, or an even higer-level entity?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameskoster out of curiosity, do you foresee the need for more tokens in the future (targeting things like letter spacing or other metrics)?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe 😄 Difficult to say at this stage. I don't think letter-spacing is used in the existing componentry. |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,57 +37,68 @@ | |||||||
| }, | ||||||||
| "size": { | ||||||||
| "$type": "dimension", | ||||||||
| "x-small": { | ||||||||
| "xs": { | ||||||||
| "$value": { "value": 11, "unit": "px" }, | ||||||||
| "$description": "Extra small font size" | ||||||||
| }, | ||||||||
| "small": { | ||||||||
| "sm": { | ||||||||
| "$value": { "value": 12, "unit": "px" }, | ||||||||
| "$description": "Small font size" | ||||||||
| }, | ||||||||
| "medium": { | ||||||||
| "md": { | ||||||||
| "$value": { "value": 13, "unit": "px" }, | ||||||||
| "$description": "Medium font size" | ||||||||
| }, | ||||||||
| "large": { | ||||||||
| "lg": { | ||||||||
| "$value": { "value": 15, "unit": "px" }, | ||||||||
| "$description": "Large font size" | ||||||||
| }, | ||||||||
| "x-large": { | ||||||||
| "xl": { | ||||||||
| "$value": { "value": 20, "unit": "px" }, | ||||||||
| "$description": "Extra large font size" | ||||||||
| }, | ||||||||
| "2x-large": { | ||||||||
| "2xl": { | ||||||||
| "$value": { "value": 32, "unit": "px" }, | ||||||||
| "$description": "2X large font size" | ||||||||
| } | ||||||||
| }, | ||||||||
| "lineHeight": { | ||||||||
| "line-height": { | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker for now, but have we considered which unit to use to express these tokens? Using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not personally aware of any consideration to that extent, but I'd be curious as well. I think it's a change we could choose to make down the line also.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have mentally put I'm interested in the px/unitless decision for line-height. That has a lot of implications, not only on new things, but for migrations of existing styles (almost all unitless?).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re |
||||||||
| "$type": "dimension", | ||||||||
| "x-small": { | ||||||||
| "xs": { | ||||||||
| "$value": { "value": 16, "unit": "px" }, | ||||||||
| "$description": "Extra small line height" | ||||||||
| }, | ||||||||
| "small": { | ||||||||
| "sm": { | ||||||||
| "$value": { "value": 20, "unit": "px" }, | ||||||||
| "$description": "Small line height" | ||||||||
| }, | ||||||||
| "medium": { | ||||||||
| "md": { | ||||||||
| "$value": { "value": 24, "unit": "px" }, | ||||||||
| "$description": "Medium line height" | ||||||||
| }, | ||||||||
| "large": { | ||||||||
| "lg": { | ||||||||
| "$value": { "value": 28, "unit": "px" }, | ||||||||
| "$description": "Large line height" | ||||||||
| }, | ||||||||
| "x-large": { | ||||||||
| "xl": { | ||||||||
| "$value": { "value": 32, "unit": "px" }, | ||||||||
| "$description": "Extra large line height" | ||||||||
| }, | ||||||||
| "2x-large": { | ||||||||
| "2xl": { | ||||||||
| "$value": { "value": 40, "unit": "px" }, | ||||||||
| "$description": "2X large line height" | ||||||||
| } | ||||||||
| }, | ||||||||
| "weight": { | ||||||||
| "$type": "fontWeight", | ||||||||
| "regular": { | ||||||||
| "$value": 400, | ||||||||
| "$description": "Regular font weight for body text" | ||||||||
| }, | ||||||||
| "medium": { | ||||||||
| "$value": 499, | ||||||||
| "$description": "Medium font weight for emphasis and headings" | ||||||||
| } | ||||||||
|
Comment on lines
+94
to
+101
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% on these tokens, and would welcome feedback. These are being carried forward from existing variables: gutenberg/packages/base-styles/_variables.scss Lines 38 to 40 in ac35a71
Note that I did not use the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Being a browser app, isn't it plausible that the same quirk would manifest in Figma though?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's a good question. I'm not really sure. Doing some brief inspecting, it looks like the main canvas area in Figma is a I think the root of the decision here is codifying the decision that we want
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to ship with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let's go with that. Updated in 5d57c17 . This also means it'll be 499 in Figma, which may be what we want or expect, but may also be slightly misaligned.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| export * from './box'; | ||
| export * from './badge'; | ||
| export * from './box'; | ||
| export * from './form/primitives'; | ||
| export * from './stack'; | ||
| export * from './visually-hidden'; |



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that we call this "medium", where in other sizing tokens we use "md" abbreviated t-shirt size naming. Maybe we're okay with this seeming inconsistency? There's not an obvious abbreviated form to represent all the options here (i.e. "regular").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm ok with font weight tokens not to be abbreviated