Design Tokens
Lism CSS provides design tokens for the most commonly used CSS properties.
COLOR
| Token | Variable |
|---|---|
base |
--base |
base-2 |
--base-2 |
text |
--text |
text-2 |
--text-2 |
divider |
--divider |
link |
--link |
brand |
--brand |
accent |
--accent |
neutral |
--neutral |
For palette colors (--red, --blue, --green, etc.) and customization, see Color Tokens.
Typography
| Token | Variable |
|---|---|
FF (font-family) |
--ff--base, --ff--accent, --ff--mono |
FW (font-weight) |
--fw--light, --fw--normal, --fw--bold |
FZ (font-size) |
--fz--2xs to --fz--5xl |
HL (half-leading) |
--hl--xs, --hl--s, --hl--base, --hl--l, --hl--xl |
LH (line-height) |
--lh--xs, --lh--s, --lh--m, --lh--l, --lh--xl |
LTS (letter-spacing) |
--lts--xs, --lts--s, --lts--base, --lts--l, --lts--xl |
For details on each token and scaling rules, see Typography Tokens.
An overview of typography design tokens in Lism CSS, including font-family, font-size, line-height, and more.
RADIUS
| Token value | Variable | Class | Default value |
|---|---|---|---|
10 |
--bdrs--10 |
-bdrs:10 |
0.25rem |
20 |
--bdrs--20 |
-bdrs:20 |
0.375rem |
30 |
--bdrs--30 |
-bdrs:30 |
0.625rem |
40 |
--bdrs--40 |
-bdrs:40 |
1rem |
50 |
--bdrs--50 |
-bdrs:50 |
1.5rem |
99 |
--bdrs--99 |
-bdrs:99 |
99rem |
A second-order arithmetic progression: each increment grows by a constant amount (+0.125rem → +0.25rem → +0.375rem → +0.5rem), so the steps are finer at the small end and bolder at the large end.
<div class="-bdrs:10">...</div><div class="-bdrs:20">...</div><div class="-bdrs:30">...</div><div class="-bdrs:40">...</div><div class="-bdrs:50">...</div><div class="-bdrs:99">...</div>SHADOW
| Token value | Variable | Class |
|---|---|---|
10 |
--bxsh--10 |
-bxsh:10 |
20 |
--bxsh--20 |
-bxsh:20 |
30 |
--bxsh--30 |
-bxsh:30 |
40 |
--bxsh--40 |
-bxsh:40 |
50 |
--bxsh--50 |
-bxsh:50 |
Each --bxsh--{token} value is made of two layers: a faint shadow close to the element and the main shadow. The near layer uses the shadow size one step smaller and --shc--near, which is --shc at half opacity.
| Variable | Value |
|---|---|
--bxsh--10 |
var(--shsz--5) var(--shc--near), var(--shsz--10) var(--shc) |
--bxsh--20 |
var(--shsz--10) var(--shc--near), var(--shsz--20) var(--shc) |
--bxsh--30 |
var(--shsz--20) var(--shc--near), var(--shsz--30) var(--shc) |
--bxsh--40 |
var(--shsz--30) var(--shc--near), var(--shsz--40) var(--shc) |
--bxsh--50 |
var(--shsz--40) var(--shc--near), var(--shsz--50) var(--shc) |
The default values of the component variables are as follows.
| Component variable | Default value |
|---|---|
--shc |
var(--shadow) (hsl(220 2% 4% / 8%)) |
--shc--near |
color-mix(in srgb, var(--shc), transparent 50%) |
--shsz--5 |
0px 0px 1px |
--shsz--10 |
0px 1px 3px |
--shsz--20 |
0px 2px 6px |
--shsz--30 |
0px 4px 12px |
--shsz--40 |
0px 8px 24px |
--shsz--50 |
0px 16px 48px |
From 10 upward, the shadow sizes form a scale in which both the offset and the blur double at each step, and the blur is always 3x the offset. 5 is a blur-only step with no offset, used for the near layer of --bxsh--10.
<div class="-bxsh:10">...</div><div class="-bxsh:20">...</div><div class="-bxsh:30">...</div><div class="-bxsh:40">...</div><div class="-bxsh:50">...</div>SPACE
| Token value | Variable | Approx. |
|---|---|---|
5 |
--s5 |
4px |
10 |
--s10 |
8px |
15 |
--s15 |
12px |
20 |
--s20 |
16px |
25 |
--s25 |
20px |
30 |
--s30 |
24px |
35 |
--s35 |
32px |
40 |
--s40 |
40px |
45 |
--s45 |
52px |
50 |
--s50 |
64px |
60 |
--s60 |
104px |
70 |
--s70 |
168px |
The main scale (--s10 through --s70) follows the Fibonacci sequence ((0, 1,) 1, 2, 3, 5, 8, 13, 21, …) and is designed to build the vertical rhythm of typography. The base unit is --s-unit (default 0.5rem ≈ 8px).
Horizontal gaps and paddings do not need to follow the vertical rhythm, so up to 50 the main scale is filled in with 5-step midpoints: --s5 (4px), --s15 (12px), --s25 (20px), --s35 (32px), and --s45 (52px).
51015202530354045506070:root,.set--s { /* Spacing base unit ≈ 8px */ --s-unit: 0.5rem;
--s10: var(--s-unit); /* ≒ 8px */ --s20: calc(var(--s-unit) * 2); /* ≒ 16px */ --s30: calc(var(--s-unit) * 3); /* ≒ 24px */ --s40: calc(var(--s-unit) * 5); /* ≒ 40px */ --s50: calc(var(--s-unit) * 8); /* ≒ 64px */ --s60: calc(var(--s-unit) * 13); /* ≒ 104px */ --s70: calc(var(--s-unit) * 21); /* ≒ 168px */
/* 5-step fillers up to s50 (for horizontal gaps / paddings) */ --s5: calc(var(--s-unit) * 0.5); /* ≒ 4px */ --s15: calc(var(--s-unit) * 1.5); /* ≒ 12px */ --s25: calc(var(--s-unit) * 2.5); /* ≒ 20px */ --s35: calc(var(--s-unit) * 4); /* ≒ 32px */ --s45: calc(var(--s-unit) * 6.5); /* ≒ 52px */}
.set--s { --s-unit: 0.5em;}Spacing tokens work with every Property Class in the padding, margin, and gap families. See the Property Class reference table for details.
Additionally, the set--s class swaps --s-unit to 0.5em, recalculating spacing against the current font size.
If your site uses a fluid --fz--base (e.g. with clamp()) and you want spacing to change fluidly along with the font size, override the unit on :root, e.g. --s-unit: calc(var(--fz--base) * 0.5);.
Reference: On typography and spacing scaling design
OPACITY
| Token value | Variable | Class | Default value |
|---|---|---|---|
mp |
--o--mp |
-o:mp |
0.9 |
p |
--o--p |
-o:p |
0.8 |
pp |
--o--pp |
-o:pp |
0.6 |
ppp |
--o--ppp |
-o:ppp |
0.4 |
Named after musical dynamic markings (the piano family): the more times p (piano / soft) is repeated, the higher the transparency.
(mezzo-piano / piano / pianissimo / pianississimo)
mp: Lorem ipsum dolor sit amet. Consectetur adipiscing elit, sed do eiusmod tempor Incididunt ut.
p: Lorem ipsum dolor sit amet. Consectetur adipiscing elit, sed do eiusmod tempor Incididunt ut.
pp: Lorem ipsum dolor sit amet. Consectetur adipiscing elit, sed do eiusmod tempor Incididunt ut.
ppp: Lorem ipsum dolor sit amet. Consectetur adipiscing elit, sed do eiusmod tempor Incididunt ut.
<p class="-o:mp">mp: Lorem ipsum ...</p><p class="-o:p">p: Lorem ipsum ...</p><p class="-o:pp">pp: Lorem ipsum ...</p><p class="-o:ppp">ppp: Lorem ipsum ...</p><Text o="mp">mp: Lorem ipsum ...</Text><Text o="p">p: Lorem ipsum ...</Text><Text o="pp">pp: Lorem ipsum ...</Text><Text o="ppp">ppp: Lorem ipsum ...</Text>SIZE
Tokens for content sizing.
| Token value | Variable |
|---|---|
xs |
--sz--xs |
s |
--sz--s |
m |
--sz--m |
l |
--sz--l |
xl |
--sz--xl |
Available for use with max-sz, .is--wrapper, and similar utilities.