Skip to content

Commit eccc430

Browse files
fix(clerk-js): Variable line-height discrepancy (#7112)
1 parent d4aef71 commit eccc430

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.changeset/hip-yaks-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fixes line-height discrepancy between browsers.

.changeset/twenty-sides-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Updates line-height calculations to follow font-sizing to fix differences across browsers.

packages/clerk-js/src/ui/foundations/typography.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ const fontWeights = Object.freeze({
99

1010
const lineHeights = Object.freeze({
1111
normal: 'normal',
12-
extraSmall: '1.33333',
13-
small: '1.38462',
14-
medium: '1.41176',
15-
large: '1.45455',
12+
extraSmall: '16 / 12', // = 1.33333
13+
small: '18 / 13', // = 1.38462
14+
medium: '24 / 17', // = 1.41176
15+
large: '16 / 11', // = 1.45455
1616
} as const);
1717

1818
const letterSpacings = Object.freeze({
1919
normal: 'normal',
2020
} as const);
2121

2222
export const FONT_SIZE_SCALE_RATIOS = Object.freeze({
23-
xs: '11 / 13', // 0.846154
24-
sm: '12 / 13', // 0.923077
25-
md: '1', // 1.0
26-
lg: '17 / 13', // 1.307692
27-
xl: '24 / 13', // 1.846154
23+
xs: '11 / 13', // = 0.846154
24+
sm: '12 / 13', // = 0.923077
25+
md: '1', // = 1.0
26+
lg: '17 / 13', // = 1.307692
27+
xl: '24 / 13', // = 1.846154
2828
} as const);
2929

3030
export type FontSizeKey = keyof typeof FONT_SIZE_SCALE_RATIOS;

0 commit comments

Comments
 (0)