Documentation Index
Fetch the complete documentation index at: https://docs.aspfox.com/llms.txt
Use this file to discover all available pages before exploring further.
How dark mode works
next-themes manages the dark class on the <html> element. Tailwind’s darkMode: 'class' strategy reads this class to activate dark-mode variants. The user’s preference (light / dark / system) is stored in localStorage and restored on every page load.
The theme toggle in the top navigation bar cycles through three states: Light → Dark → System. “System” follows the OS preference.
When a user changes their theme, the change takes effect immediately with no flash of unstyled content (FOUC). next-themes injects a small blocking script before the page renders that reads localStorage and applies the correct class before the first paint.
The CSS variable system
All colors are defined as CSS custom properties inindex.css. Tailwind uses these variables through its theme configuration. Every component uses semantic variable names, not hardcoded colors.
tailwind.config.ts:
Writing dark-mode-compatible components
Use semantic class names. The variable flips between light and dark values automatically — you do not writedark: variants for basic colors.
Correct — semantic classes:
| Class | Light | Dark | Use for |
|---|---|---|---|
bg-background | white | near-black | Page and card backgrounds |
text-foreground | dark gray | near-white | Primary text |
bg-muted | light gray | dark gray | Subtle backgrounds, table rows |
text-muted-foreground | medium gray | lighter gray | Secondary text, placeholders |
border-border | light gray | dark gray | All borders and dividers |
bg-primary | blue | slightly lighter blue | CTA buttons, active states |
text-primary-foreground | white | white | Text on primary backgrounds |
bg-destructive | red | darker red | Delete buttons, error states |
Customizing the brand color
To change the primary color from AspFox blue to your brand color:- Update
--primaryand--ringin:rootinindex.css - Update
--primaryand--ringin.darkinindex.css - Update the
primarycolor values intailwind.config.tsto match
bg-primary, text-primary, border-primary, ring-primary, or text-primary-foreground. No other changes are needed.
Example — changing to green: