Rokkit 1.0.3

Rokkit uses semantic z-depth color tokens that automatically adapt between light and dark modes. The system provides consistent visual hierarchy without manual color management.

Z-Depth Tokens

Colors use a numbered z-depth system (z1 through z10) where lower numbers are subtle and higher numbers are prominent:

TokenLight ModeDark ModeUsage
z150950Subtle backgrounds
z2100900Borders, dividers
z3200800Hover backgrounds
z4300700Active states
z5400600Muted text
z6500500Body text
z7600400Emphasis text
z8700300Headings
z9800200High contrast
z10900100Maximum contrast

Color Palettes

Rokkit includes these semantic color groups:

  • surface — Neutral grays for backgrounds, text, and borders
  • primary — Brand color for primary actions and focus states
  • secondary — Accent color for highlights and active indicators
  • accent — Additional emphasis color
  • success, warning, danger, info — Status colors

Usage

Use z-depth tokens as UnoCSS utility classes. The token resolves to the correct shade for the current mode (light or dark):

svelte
Highlighting code...

Customizing the Palette

Override the default colors by passing a custom palette to themeRules() in your UnoCSS config:

javascript
Highlighting code...

Dark Mode

Z-depth tokens automatically invert in dark mode. Set data-mode="dark" on your root element, and all z1-z10 values flip to their dark equivalents. No additional CSS needed.

Use the ThemeSwitcherToggle component from @rokkit/app to let users toggle between light, dark, and system modes:

svelte
Highlighting code...

Related

  • Styling — Theme architecture and CSS hooks
  • Icons — Icon mapping and customization