Skip to content

Commit 08ec616

Browse files
authored
Add some comments in _font-sizes.pcss (#30563)
... to let people know that these things shouldn't be used any more.
1 parent 362c7d2 commit 08ec616

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

res/css/_font-sizes.pcss

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,39 @@ Please see LICENSE files in the repository root for full details.
1212
* These are defined in `rem` so that they scale with the `font-size` of the root element (which is adjustable via the
1313
* "Font size" setting). They exist to make the job of converting designs (which tend to be based in pixels) into CSS
1414
* easier.
15+
*/
16+
17+
/*
18+
* These variables are now *deprecated* and should not be used in new code; instead Compound typographic tokens
19+
* should be used. Direct equivalents for these old font size tokens are listed below; where no equivalent exists,
20+
* that suggests that the design is using a non-standard font size and should be updated.
1521
*
22+
* In fact, modern Figma designs should actually use a named Typography style such as "Web/font/heading/sm/semibold",
23+
* translates directly to `font: var(--cpd-font-heading-sm-semibold)`.
1624
*/
1725
$font-1px: 0.0625rem;
1826
$font-8px: 0.5rem;
1927
$font-9px: 0.5625rem;
2028
$font-10px: 0.625rem;
2129
$font-10-4px: 0.6275rem;
22-
$font-11px: 0.6875rem;
30+
$font-11px: 0.6875rem; /* Compound equivalent: --cpd-font-size-body-xs */
2331
$font-12px: 0.75rem;
24-
$font-13px: 0.8125rem;
32+
$font-13px: 0.8125rem; /* Compound equivalent: --cpd-font-size-body-sm */
2533
$font-14px: 0.875rem;
26-
$font-15px: 0.9375rem;
34+
$font-15px: 0.9375rem; /* Compound equivalent: --cpd-font-size-body-md */
2735
$font-16px: 1rem;
28-
$font-17px: 1.0625rem;
36+
$font-17px: 1.0625rem; /* Compound equivalent: --cpd-font-size-body-lg */
2937
$font-18px: 1.125rem;
30-
$font-20px: 1.25rem;
38+
$font-20px: 1.25rem; /* Compound equivalent: --cpd-font-size-heading-sm */
3139
$font-22px: 1.375rem;
3240
$font-23px: 1.4375rem;
33-
$font-24px: 1.5rem;
41+
$font-24px: 1.5rem; /* Compound equivalent: --cpd-font-size-heading-md */
3442
$font-25px: 1.5625rem;
3543
$font-26px: 1.625rem;
36-
$font-28px: 1.75rem;
44+
$font-28px: 1.75rem; /* Compound equivalent: --cpd-font-size-heading-lg */
3745
$font-29px: 1.8125rem;
3846
$font-30px: 1.875rem;
39-
$font-32px: 2rem;
47+
$font-32px: 2rem; /* Compound equivalent: --cpd-font-size-heading-xl */
4048
$font-34px: 2.125rem;
4149
$font-35px: 2.1875rem;
4250
$font-39px: 2.4375rem;

0 commit comments

Comments
 (0)