Skip to content

Color

Color in Tessera UI follows a three-tier architecture: reference palettes define raw values, semantic tokens assign purpose, and component tokens enable per-element overrides. This separation ensures painless theming and reliable dark mode support.


Reference tokens (--ts-ref-*) are immutable raw color values. They never change between themes.

50#e8f0fe
100#d2e3fc
200#aecbfa
300#8ab4f8
400#669df6
500#4285f4
600#1a73e8
700#1967d2
800#185abc
900#174ea6
50#f0fdfa
100#ccfbf1
200#99f6e4
300#5eead4
400#2dd4bf
500#14b8a6
600#0d9488
700#0f766e
800#115e59
900#134e4a
0#ffffff
50#f8f9fc
100#f0f1f5
200#e1e3e8
300#c4c7cf
400#9196a1
500#737884
600#5a5f6a
700#434751
800#2c3038
900#1a1c23
50#f0fdf4
100#dcfce7
200#bbf7d0
300#86efac
400#4ade80
500#22c55e
600#16a34a
700#15803d
800#166534
900#14532d
50#fffbeb
100#fef3c7
200#fde68a
300#fcd34d
400#fbbf24
500#f59e0b
600#d97706
700#b45309
800#92400e
900#78350f
50#fef2f2
100#fee2e2
200#fecaca
300#fca5a5
400#f87171
500#ef4444
600#dc2626
700#b91c1c
800#991b1b
900#7f1d1d
50#f0f9ff
100#e0f2fe
200#bae6fd
300#7dd3fc
400#38bdf8
500#0ea5e9
600#0284c7
700#0369a1
800#075985
900#0c4a6e

Semantic tokens (--ts-color-*) assign purpose to reference colors. Components consume only these tokens, never raw palette values.

Primary Text

Primary text —ts-color-text-primary → —ts-ref-neutral-900

Secondary Text

Secondary text —ts-color-text-secondary → —ts-ref-neutral-700

Tertiary Text

Tertiary text —ts-color-text-tertiary → —ts-ref-neutral-500

Disabled Text

Disabled text —ts-color-text-disabled → —ts-ref-neutral-400

Inverse Text

Inverse text —ts-color-text-inverse → —ts-ref-neutral-0

On Primary

Text on primary fills —ts-color-text-on-primary → —ts-ref-white

Interactive Primary
Buttons, links—ts-color-interactive-primary → —ts-ref-primary-600
Primary Hover
Hover state—ts-color-interactive-primary-hover → —ts-ref-primary-700
Interactive Secondary
Secondary actions—ts-color-interactive-secondary → —ts-ref-secondary-600
Interactive Danger
Destructive actions—ts-color-interactive-danger → —ts-ref-danger-600

Containers use a subtle background paired with an accessible text color for the same hue.

Primary Container—ts-color-primary-container
Secondary Container—ts-color-secondary-container
Success Container—ts-color-success-container
Warning Container—ts-color-warning-container
Danger Container—ts-color-danger-container
Info Container—ts-color-info-container

Semi-transparent overlays convey interaction state. Applied on top of a component’s base color.

Hover
8% opacity
Focus
12% opacity
Pressed
12% opacity
Dragged
16% opacity

The same semantic tokens resolve to different values in light, dark, and high-contrast themes. Reference tokens remain unchanged.

Light Theme

bg-surface: #fafbff
bg-elevated: #ffffff
text-primary: #1a1c23
text-secondary: #434751
border-default: #e1e3e8
interactive-primary: #1a73e8

Dark Theme

bg-surface: #111318
bg-elevated: #1b1d24
text-primary: #f4f5f8
text-secondary: #cdd0d8
border-default: #2a2d36
interactive-primary: #1a73e8

High Contrast

bg-surface: #ffffff
text-primary: #000000
border-default: #000000
interactive-primary: #185abc

Key Differences

High contrast mode maximizes contrast ratios for WCAG AAA compliance. Borders become solid black, shadows are replaced with outlines, and interactive colors shift to darker shades for greater legibility.


  1. Never use reference tokens directly in component CSS. Always go through semantic tokens.
  2. Use container pairs (*-container + on-*-container) together to guarantee accessible text on colored backgrounds.
  3. Test in all three themes (light, dark, high contrast) when creating custom styles.
  4. Respect state layers — use the opacity tokens for hover/focus/pressed overlays rather than hardcoding colors.