Appearance
Theme & color mode
@codefast/theme persists light, dark, or system, aligns the first paint with SSR, and exposes useTheme() everywhere in your app. Wire TanStack Start with the integration panel further down.
dark
Resolved appearance
Continue to appearance controls and samples.
Install @codefast/theme
Persisted light, dark, and system appearance, SSR-friendly first paint, and an optional TanStack Start adapter — see the integration guide below for wiring.
pnpm add @codefast/themeControls
Appearance & state
Exercise the same light/dark/system flow your users get from @codefast/theme: document class, cookie persistence, and live useTheme() values.
class so Tailwind dark: variants line up.Mode change vs hover motion
A new appearance applies to surfaces right away. Hover transitions on these samples are independent—use them to confirm both behaviors.
Hover scales; mode change snaps colors.
useTheme() in @codefast/theme.@codefast/theme is headless: no widgets, no CSS preset. This docs site also uses @codefast/ui for layout and demos — brand accent files live there, not here.@codefast/theme (cookie, SSR script, tab sync).neutral.css, blue.css) ships with the UI kit. Orthogonal to light/dark/system from @codefast/theme.<html> matches the first paint, and any route can use useTheme().Open the panel below for install, ordered steps, copy-paste __root.tsx, and a toggle example.
Design tokens
Semantic colors
On this site, semantic colors come from the docs CSS (e.g. @codefast/ui palettes). Switching mode here shows how @codefast/theme drives light/dark while those variables update underneath.
Background
--backgroundForeground
--foregroundPrimary
--primaryPrimary text
--primary-foregroundOn primary surfaces
Muted
--mutedMuted text
--muted-foregroundAccent
--accentDestructive
--destructiveBorder
--borderCard
--cardBehavior
What this app wires for you
The same defaults ship with the TanStack Start adapter: cookie persistence, SSR script, and smooth handoff to Tailwind tokens.
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 on ThemeProvider to avoid long cross-fades when swapping modes.
Motion
Transitions & mode switches
Larger samples and a slow-hover panel. Use them to confirm appearance updates apply immediately while hover-driven motion on controls still behaves normally.
Hover for scale and shadow; mode changes stay instant.
Long hover transition
700ms on hover; theme toggles should never “fade” through odd in-between colors.
Optional context
@codefast/ui samples
Only for this documentation site: see how light/dark/system from @codefast/theme affects real components. The package itself stays headless.
Loading samples…
How it fits together
@codefast/theme keeps the preference and document class. Tailwind and the UI preset supply dark: and CSS variables. Accent palettes come from a stylesheet import—see the home page install snippet.