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

feat!: Change naming approach of all typography tokens #1845

Closed

Conversation

VincentSmedinga
Copy link
Contributor

@VincentSmedinga VincentSmedinga commented Feb 1, 2025

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:

  • Renames ams.text to ams.typography to match NLDS
  • Splits font size, line height and font weight tokens into body-text and heading groups to prepare for separate line height values
  • Changes the options for the size prop of Icon and Icon Button to reflect that they may be paired with either a heading or body text component, whose line heights may differ even if their font sizes are the same
  • Updates examples for Icon and Icon Button, and adds examples of a pairing with Heading or Paragraph
  • Adds a missing font-weight token to Button
  • Removes an unnecessary font-family token from Switch

Why

To implement a stable API of brand tokens for typography.

How

Meticulously.

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:

  • Add or update unit tests
  • Add or update documentation
  • Add or update stories
  • Add or update exports in index.* files
  • Start the PR title with a Conventional Commit prefix, as explained here.

Additional notes

  • Next up: update line height values in a separate PR
  • The bottom half of the Typography documentation is a bit out of place, but hasn’t changed in this PR. Out of scope.

# 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
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 1, 2025 23:09 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 4, 2025 12:57 Destroyed
# 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
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 12, 2025 13:49 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 12, 2025 13:55 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 14, 2025 13:50 Destroyed
# Conflicts:
#	proprietary/tokens/src/components/ams/link-list.tokens.json
#	proprietary/tokens/src/components/ams/link.tokens.json
#	proprietary/tokens/src/components/ams/page-menu.tokens.json
#	proprietary/tokens/src/components/ams/top-task-link.tokens.json
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 18, 2025 15:43 Destroyed
Comment on lines 8 to 9
"font-size": { "value": "{ams.typography.body-text.xl.font-size}" },
"line-height": { "value": "{ams.typography.body-text.xl.line-height}" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed on body-text-small, body-text-large, heading-3, heading-4, heading-5 and heading-6. We don’t see icons being combined with Headings 1 and 2 or extra large body text like Blockquote.

It’s become a hefty refactoring of the Icon and Icon Button components and the prop values aren’t the prettiest, but I think this is what needs to be expressed.

@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 19, 2025 08:16 Destroyed
@VincentSmedinga VincentSmedinga marked this pull request as draft February 20, 2025 07:30
@VincentSmedinga VincentSmedinga changed the title feat!: Split text tokens into ‘body text’ and ‘heading’ groups and rename to ‘typography’ feat!: Change all text tokens to improve modeling and rename to typography Feb 20, 2025
@VincentSmedinga VincentSmedinga changed the title feat!: Change all text tokens to improve modeling and rename to typography feat!: Change naming approach of all typography tokens Feb 20, 2025
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 21, 2025 13:11 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-1073-refactor-text-level-scale February 25, 2025 15:32 Destroyed
@VincentSmedinga
Copy link
Contributor Author

I’m replacing this PR with a fresh one.

@VincentSmedinga VincentSmedinga deleted the feature/DES-1073-refactor-text-level-scale branch February 26, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants