Theming
A theme is a style, an accent colour and a few options, set on one element. Every component reads the same tokens, so they all follow.
The theme root
Put the settings on <html> (or any element, to theme just that part of the page).
<html data-vin-style="tactile" data-vin-mode="dark" data-vin-radius="lg" style="--vin-accent: #0d9488">Without data-vin-mode, light or dark follows the visitor's system setting.
Accent colour
Any colour works. VinUI works out readable text on top of it, and a darker or lighter shade where the accent is used as text, so contrast stays at WCAG AA. The CLI writes these into vin.css; in plain HTML, setting --vin-accent is enough.
Options
| Attribute | Values |
|---|---|
data-vin-style | precision, tactile, clay, tonal, editorial, terminal, paper, bento |
data-vin-mode | light, dark (leave off for system) |
data-vin-radius | none, sm, md, lg, full |
data-vin-gray | slate, stone |
data-vin-font | inter, geist, system, mono, custom (with --vin-font) |
data-vin-density | compact, comfortable |
data-vin-motion | reduced, off |
Theme files
The Customize panel in the header exports your theme as vin-theme.json and saves named themes in your browser. Start a project from one:
npx @vinish/ui init --theme ./vin-theme.jsonSwitch styles later without touching your components; only vin.css changes.
npx @vinish/ui style editorialCustomize
Saved in this browser. Style and accent are in the header.