Skip to main content

Token Reference

Every visual decision in VhyxUI is a CSS custom property. Override any token in :root to retheme the entire library. No JavaScript. No configuration object. Just CSS.

your-theme.css
:root {
  /* Override accent to your brand blue */
  --vhyx-color-accent:       #2563eb;
  --vhyx-color-accent-hover: #1d4ed8;

  /* Tighter radius everywhere */
  --vhyx-radius-sm: 2px;
  --vhyx-radius-md: 4px;
  --vhyx-radius-lg: 6px;
}

Color Tokens

Semantic color tokens are what components use. They reference primitive values internally. Overriding a semantic token updates every component that uses it — you never touch the component itself.

Dark mode is handled by redefining the same semantic tokens under [data-theme="dark"]. You only override the semantic layer — primitive values stay constant.

Background

TokenLightDarkUsage
--vhyx-color-bg#f8fafc#020617Page background
--vhyx-color-bg-subtle#f1f5f9#0f172aSubtle section backgrounds
--vhyx-color-bg-muted#e2e8f0#1e293bMuted backgrounds, skeleton
--vhyx-color-bg-inverse#0f172a#f8fafcInverse backgrounds

Surface

TokenLightDarkUsage
--vhyx-color-surface#ffffff#0f172aCard, Panel surfaces
--vhyx-color-surface-raised#ffffff#1e293bElevated surfaces, popovers
--vhyx-color-surface-overlay#ffffff#1e293bDialog, Drawer backgrounds

Border

TokenLightDarkUsage
--vhyx-color-border#e2e8f0#1e293bDefault borders
--vhyx-color-border-strong#cbd5e1#334155Emphasis borders
--vhyx-color-border-focus#6366f1#818cf8Focus ring color

Text

TokenLightDarkUsage
--vhyx-color-text#0f172a#f8fafcPrimary text
--vhyx-color-text-subtle#64748b#94a3b8Secondary labels, hints
--vhyx-color-text-muted#94a3b8#64748bPlaceholder, disabled labels
--vhyx-color-text-disabled#cbd5e1#475569Disabled state text
--vhyx-color-text-inverse#f8fafc#0f172aText on dark backgrounds
--vhyx-color-text-on-accent#ffffff#ffffffText on accent-colored elements

Accent

TokenLightDarkUsage
--vhyx-color-accent#6366f1#6366f1Primary interactive color
--vhyx-color-accent-hover#4f46e5#4f46e5Accent hover state
--vhyx-color-accent-active#4338ca#4338caAccent pressed state
--vhyx-color-accent-subtle#eef2ff#1e1b4bAccent tint backgrounds
--vhyx-color-accent-muted#e0e7ff#312e81Accent muted backgrounds

Semantic — Success · Danger · Warning · Info

TokenLightDarkUsage
--vhyx-color-success#22c55e#22c55eSuccess state
--vhyx-color-success-hover#16a34a#16a34aSuccess hover
--vhyx-color-success-subtle#f0fdf4#052e16Success tint background
--vhyx-color-success-text#15803d#15803dSuccess text on subtle bg
--vhyx-color-danger#ef4444#ef4444Danger / destructive state
--vhyx-color-danger-hover#dc2626#dc2626Danger hover
--vhyx-color-danger-subtle#fef2f2#450a0aDanger tint background
--vhyx-color-danger-text#b91c1c#b91c1cDanger text on subtle bg
--vhyx-color-warning#f59e0b#f59e0bWarning state
--vhyx-color-warning-hover#d97706#d97706Warning hover
--vhyx-color-warning-subtle#fffbeb#431407Warning tint background
--vhyx-color-warning-text#d97706#d97706Warning text on subtle bg
--vhyx-color-info#3b82f6#3b82f6Info state
--vhyx-color-info-hover#2563eb#2563ebInfo hover
--vhyx-color-info-subtle#eff6ff#0c1a45Info tint background
--vhyx-color-info-text#2563eb#2563ebInfo text on subtle bg

Spacing Tokens

All spacing values follow a 4px base grid. Every token is a multiple of 4px, keeping your layout consistent without manual arithmetic.

TokenValueNotes
--vhyx-space-px1px
--vhyx-space-00
--vhyx-space-0-50.125rem — 2px
--vhyx-space-10.25rem — 4px
--vhyx-space-1-50.375rem — 6px
--vhyx-space-20.5rem — 8px
--vhyx-space-2-50.625rem — 10px
--vhyx-space-30.75rem — 12px
--vhyx-space-3-50.875rem — 14px
--vhyx-space-41rem — 16px
--vhyx-space-51.25rem — 20px
--vhyx-space-61.5rem — 24px
--vhyx-space-71.75rem — 28px
--vhyx-space-82rem — 32px
--vhyx-space-102.5rem — 40px
--vhyx-space-123rem — 48px
--vhyx-space-164rem — 64px
--vhyx-space-205rem — 80px
--vhyx-space-246rem — 96px
--vhyx-space-328rem — 128px

