Theming

A guide to styling components with our color system.

Overview

Our styling system builds upon shadcn/ui's CSS variables approach with additional status colors and design tokens.

Installation

Copy and paste the following into your globals.css file:

Extended Color Variables

Cubby UI extends the standard shadcn/ui palette with additional tokens:

  • --neutral / --neutral-foreground: Neutral button variant
  • --danger / --danger-foreground / --danger-border: Error states with background tint
  • --warning / --warning-foreground / --warning-border: Warning states
  • --info / --info-foreground / --info-border: Informational states
  • --success / --success-foreground / --success-border: Success states
  • --sidebar-*: Dedicated sidebar color tokens
  • --scrollbar: Scrollbar thumb color

Brand-hue tint controls

Three tokens at the top of :root control the warmth of the entire neutral palette:

  • --neutral-hue: hue angle (0–360). The default 270 is a cool violet.
  • --neutral-chroma: chroma for mid-tone neutrals. The default 0.004 is barely tinted.
  • --neutral-chroma-low: chroma for near-extreme L (very light / very dark). Kept lower because high chroma at the extremes looks garish.

Change these to retune the whole stack — every neutral surface, foreground, and sidebar color references them. Try --neutral-hue: 220 for a cooler blue tilt or 30 for a warm tan tilt.

Surface elevation system

Cubby UI ships with an 8-level surface elevation ladder used by Cards, Popovers, Dialogs, Sheets, Drawers, and more. Each level has paired tokens:

  • --surface-1 through --surface-8: Substrate colors (light: pure neutrals; dark: progressive lightness with brand tint)
  • --surface-shadow-1 through --surface-shadow-8: Drop-shadow recipes (composed from --surface-shadow-ring/near/mid/far/ambient)
  • --surface-rim-1 through --surface-rim-8: Inset highlight + ring (no-op in light, painted in dark)

State overlays raise an underlying surface by a fixed perceptual delta:

  • --surface-hover: hover state overlay
  • --surface-selected: selected state overlay
  • --surface-rim-color: single-edge rim color (used by viewport-flush Sheet/Drawer)

For the full elevation system docs, see Surfaces.

Form-field tokens

Form fields (Input, Textarea, Checkbox, Radio, etc.) use three dedicated tokens:

  • --input: Default bg — aliased to --surface-3 so it matches Card surfaces
  • --input-elevated: Translucent overlay for the elevated variant — adapts to any substrate (use inside Cards, Dialogs, popovers)

See the Forms guide for when to use which variant.

Base UI Requirements

The @layer base section includes styles required for Base UI components to work correctly:

  • body { position: relative } - Fixes backdrop positioning issues on iOS Safari for dialog and popover components.

  • .root { isolation: isolate } - Creates a stacking context for Base UI's portal-based components (dialogs, popovers, tooltips). Apply the root class to your application wrapper element as shown in the Installation guide.

Dark Mode

For dark mode setup, see the shadcn/ui Dark Mode guide.