Skip to content

Commit 618195d

Browse files
committed
Remove all legacy sizs and add text and subtext
1 parent b175d0c commit 618195d

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

src/Heading/Heading.module.css

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,12 @@
1010
font: var(--synth-font-heading-small);
1111
}
1212

13-
.md { /* same as text */
14-
font-size: var(--synth-font-size-base);
15-
font-weight: var(--synth-font-weight-bold);
16-
line-height: 1.25rem;
13+
.text {
14+
font: var(--synth-font-body-bold);
1715
}
1816

19-
.sm { /* same as subtext */
20-
font-size: .75rem;
21-
font-weight: var(--synth-font-weight-bold);
22-
line-height: 1rem;
23-
}
24-
25-
.xs { /* move to subtext? */
26-
font-size: .625rem;
27-
font-weight: var(--synth-font-weight-bold);
28-
letter-spacing: 0.0625rem;
29-
line-height: 0.875rem;
17+
.subtext {
18+
font: var(--synth-font-subtext-bold);
3019
}
3120

3221
.bold {

src/Heading/Heading.stories.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ export const Levels: Story = {
6464
<Heading level={1} size={HeadingSizes.LARGE}>The fastest way to recruit research participants</Heading>
6565
<Heading level={3} size={HeadingSizes.MEDIUM}>The fastest way to recruit research participants</Heading>
6666
<Heading level={4} size={HeadingSizes.SMALL}>The fastest way to recruit research participants</Heading>
67-
<Heading level={5} size="md">The fastest way to recruit research participants</Heading>
68-
<Heading level={6} size="sm">The fastest way to recruit research participants</Heading>
6967
</>
7068
),
7169
};
@@ -80,9 +78,8 @@ export const Sizes: Story = {
8078
<Heading level={2} size={HeadingSizes.LARGE}>This is a heading level 2 with size="large"</Heading>
8179
<Heading level={2} size={HeadingSizes.MEDIUM}>This is a heading level 2 with size="medium"</Heading>
8280
<Heading level={2} size={HeadingSizes.SMALL}>This is a heading level 2 with size="small"</Heading>
83-
<Heading level={2} size="md">This is a heading level 2 with size="md"</Heading>
84-
<Heading level={2} size="sm">This is a heading level 2 with size="sm"</Heading>
85-
<Heading level={2} size="xs">This is a heading level 2 with size="xs"</Heading>
81+
<Heading level={2} size={HeadingSizes.TEXT}>This is a heading level 2 with size="text"</Heading>
82+
<Heading level={2} size={HeadingSizes.SUBTEXT}>This is a heading level 2 with size="subtext"</Heading>
8683
</>
8784
),
8885
};

src/Heading/Heading.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export enum HeadingSizes {
88
LARGE = 'large',
99
MEDIUM = 'medium',
1010
SMALL = 'small',
11+
TEXT = 'text',
12+
SUBTEXT = 'subtext',
1113
};
1214

1315
export interface HeadingProps {
@@ -27,21 +29,18 @@ export interface HeadingProps {
2729
* @type {string}
2830
* @description Sizes map to the available font-sizes from the defined list of font-types.
2931
* Adjust for visual hierarchy.
30-
*
31-
* TODO: Update this to only use the HeadingSizes keys and update the types to not use string
3232
*/
33-
size: 'xs' | 'sm' | 'md' | 'large' | 'medium' | 'small';
33+
size: HeadingSizes;
3434
textAlign?: 'left' | 'center' | 'right';
3535
weight?: 'regular' | 'medium' | 'bold';
3636
}
3737

3838
const SIZE_CLASSES = {
39-
xs: styles.xs,
40-
sm: styles.sm,
41-
md: styles.md,
4239
[HeadingSizes.LARGE]: styles.large,
4340
[HeadingSizes.MEDIUM]: styles.medium,
4441
[HeadingSizes.SMALL]: styles.small,
42+
[HeadingSizes.TEXT]: styles.text,
43+
[HeadingSizes.SUBTEXT]: styles.subtext,
4544
} as const;
4645

4746
/* TODO Remove this? */
@@ -50,8 +49,8 @@ const LEVEL_CLASSES = {
5049
2: styles.medium,
5150
3: styles.medium, // This should be small?
5251
4: styles.small,
53-
5: styles.md,
54-
6: styles.sm,
52+
5: styles.text,
53+
6: styles.subtext,
5554
} as const;
5655

5756
const WEIGHT_CLASSES = {

0 commit comments

Comments
 (0)