Overview
Tailwind CSS v4 provides TypeScript-first configuration types for defining themes, plugins, and content sources. The configuration system supports both user-provided configs and fully resolved configs.UserConfig
TheUserConfig interface defines the structure for user-provided configuration.
Properties
UserConfig[]
Array of preset configurations to extend. Presets are merged in order, with later configs taking precedence.
ThemeConfig
Theme configuration for customizing design tokens.
Plugin[]
Array of plugins to extend Tailwind’s functionality.
ContentFile[] | ContentConfig
Content source configuration for scanning template files.Can be either:
- Simple array of file patterns or raw content
- Object with
relativeflag andfilesarray
DarkModeStrategy
Strategy for handling dark mode variants.Options:
false- Disable dark mode'media'- Useprefers-color-schememedia query'class'- Require.darkclass on HTML element['class', '.dark-theme']- Custom dark mode class'selector'- Use:where(.dark)selector['selector', '[data-theme="dark"]']- Custom selector['variant', '&:is(.dark *)']- Fully custom variant
string
Prefix to add to all utility class names.
string[]
Array of class names to exclude from generation.
boolean | string
Make all utilities
!important or scope them to a selector.'all' | Record<string, boolean>
Enable future opt-in features.
'all' | Record<string, boolean>
Enable experimental features.
ResolvedConfig
TheResolvedConfig interface represents a fully processed configuration after merging presets and resolving all values.
Properties
Record<string, Record<string, unknown>>
Fully resolved theme with all presets merged and functions evaluated.
PluginWithConfig[]
Array of resolved plugins with their configuration.
ResolvedContentConfig
Resolved content configuration.
DarkModeStrategy | null
Resolved dark mode strategy, or
null if disabled.string
Resolved prefix (empty string if none).
string[]
Resolved blocklist (empty array if none).
boolean | string
Resolved important setting.
Record<string, boolean>
Resolved future flags.
Record<string, boolean>
Resolved experimental flags.
ThemeConfig
Detailed structure for theme configuration.Theme Values
Theme values can be:- Static objects - Direct key-value pairs
- Functions - Receive
PluginUtilsand return values - null/undefined - Disable a theme section