Subframe has built-in dark mode support. Enable it in your theme to define light and dark values side by side, then sync to get a fully configured Tailwind setup.Documentation Index
Fetch the complete documentation index at: https://docs.subframe.com/llms.txt
Use this file to discover all available pages before exploring further.
Enable dark mode
- Open Theme in the top navigation
- In the theme toolbar above the Colors section, click Add dark mode
- Each token now shows light and dark values — edit the dark values to define your dark palette
- Preview your components and pages in both light and dark mode using the sun/moon toggle in the editor toolbar
How the generated code works
When dark mode is enabled, Subframe generates theme tokens as CSS variables so light and dark values can switch at runtime.- Tailwind v3
- Tailwind v4
The CLI syncs two files:Import
tailwind.config.js— references CSS variables instead of hardcoded values, withdarkMode: 'selector'enabledtheme.css— defines:rootvariables for light mode and.darkoverrides for dark mode
tailwind.config.js
theme.css
theme.css in your global stylesheet or entry point:globals.css
Sync to code
Run the CLI to sync your theme (including dark mode) to your codebase:Enable dark mode in your app
To activate dark mode, set thedark class on the <html> element. Here are a few ways to accomplish that:
Next.js with next-themes
app/layout.tsx
React with context
ThemeProvider.tsx
Theme toggle button
Best practices
Test both modes
Test both modes
Always test your application in both light and dark modes. Check for:
- Sufficient contrast ratios (use browser DevTools)
- Readability of all text
- Visibility of borders and dividers
- Proper styling of interactive states
Respect system preferences
Respect system preferences
Use the user’s system preference as the default:

