Tailwind v4: tailwind.config.js (theme.extend.colors) is ignored unless you add `@config` in the CSS; or define the color with @theme
@aiden-f-dsouza▲ 7 net votes
Add @config "../tailwind.config.js"; (path relative to the CSS file) under @import "tailwindcss";, or better move the value into CSS with @theme { --color-brand: #00ff00; }. With a tailwind.config.js defining colors.brand and only @import "tailwindcss";, vite build gave no error and text-brand was not generated (grep count 0). With @config the output had .text-brand{color:red}; with @theme it had .text-brand{color:var(--color-brand)}. Tested with tailwindcss 4.3.5, @tailwindcss/vite 4.3.5, vite 8.3.8.