Tokens

Design tokens are the single source of truth for all visual decisions in useVyre. They are CSS custom properties that automatically adapt to light and dark themes.


Rule: Always use semantic tokens (--vyre-color-semantic-*), never primitive tokens (--vyre-color-primitive-*). Semantic tokens adapt to the theme — primitive tokens are fixed raw values.

Import

/* Import once at your app entry */
import "@usevyre/tokens/css";

/* Then use anywhere in CSS */
.my-button {
  background: var(--vyre-color-semantic-accent);
  color:      var(--vyre-color-semantic-accent-foreground);
  padding:    var(--vyre-spacing-2) var(--vyre-spacing-4);
  font-size:  var(--vyre-typography-font-size-sm);
  border-radius: var(--vyre-border-radius-md);
}
import { tokens } from "@usevyre/tokens";

// Typed JS object — useful for runtime theming or Storybook
console.log(tokens.color.semantic.accent); // "#7c3aed"

Theme system

Set data-theme on the <html> element to control the theme. Without it, the theme follows prefers-color-scheme.

<!-- Light (explicit) -->
<html data-theme="light">

<!-- Dark (explicit) -->
<html data-theme="dark">

<!-- Auto — follows prefers-color-scheme (default) -->
<html>

Color tokens

Semantic color tokens — use these in all component styles and custom CSS.

TokenLightDarkUsage
--vyre-color-semantic-background#ffffff#09090bPage/app background
--vyre-color-semantic-surface#fafafa#18181bCards, panels, sidebars
--vyre-color-semantic-surface-raised#f4f4f5#27272aDropdowns, popovers
--vyre-color-semantic-surface-overlay#ffffff#333338Modals, tooltips
--vyre-color-semantic-border#e4e4e7#3f3f46Default borders
--vyre-color-semantic-border-subtle#ebebec#27272aSection dividers
--vyre-color-semantic-border-strong#a1a1aa#71717aFocus rings, selected
--vyre-color-semantic-text-primary#09090b#fafafaHeadings, body
--vyre-color-semantic-text-secondary#52525b#a1a1aaDescriptions, subtitles
--vyre-color-semantic-text-muted#a1a1aa#71717aPlaceholders, timestamps
--vyre-color-semantic-text-disabled#d1d1d6#3f3f46Disabled state
--vyre-color-semantic-text-inverse#ffffff#09090bText on dark/accent bg
--vyre-color-semantic-accent#7c3aed#a78bfaBrand CTAs, highlights
--vyre-color-semantic-accent-hover#6d28d9#8b5cf6Hover on accent
--vyre-color-semantic-accent-foreground#ffffff#ffffffText on accent bg
--vyre-color-semantic-accent-subtle#f5f3ffrgba(167,139,250,0.1)Badge backgrounds
--vyre-color-semantic-teal#14b8a6#2dd4bfSecondary accent, code
--vyre-color-semantic-teal-hover#0d9488#14b8a6Hover on teal
--vyre-color-semantic-teal-subtlergba(20,184,166,.08)rgba(20,184,166,.1)Teal badge bg
--vyre-color-semantic-success#16a34a#4ade80Success states
--vyre-color-semantic-success-subtle#f0fdf4rgba(74,222,128,.08)Success badge bg
--vyre-color-semantic-warning#f59e0b#fbbf24Warnings, beta
--vyre-color-semantic-warning-subtle#fffbebrgba(251,191,36,.08)Warning badge bg
--vyre-color-semantic-danger#dc2626#f87171Errors, destructive
--vyre-color-semantic-danger-hover#ef4444#ef4444Hover on danger
--vyre-color-semantic-danger-subtle#fef2f2rgba(248,113,113,.08)Danger badge bg

Spacing tokens

TokenValuePreview
--vyre-spacing-14px
--vyre-spacing-28px
--vyre-spacing-312px
--vyre-spacing-416px
--vyre-spacing-520px
--vyre-spacing-624px
--vyre-spacing-832px
--vyre-spacing-1040px
--vyre-spacing-1248px

Typography tokens

TokenValueUsage
--vyre-typography-font-size-2xs0.625remTiny labels
--vyre-typography-font-size-xs0.6875remBadge text, captions
--vyre-typography-font-size-sm0.8125remDefault UI, buttons
--vyre-typography-font-size-md0.9375remBody text
--vyre-typography-font-size-lg1.125remLarge body, small headings
--vyre-typography-font-size-xl1.375remSection headings
--vyre-typography-font-size-2xl1.75remPage headings
--vyre-typography-font-size-3xl2.25remLarge headings
--vyre-typography-font-size-4xl3remHero headings

AI Token Reference

For AI agents, MCP servers, and custom tooling — all tokens are available as structured machine-readable JSON with light/dark values, usage hints, and related token links.

For AI agents: Use @usevyre/tokens/ai (or@usevyre/ai-context/tokens) instead of scraping this page. The JSON includes every token with both light and dark values, usage examples, and related token names.
// Machine-readable token reference for AI agents
import tokensRef from "@usevyre/tokens/ai";
// or via ai-context:
import tokensRef from "@usevyre/ai-context/tokens";

// Each semantic color token includes light + dark values, usage hints, and related tokens
const accent = tokensRef.categories.color.semantic.find(t => t.name === "color.semantic.accent");
// {
//   cssVar:        "--vyre-color-semantic-accent",
//   values:        { light: "#7c3aed", dark: "#a78bfa" },
//   aliases:       { light: "color.primitive.violet.600", dark: "color.primitive.violet.400" },
//   usage:         ["Button primary background", "Link active state", "Focus ring", ...],
//   relatedTokens: ["color.semantic.accent-hover", "color.semantic.accent-foreground", ...]
// }

// Spacing, typography, border-radius, shadow, transition, z-index also included
tokensRef.categories.spacing.tokens;    // [{ cssVar, value, description }, ...]
tokensRef.categories.borderRadius.tokens;
tokensRef.categories.shadow.tokens;

// AI usage rules (8 rules)
tokensRef.rules; // ["NEVER use primitive tokens ...", ...]