Tous les articles
Astuces

Migrating from Tailwind CSS v3 to v4: What You Need to Know

par QalamUI TeamJanuary 20, 202612 min de lecture
Migrating from Tailwind CSS v3 to v4: What You Need to Know

Tailwind CSS v4 represents a significant shift in how you configure and use the framework. The biggest change is the move from JavaScript-based configuration to CSS-first configuration using @theme directives.

Custom colors are now defined using @theme {} blocks in your CSS. The oklch color space is recommended for perceptually uniform color scales.

Dark mode configuration has changed too. Instead of darkMode: "class" in the config, you now use @custom-variant in your CSS.

Plugins have been replaced by CSS-native solutions where possible. For example, the typography plugin is now a first-class feature.

The build process is simpler — just import tailwindcss in your CSS entry point and the Vite plugin handles the rest.

Share this article