Skip to main content

Appearance

Theme & color mode

Switch light, dark, or system mode for this site. Component previews below use your current tokens. For the 22 accent palettes (neutral, slate, blue, …), import a different .css file from @codefast/ui in your app—this site’s components section includes a theme picker for those.

Color mode
Controls whether this documentation site uses light or dark surfaces (and whether that follows the OS when set to system).
Current state
Values from useTheme().
Preferencesystem
Resolveddark
Modes
lightdarksystem
What you get
Behavior provided by @codefast/theme in this app.
  • Light, dark, and system (follow OS) modes.
  • Persisted preference (cookie) with SSR-friendly script to limit flash.
  • Tab sync and sensible color-scheme on the document.
  • disableTransitionOnChange enabled in the root shell to avoid jarring transitions while swapping modes.
Transitions while changing mode
While the theme switches, CSS transitions are briefly suppressed so colors snap consistently; they work again for hover and other interactions afterward.

Samples with transitions

Card

Hover for scale/shadow; mode changes should still feel instant.

Badge

Long transition box

Uses a 700ms transition for hover; appearance mode switches should not animate through intermediate colors.

Try it

  1. Use the mode buttons at the top of the page.
  2. Notice UI colors update immediately without a slow blend.
  3. Hover the samples—transitions should behave normally again.
Component preview
Common primitives using current semantic tokens.

Buttons

Badges

DefaultSecondaryDestructiveOutline

Alert

Cards

Surface
Card background and radius

Uses theme card tokens.

Typography
Muted vs foreground

Body text uses muted foreground.

Borders
Border token

Outlines respect the active mode.