-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat!: Split text tokens into ‘body text’ and ‘heading’ groups and rename to ‘typography’ #1845
base: develop
Are you sure you want to change the base?
feat!: Split text tokens into ‘body text’ and ‘heading’ groups and rename to ‘typography’ #1845
Conversation
# Conflicts: # proprietary/tokens/src/components/ams/accordion.tokens.json # proprietary/tokens/src/components/ams/avatar.tokens.json # proprietary/tokens/src/components/ams/badge.tokens.json # proprietary/tokens/src/components/ams/blockquote.tokens.json # proprietary/tokens/src/components/ams/character-count.tokens.json # proprietary/tokens/src/components/ams/checkbox.tokens.json # proprietary/tokens/src/components/ams/date-input.tokens.json # proprietary/tokens/src/components/ams/description-list.tokens.json # proprietary/tokens/src/components/ams/error-message.tokens.json # proprietary/tokens/src/components/ams/field-set.tokens.json # proprietary/tokens/src/components/ams/heading.tokens.json # proprietary/tokens/src/components/ams/label.tokens.json # proprietary/tokens/src/components/ams/ordered-list.tokens.json # proprietary/tokens/src/components/ams/page-heading.tokens.json # proprietary/tokens/src/components/ams/pagination.tokens.json # proprietary/tokens/src/components/ams/paragraph.tokens.json # proprietary/tokens/src/components/ams/password-input.tokens.json # proprietary/tokens/src/components/ams/radio.tokens.json # proprietary/tokens/src/components/ams/search-field.tokens.json # proprietary/tokens/src/components/ams/select.tokens.json # proprietary/tokens/src/components/ams/skip-link.tokens.json # proprietary/tokens/src/components/ams/switch.tokens.json # proprietary/tokens/src/components/ams/table.tokens.json # proprietary/tokens/src/components/ams/text-area.tokens.json # proprietary/tokens/src/components/ams/text-input.tokens.json # proprietary/tokens/src/components/ams/time-input.tokens.json # proprietary/tokens/src/components/ams/top-task-link.tokens.json # proprietary/tokens/src/components/ams/unordered-list.tokens.json
# Conflicts: # proprietary/tokens/src/components/ams/accordion.tokens.json # proprietary/tokens/src/components/ams/blockquote.tokens.json # proprietary/tokens/src/components/ams/description-list.tokens.json # proprietary/tokens/src/components/ams/figure.tokens.json # proprietary/tokens/src/components/ams/heading.tokens.json # proprietary/tokens/src/components/ams/ordered-list.tokens.json # proprietary/tokens/src/components/ams/page-heading.tokens.json # proprietary/tokens/src/components/ams/paragraph.tokens.json # proprietary/tokens/src/components/ams/unordered-list.tokens.json
# Conflicts: # proprietary/tokens/src/components/ams/accordion.tokens.json # proprietary/tokens/src/components/ams/button.tokens.json # proprietary/tokens/src/components/ams/checkbox.tokens.json # proprietary/tokens/src/components/ams/file-input.tokens.json # proprietary/tokens/src/components/ams/radio.tokens.json # proprietary/tokens/src/components/ams/search-field.tokens.json # proprietary/tokens/src/components/ams/switch.tokens.json # proprietary/tokens/src/components/ams/tabs.tokens.json
"font-size": { "value": "{ams.typography.body-text.xl.font-size}" }, | ||
"line-height": { "value": "{ams.typography.body-text.xl.line-height}" } |
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.
Hmm, icons can be paired with both text and headings, and these have different line heights for the same text levels.
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.
@alimpens We must update the Icon API for this. An icon can no longer just say “I’m with someone on text level 4”, because that could be either a heading (with a line height of 1.3) or a large paragraph (with 1.5).
How about
size: 'small' | 'medium' | 'large' | 'extra-large' | 'heading-0' … 'heading-6' ?
"normal": { "value": 400 }, | ||
"bold": { "value": 800 } | ||
"body-text": { | ||
"font-size": { "value": "clamp(1.125rem, calc(1.0313rem + 0.4688vw), 1.5rem)" }, |
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.
If we want to communicate that the 2 lists partially overlap, we could use a reference here. Something like {ams.typography.heading.5.font-size}
. That would also prevent inconsistencies.
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.
That’s because we made our ‘layer above brand’ invisible. You could say we lost the same kind of information in our colour tokens, where nothing explicitly indicates that our invalid red and error red stem from the same colour code.
So, relating a body text size to a heading size is incorrect – they have the same ancestor. Even more so because the only reason for a ‘level 5 heading’ font size to exist is to allow a Heading to match the font size of a paragraph.
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 know, what I mean is more: do we want to communicate this invisible layer to our users? Relating a body text size to a heading size isn't strictly correct, but we do communicate possibly valuable information to our users if we do.
Describe the pull request
Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.
What
Refactors typography tokens:
ams.text
toams.typography
to match NLDSbody-text
andheading
groups to prepare for separate line height valuesWhy
To implement a stable API of brand tokens for typography.
How
(How were these changes implemented? Provide a brief overview of the approach taken and any key considerations.)
Checklist
Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:
Additional notes