Dark Mode
Slate UI Kit includes built-in dark mode support. All components automatically adapt to dark mode when the .dark class is applied to a parent element.
Setup
Dark mode is automatically configured via CSS variables. No additional setup is required!
Usage
Class-Based Dark Mode
Apply the dark class to enable dark mode:
Toggle Dark Mode with Alpine.js
Toggle dark mode dynamically:
Using System Preference
With Tailwind CSS v4, dark mode uses prefers-color-scheme by default. To use class-based dark mode, configure it in your CSS:
Customization
Override Dark Mode Colors
Override CSS variables in resources/css/slate.css:
Component-Specific Dark Mode
Components automatically use dark mode colors when the .dark class is present. No additional configuration needed!
Examples
Button in Dark Mode
Input in Dark Mode
Color System
Slate uses semantic colors that automatically adapt to dark mode:
background/foreground- Page background and textprimary/primary-foreground- Main brand colormuted/muted-foreground- Subtle backgrounds/textborder- Border colors- And more...
All colors are defined in slate.css with both light and dark mode values using Tailwind CSS v4's @theme system.
Next Steps
- Theming - Learn more about customizing colors
- Components - See all components in dark mode