Typography #
Font tokens define roles like heading, body, or code to keep typography consistent.
They use system fonts with fallbacks for performance, while text color is controlled by --afp-color-text.
Font Family #
The default font is IBM Plex Sans, a versatile and modern typeface that balances readability with a contemporary aesthetic.
| Custom Property | Default | Preview |
|---|---|---|
--afp-font-family-body |
ui-sans-serif, system-ui, sans-serif |
Lorem ipsum dolor |
--afp-font-family-heading |
ui-sans-serif, system-ui, sans-serif |
Lorem ipsum dolor |
--afp-font-family-code |
ui-monospace, monospace |
Lorem ipsum dolor |
Font Sizes #
These properties use rem units in order to scale proportionately with the root font size.
The scale is constructed as follows:
--afp-font-size-mis the base size (0.875rem= 14px).--afp-font-size-mlis a secondary base (1rem= 16px).--afp-font-size-lmis an intermediate size (1.125rem= 18px).- Smaller sizes (
s,xs,2xs) are calculated by dividing the next-larger size by1.125. - Larger sizes (
l,xl,2xl, …) are calculated by multiplying the previous size by1.125 * 1.125(≈1.266).
Example calculations:
--afp-font-size-xs: round(calc(var(--afp-font-size-s) / 1.125), 1px);
Custom Properties #
| Custom Property | Default | Preview |
|---|---|---|
--afp-font-size-2xs |
0.6875rem (11px) |
AaBb |
--afp-font-size-xs |
0.75rem (12px) |
AaBb |
--afp-font-size-s |
0.8125rem (13px) |
AaBb |
--afp-font-size-m |
0.875rem (14px) |
AaBb |
--afp-font-size-ml |
1rem (16px) |
AaBb |
--afp-font-size-lm |
1.125rem (18px) |
AaBb |
--afp-font-size-l |
1.25rem (20px) |
AaBb |
--afp-font-size-xl |
1.5625rem (25px) |
AaBb |
--afp-font-size-2xl |
2rem (32px) |
AaBb |
--afp-font-size-3xl |
2.5625rem (41px) |
AaBb |
--afp-font-size-4xl |
3.25rem (52px) |
AaBb |
Multiplier #
--afp-font-size-scale
The global font-size multiplier --afp-font-size-scale lets you adjust all font sizes at once.
By default, this value is set to 1.
Each font-size step is calculated from this multiplier, with the resulting pixel values (based on a 16px root size) shown in the table below.
Font Weight #
Font weight properties are given common names or assigned specific roles.
| Custom Property | Default | Preview |
|---|---|---|
--afp-font-weight-light |
300 |
AaBb |
--afp-font-weight-normal |
400 |
AaBb |
--afp-font-weight-medium |
500 |
AaBb |
--afp-font-weight-semibold |
600 |
AaBb |
--afp-font-weight-bold |
700 |
AaBb |
Line Height #
Line heights control the distance between lines of text and are unitless to scale proportionately with text size.
| Custom Property | Default | Preview |
|---|---|---|
--afp-line-height-condensed |
1.2 |
AaBb |
--afp-line-height-normal |
1.6 |
AaBb |
--afp-line-height-expanded |
2 |
AaBb |
Links #
Together with --afp-color-text-link, these tokens add text decoration to <a> elements to signal their role as hyperlinks.
| Custom Property | Default |
|---|---|
--afp-link-decoration |
underline var(--afp-color-link) dotted |
--afp-link-decoration-thickness |
0.09375rem |
--afp-link-decoration-hover |
underline |
--afp-link-underline-offset |
0.125rem |
--afp-link-transition |
all var(--afp-transition-normal) var(--afp-transition-easing) |