
Theming and Dark Mode Support
How this template handles theming, dark mode, and CSS custom properties for a consistent visual experience.
This template includes built-in dark mode support and a flexible theming system powered by CSS custom properties and next-themes.
How Dark Mode Works
The theme system uses next-themes with automatic system preference detection. Users can toggle between light and dark modes using the button in the navigation bar.
Theme classes are applied to the root <html> element, and CSS variables in src/app/globals.css change accordingly:
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
/* ... more variables */
}
.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
}
Customizing Colors
To change the color palette, edit the CSS custom properties in globals.css. The template uses HSL values so you can adjust hue, saturation, and lightness independently.
Key variables to customize:
--primary— Accent color for links, buttons, and highlights--background/--foreground— Base page colors--muted/--muted-foreground— Secondary text and backgrounds--card/--card-foreground— Content card colors
Fonts
Heading and body fonts are configured in src/config/directory.config.ts:
theme: {
fontHeading: 'Cormorant_Garamond',
fontBody: 'Nunito',
},
Swap these to any Google Font supported by next/font. The font files are automatically optimized and self-hosted.
Components
The ThemeProvider component wraps the application and the ThemeToggle component provides the UI toggle. Both live in src/components/ and work out of the box.
Tip
When customizing colors, always test both light and dark modes. A color that looks great on white may be unreadable on a dark background.
Tagged with
More Articles
View all
How the Content System Works
An overview of the unified, config-driven content system that powers this template — from MDX files to rendered pages.

Built-in SEO Features
This template includes a sitemap, RSS feed, structured data, Open Graph metadata, and robots.txt — all configured automatically.

Search and Filtering
How the built-in search and tag filtering system helps visitors find content quickly across your directory.