Menu

1 / 5

Tailwind CSS 4 theme tokens in Next.js 16: oklch, @theme inline, and 4 traps that build without errors

DEV Community: nextjs·Nando Septian Husni·about 11 hours ago
#jpPQIzma
#devtonextjs#devto#dev#color#surface
Long article (1716 words) — no AI summary yet.
Reading 0:00
15s threshold

I moved a landing page's colors into Tailwind CSS 4 theme tokens: a brand scale in oklch, plus surface and ink tokens that flip in dark mode. Every build passed. Then I read the computed colors with Playwright and found four bugs that no build step reported.

I tested everything in a fresh create-next-app project on Next.js 16.5.0, React 19.3.1 and Tailwind CSS 4.3.5 ( create-next-app installed 4.3.3; I upgraded and re-ran every test). Each result below comes from next build , next start , and getComputedStyle in Chromium.

1. Where Tailwind lives in a new Next.js 16.5 project

There's no postcss.config.mjs anymore.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.