Skip to content

Colours

Colour in Shavin has two layers. A gray scale (steps n-0 to n-1000) and one brand colour hold the raw values. Semantic tokens such as bg-surface and text-fg-muted pick from them, and components only use the semantic tokens. That is why changing the gray family, the brand or light and dark mode restyles everything at once.

Gray families

Five gray families ship with Shavin. Each one sets the same steps, from n-0 (white) to n-1000 (black). The values are the same in light and dark mode; what changes is which step each role uses. Pick a family with grayColor on ThemeProvider. Click a swatch to copy its hex.

50
100
200
300
400
500
600
700
800
850
900
950
Zinc
Slate
Gray
Neutral
Stone

Which step each role uses

TokenLightDarkUsed for
--bg-canvasn-100n-950Page background
--bg-surfacen-0 (white)n-900Cards, sidebars, inputs
--bg-surface-hovern-100n-850Hovered rows and controls
--bg-elevatedn-0 (white)n-850Menus, popovers, dialogs
--bg-elevated-hovern-100n-800Highlighted row inside a menu or select
--hairlinen-200n-800Borders and dividers
--hairline-strongn-300n-700Stronger borders, hover outlines
--border-controln-450n-500Input and checkbox borders
--fgn-950n-200Body text and titles
--fg-mutedn-600n-400Secondary text
--fg-subtlen-500n-450Captions, placeholders, meta

Semantic tokens

These are the tokens to use in your own code, as Tailwind classes (bg-surface, text-fg-muted, border-hairline) or as rgb(var(--fg)) in CSS. The swatches show the current theme: switch light and dark mode or the brand and they follow.

Backgrounds

Canvas
--bg-canvas
Surface
--bg-surface
Surface hover
--bg-surface-hover
Elevated
--bg-elevated
Elevated hover
--bg-elevated-hover

Borders

Hairline
--hairline
Hairline strong
--hairline-strong
Control border
--border-control

Text

Foreground
--fg
Muted
--fg-muted
Subtle
--fg-subtle
Link
--link
Focus ring
--focus

Brand

Brand
--brand
Brand hover
--brand-hover
On brand
--brand-fg
Brand text
--brand-text
Brand subtle
--brand-subtle

Status

Success
--success
Warning
--warning
Danger
--danger

Brand colour

You give Shavin one brand colour: one of the 24 presets below or any hex. The other brand tokens are worked out from it for light and dark mode, and text, links and focus rings are adjusted until they reach 4.6:1 on every page background. How brand colours stay readable shows it live.

--brandYour colour. Solid buttons, selected states, toggles.
--brand-hoverHover fill for solid brand controls. Keeps the button's text readable.
--brand-fgText and icons on a solid brand fill: white, or near-black when white is under 4.5:1.
--brand-text, --brand-contrastBrand-coloured text and icons on the page, at 4.6:1 or more.
--link, --focusLinks and focus rings. Same value as --brand-text.
--brand-subtle, --brand-subtle-hoverTints behind soft buttons and tags: 12% and 18% in light mode, 15% and 22% in dark.

Status colours

--success, --warning and --danger are fixed colours, not derived from the brand colour. Each has a -fg partner for text on a solid fill, and the light-mode values are darkened so they reach 4.5:1 as text and on their 15% tints.

More brand colours

If your brand has more than one colour, brand tokens turn each extra hex into the same set of contrast-checked tokens.

Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font