-
-
Notifications
You must be signed in to change notification settings - Fork 4
chore: css typography token unit tests #697
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
base: main
Are you sure you want to change the base?
Conversation
📖 Storybook Preview |
@@ -11,14 +11,6 @@ describe('Typography', () => { | |||
|
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.
Moved to separate PR #699
f5a4d25
to
34446fa
Compare
📖 Storybook Preview |
34446fa
to
3987c3a
Compare
@@ -33,7 +33,7 @@ export const AvatarBase = forwardRef<HTMLDivElement, AvatarBaseProps>( | |||
|
|||
const mergedClassName = twMerge( | |||
// Base styles | |||
'inline-flex items-center justify-center overflow-hidden bg-section', | |||
'bg-section inline-flex items-center justify-center overflow-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.
Prettier fix after rebase from main
3987c3a
to
9673ecb
Compare
@@ -92,11 +92,11 @@ | |||
--typography-s-body-xs-medium-font-size: var(--font-size-2); | |||
--typography-s-body-xs-medium-line-height: var(--line-height-2); | |||
--typography-s-body-xs-medium-font-weight: var(--font-weight-medium); | |||
--typography-s-body-xs-medium-letter-spacing: var(--letter-spacing-0); | |||
--typography-s-body-xs-medium-letter-spacing: var(--letter-spacing-1); |
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.
Fix from unit tests to align with figma!
📖 Storybook Preview |
📖 Storybook Preview |
9673ecb
to
a900074
Compare
📖 Storybook Preview |
Description
This PR adds comprehensive CSS typography tests to ensure consistency between Figma design tokens and the generated CSS variables. The tests validate that all typography-related CSS variables (font sizes, line heights, font weights, letter spacing, and font families) match their corresponding values in the Figma tokens.
What is the reason for the change?
We needed automated testing to verify that our CSS typography variables are correctly generated from the Figma design tokens and remain consistent across updates.
What is the improvement/solution?
typography.test.ts
that validates all typography CSS variables against their Figma token counterpartsletter-spacing-0
toletter-spacing-1
)Related issues
Fixes: #158
Manual testing steps
yarn workspace @metamask/design-tokens test
to execute the new typography testsScreenshots/Recordings
Before
No automated testing for CSS typography variables - potential for inconsistencies between Figma tokens and CSS output to go unnoticed.
After
Comprehensive test suite with 100% coverage ensuring typography CSS variables match Figma design tokens:
Pre-merge author checklist
Pre-merge reviewer checklist