Tailwind CSS Config Reference

All tailwind.config.js keys with type, extend pattern and plugin options.

Searchable Tailwind CSS configuration reference covering content, theme, extend, variants, plugins, darkMode, prefix and important with each key's type and purpose.

What is the difference between theme and theme.extend?

Keys placed directly under theme replace Tailwind's default scale entirely for that property, so you lose the built-in values. Keys under theme.extend are merged on top of the defaults, adding your tokens while keeping the originals. Use extend unless you deliberately want to reset a scale.

What every tailwind.config.js key does

A tailwind.config.js file customises the design tokens, scanned files and build behaviour of Tailwind CSS. This reference lists the top-level configuration keys with their value type and purpose, and explains the crucial theme versus theme.extend distinction, searchable by key name.

How it works

Tailwind reads the exported config object at build time, resolves the theme (defaults merged with your customisations), scans the content globs for class names and emits only the utilities it finds:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js,ts,jsx,tsx}"],
  darkMode: "class",
  theme: {
    extend: {
      colors: { brand: "#0a7" },
      spacing: { 18: "4.5rem" },
    },
  },
  plugins: [require("@tailwindcss/forms")],
};

Values under theme.extend are merged on top of the defaults, while values placed directly under theme replace a default scale. prefix, important and darkMode tune output; plugins registers extra utilities.

Tips and notes

  • Prefer theme.extend so you keep Tailwind’s default scales.
  • Keep content globs tight but complete — missing paths silently drop classes.
  • darkMode: "class" enables a manual theme toggle; "media" follows the OS.
  • prefix: "tw-" namespaces every utility to avoid collisions with other CSS.
  • Tailwind v4 moves much config into CSS @theme; this reference targets the JS config (v3-style).