Skip to main content

Posts

Showing posts with the label Tailwind CSS

Migrating to Tailwind CSS v4: Fixing 'Unknown Config' Errors in Legacy Themes

  The release of Tailwind CSS v4, powered by the Rust-based Oxide engine, represents a fundamental architectural shift. While the performance gains are massive—builds are up to 10x faster—the removal of the JavaScript-based configuration dependency introduces breaking changes for teams relying on complex   tailwind.config.js   customizations. The most common failure mode during migration is the "Unknown Config" or silent failure of custom theme extensions. If your build log is clean but your custom  bg-brand-midnight  or  text-fluid-h1  utilities have vanished from the browser, it is because v4 has inverted the source of truth from JavaScript to CSS. Root Cause Analysis: The Shift to CSS-First Configuration In v3, the JIT engine spun up a Node.js process, read  tailwind.config.js , resolved all JavaScript logic (including  require  calls and function-based theme values), and generated a configuration object before parsing your templates....

Tailwind CSS v4 Architecture: Managing Complex Variants with CVA and Slots

  The "Utility Soup" Problem Tailwind CSS offers incredible velocity, but as applications scale, the "utility-first" approach often devolves into "utility-only" chaos. Senior engineers eventually hit a wall where a simple component—say, a  Card  or  Alert —looks like this in the codebase: // The specificty nightmare <div className={`rounded-lg border p-4 ${isError ? 'bg-red-50 border-red-200' : 'bg-white border-gray-200'} ${className}`}> <div className="flex items-start"> <div className={`flex-shrink-0 ${isError ? 'text-red-400' : 'text-gray-400'}`}> {/* Icon */} </div> <div className="ml-3"> <h3 className={`text-sm font-medium ${isError ? 'text-red-800' : 'text-gray-900'}`}> {title} </h3> {/* ... content ... */} </div> </div> </div> This is unmaintainable. The root cause is a ...