Skip to content
Tailwind CSS

tailwind.config.js API Reference

Tailwind CSS configuration — customizing the theme, controlling content sources, and dark mode strategy.

By EZ4Code Team

Config

Keys in the tailwind.config.js object used to customize design tokens, scanned files, and dark mode.

theme: { extend: { ... } }

Customizes the default theme. Use extend to add or override tokens without replacing the defaults; top-level keys replace.

Returns: config

content: [...paths]

Array of file globs Tailwind scans to detect which classes to keep in the production build.

Returns: config

darkMode: 'media' | 'class' | 'selector' | [selector]

Controls how dark variants are applied: media (prefers-color-scheme), class (a parent .dark class), selector, or a custom selector.

Returns: config

theme.extend.colors: { ... }

Adds or overrides color tokens usable via utilities like bg-*, text-*, and border-*.

Returns: config

More Tailwind CSS API References