Typography Tokens

Font families, sizes, weights, line heights, and letter spacing are all token-driven. Override --vhyx-font-sans once and every component picks up your custom typeface.

Font sizes

TokenValueNotes
--vhyx-text-2xs0.625rem — 10px
--vhyx-text-xs0.75rem — 12px
--vhyx-text-sm0.875rem — 14px
--vhyx-text-md1rem — 16pxbody default
--vhyx-text-lg1.125rem — 18px
--vhyx-text-xl1.25rem — 20px
--vhyx-text-2xl1.5rem — 24px
--vhyx-text-3xl1.875rem — 30px
--vhyx-text-4xl2.25rem — 36px

Font weights

TokenValueNotes
--vhyx-weight-light300
--vhyx-weight-normal400default
--vhyx-weight-medium500
--vhyx-weight-semibold600
--vhyx-weight-bold700
--vhyx-weight-extrabold800

Line height

TokenValueNotes
--vhyx-leading-none1
--vhyx-leading-tight1.25
--vhyx-leading-snug1.375
--vhyx-leading-normal1.5default
--vhyx-leading-relaxed1.625
--vhyx-leading-loose2

Letter spacing

TokenValueNotes
--vhyx-tracking-tight-0.025em
--vhyx-tracking-normal0em
--vhyx-tracking-wide0.025em
--vhyx-tracking-wider0.05em
--vhyx-tracking-widest0.1em

Motion Tokens

All animations and transitions are driven by duration and easing tokens. When a user has prefers-reduced-motion: reduce set, all duration tokens automatically collapse to 0ms — zero JavaScript required.

Durations

TokenValueNotes
--vhyx-duration-instant50msmicro-feedback, active states
--vhyx-duration-fast100mstooltips, simple show/hide
--vhyx-duration-normal200msmost transitions
--vhyx-duration-slow350msdialog, drawer entry
--vhyx-duration-glacial500mslarge layout shifts

Easing curves

TokenValueNotes
--vhyx-easing-linearlinear
--vhyx-easing-standardcubic-bezier(0.4, 0, 0.2, 1)general purpose
--vhyx-easing-deceleratecubic-bezier(0, 0, 0.2, 1)elements entering the screen
--vhyx-easing-acceleratecubic-bezier(0.4, 0, 1, 1)elements leaving the screen
--vhyx-easing-springcubic-bezier(0.34, 1.56, 0.64, 1)switch, popover, toast
--vhyx-easing-bouncecubic-bezier(0.68, -0.55, 0.265, 1.55)playful overshoot
--vhyx-easing-smoothcubic-bezier(0.25, 0.46, 0.45, 0.94)smooth deceleration

Component Sizes

Interactive element heights are locked to the size scale. Every component that accepts a size prop maps to one of these tokens, keeping your UI visually consistent across Button, Input, Select, and every other form control.

Height scale

TokenValueNotes
--vhyx-size-xs1.5rem — 24pxxs components
--vhyx-size-sm2rem — 32pxsm components
--vhyx-size-md2.5rem — 40pxmd components (default)
--vhyx-size-lg3rem — 48pxlg components
--vhyx-size-xl3.5rem — 56pxxl components

Border radius

TokenValueNotes
--vhyx-radius-none0
--vhyx-radius-xs2px
--vhyx-radius-sm4pxsmall inputs, badges
--vhyx-radius-md6pxbuttons, inputs (default)
--vhyx-radius-lg8pxcards
--vhyx-radius-xl12pxdialogs, drawers
--vhyx-radius-2xl16px
--vhyx-radius-3xl24px
--vhyx-radius-full9999pxpills, switches

Z-Index Scale

Every layering decision uses a named token. Nothing in VhyxUI uses a magic number like z-index: 9999. If you need a custom layer, use the nearest token and build relative to it.

TokenValueNotes
--vhyx-z-hide-1visually hidden but in flow
--vhyx-z-base0default stacking context
--vhyx-z-raised10elevated cards
--vhyx-z-dropdown100Select, Dropdown menus
--vhyx-z-sticky200sticky headers, sidebars
--vhyx-z-banner250announcement banners
--vhyx-z-overlay300Dialog and Drawer overlays
--vhyx-z-modal400Dialog and Drawer content
--vhyx-z-popover450Popover, Tooltip
--vhyx-z-toast500Toast notifications
--vhyx-z-tooltip550Tooltips (above everything)
--vhyx-z-top999Emergency override