Theme Variable Reference

Complete documentation for all 74 CSS custom properties that control the Refraction UI visual identity. Split into Essential (~19 variables, always needed) and Advanced (~55 additional variables, optional).

Essential

19 variables

These are the only variables you need for Simple mode. Set your brand colors, pick your fonts, choose a radius.

Brand Colors

Core colors that define your brand. All color values use HSL format without the hsl() wrapper: "hue saturation% lightness%".

VariableControlsAcceptsDefault
--backgroundPage/app background colorHSL: H S% L%0 0% 99%
--foregroundDefault body text colorHSL: H S% L%240 10% 10%
--primaryPrimary brand color (buttons, links, active states)HSL: H S% L%250 50% 50%
--primary-foregroundText on primary colorHSL: H S% L%0 0% 100%
--secondarySecondary actions and subdued surfacesHSL: H S% L%240 5% 96%
--secondary-foregroundText on secondary colorHSL: H S% L%240 4% 44%
--mutedSubdued backgrounds (disabled states, secondary surfaces)HSL: H S% L%240 5% 96%
--muted-foregroundSubdued text (placeholders, secondary labels)HSL: H S% L%240 4% 44%
--accentHighlighted/hover backgroundsHSL: H S% L%250 30% 95%
--accent-foregroundText on accent colorHSL: H S% L%250 50% 40%
--destructiveError and danger actionsHSL: H S% L%0 84% 50%
--destructive-foregroundText on destructive colorHSL: H S% L%0 0% 100%
--borderDefault border color for cards, dividersHSL: H S% L%240 6% 92%
--inputInput field border colorHSL: H S% L%240 6% 92%
--ringFocus ring colorHSL: H S% L%250 50% 50%

Fonts

CSS font-family stacks for body text, headings, and monospace code.

VariableControlsAcceptsDefault
--font-sansBody/UI text font stackCSS font-family string'Inter', system-ui, sans-serif
--font-headingHeading font stack (can differ from body for personality)CSS font-family string'Inter', system-ui, sans-serif
--font-monoCode and monospace font stackCSS font-family string'JetBrains Mono', ui-monospace, monospace

Shape & Feel

The base border-radius that sets the overall shape language of your UI.

VariableControlsAcceptsDefault
--radiusBase radius (used as the default across components)rem/px value0.375rem

Advanced

55 additional variables

Optional branding controls for designers who want to fine-tune every visual detail. These all have sensible defaults.

Extended Colors

Additional color tokens for cards, popovers, semantic states, sidebar, and data visualization.

VariableControlsAcceptsDefault
--cardCard component backgroundHSL: H S% L%0 0% 99%
--card-foregroundCard component text colorHSL: H S% L%240 10% 10%
--popoverPopover/dropdown backgroundHSL: H S% L%0 0% 100%
--popover-foregroundPopover/dropdown text colorHSL: H S% L%240 10% 10%
--successSuccess indicators and confirmationsHSL: H S% L%142 71% 35%
--success-foregroundText on success colorHSL: H S% L%0 0% 100%
--warningWarning indicatorsHSL: H S% L%38 92% 50%
--warning-foregroundText on warning colorHSL: H S% L%240 10% 10%
--sidebar-backgroundSidebar backgroundHSL: H S% L%0 0% 98%
--sidebar-foregroundSidebar text colorHSL: H S% L%240 10% 10%
--sidebar-primarySidebar active item highlightHSL: H S% L%250 50% 50%
--sidebar-primary-foregroundText on sidebar active itemHSL: H S% L%0 0% 100%
--sidebar-accentSidebar hover/subtle highlightHSL: H S% L%250 30% 95%
--sidebar-accent-foregroundText on sidebar accentHSL: H S% L%250 50% 40%
--sidebar-borderSidebar border colorHSL: H S% L%240 6% 92%
--sidebar-ringSidebar focus ringHSL: H S% L%250 50% 50%
--chart-1Primary chart colorHSL: H S% L%250 50% 50%
--chart-2Second chart colorHSL: H S% L%173 80% 36%
--chart-3Third chart colorHSL: H S% L%38 92% 50%
--chart-4Fourth chart colorHSL: H S% L%330 65% 50%
--chart-5Fifth chart colorHSL: H S% L%201 96% 42%

