Veil UI

Theming

OKLCH tokens, dark mode and per-project customization.

Veil UI ships a monochrome token set in OKLCH. Tokens are CSS custom properties, mapped to Tailwind utilities through @theme inline, so a single override rethemes every component.

Core tokens

TokenUtilityPurpose
--backgroundbg-backgroundPage surface
--foregroundtext-foregroundPrimary text
--cardbg-cardRaised surfaces
--mutedbg-mutedSubtle fills
--muted-foregroundtext-muted-foregroundSecondary text
--primarybg-primaryPrimary action
--secondarybg-secondarySecondary action
--accentbg-accentHover surfaces
--destructivebg-destructiveDestructive action
--borderborder-borderDefault border
--inputborder-inputForm border
--ringring-ringFocus ring
--radiusrounded-mdBase radius

Light and dark

Tokens are declared on :root and overridden on .dark. Add the class to the <html> element — with next-themes, a theme script, or your own provider.

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
}

Radius

The whole scale derives from one value:

:root {
  --radius: 0.375rem; /* 6px */
}

--radius-sm, --radius-md, --radius-lg and --radius-xl are computed from it, so components stay proportional.

Adding an accent

Veil UI is intentionally monochrome, but a brand accent is a two-line change:

:root {
  --primary: oklch(0.55 0.22 264);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.55 0.22 264);
}

Because components reference semantic tokens, nothing else needs to change.

Charts

--chart-1 through --chart-5 provide a monochrome ramp for data visualization. Override them with a categorical palette if your product needs color.

Motion

Veil UI ships a small, dependency-free motion layer in the tokens. It is plain CSS — no animation package, no JavaScript — so it works in React, Vue and plain HTML alike.

Components opt in with two core utilities:

UtilityKeyframesDefault timing
animate-inveil-enter150ms, cubic-bezier(0.16, 1, 0.3, 1), backwards
animate-outveil-exit120ms, cubic-bezier(0.4, 0, 1, 1), forwards

Three kinds of modifier utilities tune the keyframes:

GroupClassesEffect
Fadefade-in-0, fade-out-0, fade-out-80Target opacity
Zoomzoom-in-95, zoom-out-95Scale target
Slideslide-in-from-{top,bottom,left,right}-{1,2,4,full}Translate offset
Slideslide-out-to-{top,bottom,left,right}-{1,2,4,full}Translate offset

They are composed with state variants, exactly like Radix examples:

<DialogContent
  className="data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95
             data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
/>

Disclosure panels use dedicated height keyframes that read the primitive's measured content height:

<AccordionContent className="overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up" />

animate-collapsible-down / animate-collapsible-up do the same for collapsibles.

Retiming

Durations come from CSS variables, so a single class retimes the animation without touching transitions:

<SheetContent className="[--veil-animation-duration:300ms] [--veil-exit-duration:200ms]" />

duration-* utilities set transition duration and do not retime animations — use the variables above.

Reduced motion

The base layer collapses every animation and transition to near-zero duration when prefers-reduced-motion: reduce is set. Enter/exit still runs (so Radix presence logic remains correct) but is imperceptible; nothing gets stuck mid-animation.

On this page