Skip to content

Commit

Permalink
Update legacy JavaScript typography tokens (#2782)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer authored Nov 18, 2024
1 parent 27525c1 commit 0a6ec4e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 37 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-pots-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup-oss/design-tokens": patch
---

Updated the legacy JavaScript theme to the latest typography token values to match the modern CSS custom variables.
2 changes: 1 addition & 1 deletion packages/circuit-ui/styles/style-mixins.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('Style helpers', () => {
it('should match the snapshot for size one', () => {
const { styles } = typography('one')(light);
expect(styles).toMatchInlineSnapshot(
'"font-size:1rem;line-height:1.5rem;"',
`"font-size:1rem;line-height:1.375rem;"`,
);
});

Expand Down
36 changes: 18 additions & 18 deletions packages/design-tokens/tests/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ exports[`Themes > light > should match the snapshot 1`] = `
"mono": "Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace",
},
"fontWeight": {
"bold": "700",
"regular": "400",
"bold": "630",
"regular": "375",
},
"grid": {
"default": {
Expand Down Expand Up @@ -117,7 +117,7 @@ exports[`Themes > light > should match the snapshot 1`] = `
"body": {
"one": {
"fontSize": "1rem",
"lineHeight": "1.5rem",
"lineHeight": "1.375rem",
},
"two": {
"fontSize": "0.875rem",
Expand All @@ -126,46 +126,46 @@ exports[`Themes > light > should match the snapshot 1`] = `
},
"bodyLarge": {
"fontSize": "1.25rem",
"lineHeight": "1.75rem",
"lineHeight": "1.5rem",
},
"headline": {
"four": {
"fontSize": "1.125rem",
"lineHeight": "1.5rem",
"lineHeight": "1.375rem",
},
"one": {
"fontSize": "2rem",
"lineHeight": "2.25rem",
},
"three": {
"fontSize": "1.25rem",
"lineHeight": "1.5rem",
"fontSize": "1.125rem",
"lineHeight": "1.375rem",
},
"two": {
"fontSize": "1.5rem",
"lineHeight": "1.75rem",
"lineHeight": "1.625rem",
},
},
"subHeadline": {
"fontSize": "0.875rem",
"lineHeight": "1.25rem",
"fontSize": "1.125rem",
"lineHeight": "1.375rem",
},
"title": {
"four": {
"fontSize": "3.5rem",
"lineHeight": "3.5rem",
"fontSize": "2.5rem",
"lineHeight": "2.875rem",
},
"one": {
"fontSize": "7.5rem",
"lineHeight": "7.5rem",
"fontSize": "4rem",
"lineHeight": "4.5rem",
},
"three": {
"fontSize": "4rem",
"lineHeight": "4rem",
"fontSize": "3rem",
"lineHeight": "3.5rem",
},
"two": {
"fontSize": "6rem",
"lineHeight": "6rem",
"fontSize": "3rem",
"lineHeight": "3.5rem",
},
},
},
Expand Down
36 changes: 18 additions & 18 deletions packages/design-tokens/themes/legacy/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,43 +67,43 @@ export const typography = {
},
two: {
fontSize: '1.5rem',
lineHeight: '1.75rem',
lineHeight: '1.625rem',
},
three: {
fontSize: '1.25rem',
lineHeight: '1.5rem',
fontSize: '1.125rem',
lineHeight: '1.375rem',
},
four: {
fontSize: '1.125rem',
lineHeight: '1.5rem',
lineHeight: '1.375rem',
},
},
title: {
one: {
fontSize: '7.5rem',
lineHeight: '7.5rem',
fontSize: '4rem',
lineHeight: '4.5rem',
},
two: {
fontSize: '6rem',
lineHeight: '6rem',
fontSize: '3rem',
lineHeight: '3.5rem',
},
three: {
fontSize: '4rem',
lineHeight: '4rem',
fontSize: '3rem',
lineHeight: '3.5rem',
},
four: {
fontSize: '3.5rem',
lineHeight: '3.5rem',
fontSize: '2.5rem',
lineHeight: '2.875rem',
},
},
subHeadline: {
fontSize: '0.875rem',
lineHeight: '1.25rem',
fontSize: '1.125rem',
lineHeight: '1.375rem',
},
body: {
one: {
fontSize: '1rem',
lineHeight: '1.5rem',
lineHeight: '1.375rem',
},
two: {
fontSize: '0.875rem',
Expand All @@ -112,7 +112,7 @@ export const typography = {
},
bodyLarge: {
fontSize: '1.25rem',
lineHeight: '1.75rem',
lineHeight: '1.5rem',
},
};

Expand All @@ -123,8 +123,8 @@ export const fontStack: FontStack = {
};

export const fontWeight: FontWeight = {
regular: '400',
bold: '700',
regular: '375',
bold: '630',
};

export const grid: Grid = {
Expand Down

0 comments on commit 0a6ec4e

Please sign in to comment.