Theme for Tailwind CSSs
Theme configuration in Tailwind CSS is how you customise the design system to match a brand. You define colours, fonts, spacing, breakpoints and custom utilities in the configuration, or in the CSS theme layer in recent versions. This keeps every value consistent across the project and makes dark mode and rebranding a central change.
Stage: Customisation · Part of the Tailwind CSS roadmap · Last reviewed 19 November 2026
What to learn in Theme
- Add brand colours and custom fonts to the theme
- Change breakpoints and spacing scales to match a design
- Enable dark mode and style it using the dark: variant
- Use arbitrary values like w-[72px] sparingly for one-off cases
- Create a custom utility or plugin for a repeated pattern
Theme interview questions
What is the difference between extending and overriding the theme?
Extending adds new values, for example one extra colour, while keeping all the defaults. Overriding a key replaces the whole default set for that key, so old values like gray-500 disappear. Extend unless you deliberately want a smaller design scale.
How does dark mode work in Tailwind?
The dark: variant applies a utility in dark mode. It can follow the operating system preference through prefers-color-scheme, or a class or data attribute you toggle yourself, which supports a manual switch. You pair light and dark utilities, such as bg-white dark:bg-gray-900.
Where Theme fits in the Tailwind CSS roadmap
Theme belongs to the Customisation stage (beginner level). Make it yours.
Other units in this stage
Back to the full Tailwind CSS roadmap