styles

Color

Color tells people where they are, what they can do, and what needs their attention.

Approved pairs

These are the foreground/background pairs the design uses, with their contrast. "Known issue" pairs fail WCAG AA today: don't use them in new work, and fixing them is the design system's first job.

SamplePairUsed forContrastWCAG AA
Aaw-black on whitebody text (text)15.91:1 min 4.5✓ Pass
Aaw-carbon on whitesecondary headings (text)9.54:1 min 4.5✓ Pass
Aaw-gray on whitesecondary text, captions (text)4.57:1 min 4.5✓ Pass
Aaw-gray on w-culturedsecondary text on light sections (text)4.27:1 min 4.5⚠ Known issue
Aaw-primary on whitelinks, outline buttons (text)5.11:1 min 4.5✓ Pass
Aawhite on w-primaryprimary button label (text)5.11:1 min 4.5✓ Pass
Aaw-primary on w-lavendersnackbar and alert text (text)4.44:1 min 4.5⚠ Known issue
Aaw-dark-primary on w-culturedheadings on light sections (text)10.78:1 min 4.5✓ Pass
Aaw-dark-primary on w-lavenderchips, selected items (text)10.04:1 min 4.5✓ Pass
Aawhite on w-dark-primarydark snackbar, dark sections (text)11.55:1 min 4.5✓ Pass
Aaw-danger on whiteerror icons and invalid-field borders (ui)3.30:1 min 3✓ Pass
Aaw-danger on whiteform error messages (text)3.30:1 min 4.5⚠ Known issue
Aawhite on w-dangerdanger badges and buttons (text)3.30:1 min 4.5⚠ Known issue
Aaw-black on w-warningwarning badges (text)11.04:1 min 4.5✓ Pass
Aaw-sapphire on whitesecondary links (text)6.82:1 min 4.5✓ Pass
Aaw-lightgray on whiteinput and checkbox borders (ui)1.68:1 min 3⚠ Known issue
Aaw-primary on whitefocus ring (ui)5.11:1 min 3✓ Pass

Using color for meaning

✓ Do

Pair a status color with a label or an icon: "Prezzo ribassato" with an arrow, an error message under the field.

✕ Don't

Show a price drop, an error or availability with color alone. Some people can't see the difference.

Adding a color

A new color is a token (/ds-add). Every pair it's meant for goes in contrast-pairs.json, and the check fails if one is below 4.5:1 for text or 3:1 for large text and UI.