Skip to content

Does Tailwind CSS v4 have a config file?

Not by default: v4 is configured in CSS with @theme. Where every v3 setting went, how to load an old tailwind.config.js with @config, and when to keep it.

Updated 23 November 2026Tested with
  • Tailwind CSS 4.3.5

No, not by default. A new Tailwind CSS v4 project has no tailwind.config.js. Your configuration lives in the CSS file that imports Tailwind, under @theme and a few other directives. If you have an old config file you still need, one line loads it: @config "./tailwind.config.js";.

That's the short answer. The rest of this page shows where each v3 setting went, and the two cases where keeping the JavaScript file still makes sense.

Where the configuration lives now

Everything starts with one import in your main stylesheet:

src/styles/global.cssCSS
@import "tailwindcss"; @theme {  --color-brand: oklch(0.55 0.2 260);  --font-display: "Inter Tight", sans-serif;  --breakpoint-3xl: 120rem;}

Each variable in @theme creates utilities. --color-brand gives you bg-brand, text-brand, border-brand and the rest. --font-display gives you font-display. --breakpoint-3xl adds a 3xl: variant. The prefix of the variable name (the namespace) decides which utilities you get, so the name matters more than it did in a JavaScript object.

Here is how the v3 keys map:

v3 tailwind.config.jsv4 CSS
theme.extend.colors@theme { --color-*: … }
theme.extend.fontFamily@theme { --font-*: … }
theme.extend.screens@theme { --breakpoint-*: … }
theme.extend.spacing@theme { --spacing: … } (one base value) or --spacing-*
darkMode: 'class'@custom-variant dark (&:where(.dark, .dark *));
content: [...]Automatic. Add paths with @source "…";
plugins: [require('@tailwindcss/typography')]@plugin "@tailwindcss/typography";
safelist@source inline("bg-red-{500,600}");
A custom utility in @layer utilities@utility name { … }

To replace a whole default scale instead of extending it, reset the namespace first. This removes every built-in colour and leaves only yours:

src/styles/global.cssCSS
@theme {  --color-*: initial;  --color-ink: oklch(0.15 0 0);  --color-brand: oklch(0.55 0.2 260);}

We checked this on Tailwind 4.3.5: with the reset, bg-red-500 is no longer generated.

Using an old tailwind.config.js anyway

Tailwind v4 ignores a tailwind.config.js that sits in the project unless you point to it. We tested it: a config that adds colors.brand.500 produced no bg-brand-500 class at all until we added the @config line.

src/styles/global.cssCSS
@import "tailwindcss";@config "../../tailwind.config.js";

The path is relative to the CSS file. With that line, the colour from the JavaScript file is back:

Terminal
npx @tailwindcss/cli -i src/styles/global.css | grep -A2 bg-brand-500  .bg-brand-500 {    background-color: #3b82f6;  }

Not every v3 option survives this route. The Tailwind docs list corePlugins, safelist and separator as unsupported in a v4 config file; use @source inline() for the safelist.

When keeping the JavaScript file makes sense

We'd keep @config in two situations:

  • You're migrating a large v3 project and want it building on v4 before you move the theme over piece by piece.
  • A plugin you depend on reads options from the config object and has no CSS-first version yet.

For everything else, move the values into @theme. It's one less file, the values are real CSS variables you can read with var(--color-brand) anywhere, and editors pick them up without a plugin. Our config to v4 converter turns a v3 theme object into the matching @theme block, and the official upgrade tool (npx @tailwindcss/upgrade) does the same for a whole project.

Questions

Where do I put the content paths in Tailwind v4?

Nowhere, usually. v4 scans your project on its own and skips files in .gitignore, which includes node_modules. If classes live in a package outside your project, add it with @source "../node_modules/your-ui-package";.

Is there still a tailwind.config.ts in shadcn/ui projects?

No. A project made with shadcn init on Tailwind v4 leaves "config": "" empty in components.json and puts its theme in the CSS file under @theme inline.

Does @config work with the Vite plugin and PostCSS?

Yes. @config is read by Tailwind itself, so it works the same with @tailwindcss/vite, @tailwindcss/postcss and the CLI.

Was this page helpful?

Still stuck? We answer every message ourselves. Write to us

This page is built from UI Pro parts: the docs article block (docs-quernly) with the code, terminal, install command, steps, contents and feedback components. They ship in the next UI Pro release; the install command and the contents rail are free.