Typography Details

Controls the visual treatment of headings and base text size.

VariableControlsAcceptsDefault
--heading-weightFont weight for headings100-900600
--heading-letter-spacingLetter spacing for headings (negative = tighter)em value-0.02em
--heading-line-heightLine height for headingsunitless ratio1.2
--font-size-baseBase body text sizerem/px value1rem

Per-Component Radius

Override the border-radius for individual component types.

VariableControlsAcceptsDefault
--avatar-radiusAvatar border radiusrem/px/9999px9999px
--badge-radiusBadge border radiusrem/px/9999px9999px
--button-radiusButton border radiusrem/px value0.375rem
--card-radiusCard border radiusrem/px value0.5rem

Depth -- Shadows

Shadow scale and per-component shadow overrides.

VariableControlsAcceptsDefault
--shadow-smSmall shadow (subtle elevation)CSS box-shadow0 1px 2px 0 rgb(0 0 0 / 0.03)
--shadow-mdMedium shadow (cards, dropdowns)CSS box-shadow0 2px 4px -1px rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.03)
--shadow-lgLarge shadow (modals, popovers)CSS box-shadow0 6px 10px -2px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.03)
--card-shadowCard component shadowCSS box-shadow or none0 1px 2px 0 rgb(0 0 0 / 0.03)
--button-shadowButton shadow (often none)CSS box-shadow or nonenone

Transparency & Glass

Controls for overlay darkness, blur effects, and glassmorphism.

VariableControlsAcceptsDefault
--overlay-opacityBackdrop overlay darkness (dialogs, drawers)0-10.5
--backdrop-blurBackdrop blur amountpx value8px
--glass-bgGlass effect background colorrgba() valuergba(252, 252, 253, 0.8)

Density

Controls how compact or spacious the UI feels.

VariableControlsAcceptsDefault
--spacing-scaleGlobal spacing multiplier (affects all spacing)0.85-1.21
--card-paddingInternal padding of card componentsrem value1.5rem
--input-heightHeight of input fieldsrem value2.5rem
--container-max-widthMax width of the main content containerpx value1280px

Borders

Border width control.

VariableControlsAcceptsDefault
--border-widthDefault border width for all bordered elementspx value1px

Component Styles

Behavioral keywords that control component appearance.

VariableControlsAcceptsDefault
--input-styleInput visual stylebordered | filled | underlinebordered
--button-styleDefault button visual stylefilled | outline | ghost-defaultfilled
--hover-effectWhat happens on hoverdarken | lighten | shadow-lift | scaledarken
--disabled-opacityOpacity of disabled elements0-10.5
--link-styleHow links are visually distinguishedcolor-only | underline | underline-on-hovercolor-only
--focus-ring-styleFocus indicator stylering | outline | shadowring
--icon-styleIcon set styleoutlined | filled | duotoneoutlined
--icon-stroke-widthStroke width for outlined iconsnumber (1-3)1.5
--tooltip-styleTooltip color schemedark | light | primarydark
--table-styleTable row treatmentclean | striped | borderedclean
--scrollbar-styleScrollbar visibility and widththin | hidden | defaultthin

Selection Highlight

Controls the color of text when selected with the cursor.

VariableControlsAcceptsDefault
--selection-backgroundBackground color of selected textHSL: H S% L%250 50% 90%
--selection-foregroundText color of selected textHSL: H S% L%240 10% 10%

Usage Tips

  • HSL format: Color values use raw HSL values without the hsl() wrapper. Write 250 50% 50% not hsl(250, 50%, 50%).
  • Contrast: All foreground/background pairs should meet WCAG AA contrast (4.5:1 for text, 3:1 for large text).
  • Simple mode: Start with just the Essential variables. The Advanced controls all have good defaults and can be added later.
  • Density: The --spacing-scale acts as a global multiplier. Values below 1 make the UI denser, above 1 make it more spacious.