AI summary by TwinMind
Tailwind V4 is WAY better than I expected
Theo - t3․gg
30m 16s
Introduction and Sponsor
- Tailwind V4 beta released after 8 months of development
- Set up recording studio in dad's office for announcement
- Bright data sponsorship - web scraping API service
- $15 credit available via soy.dev/brightdata
- Handles rate limits, captchas, works with any stack
Major V4 Changes Overview
- Complete engine rewrite built for performance and modern web
- Build performance: up to 5x faster builds, 100x faster incremental builds
- Unified tool chain eliminates need for separate PostCSS/Autoprefixer installation
- CSS-first configuration - move config from JS to CSS files
- Built on native cascade layers, wide gamut colors
- First-class support for container queries, @starting-style, popovers
Live Demo - Upgrading Quick Pic Project
- Used
npx tailwind@upgradecommand to automatically upgrade project - Changes made:
outline-none→outline-hiddenflex-1→grow- Added global CSS compatibility layer for border color defaults
- Removed tailwind.config.js file entirely
- Upgrade process worked seamlessly with automatic code modifications
Performance Analysis
- Rust-based toolchain using Lightning CSS
- Lightning CSS: 2.7 million lines/second on single thread
- CSS Nano: 500ms → Lightning: 4ms for Bootstrap 4 minification
- Incremental builds complete in microseconds (355ms → 192 microseconds)
- Most builds don't introduce new class names, just reuse existing ones
- Performance comparison showed similar results between V3/V4 in Next.js (likely due to existing optimizations)
CSS-First Configuration
- Dark mode configuration now declarative in CSS
- Plugin system uses
@plugindirective in CSS files - Theme variables defined using
@themein CSS - Prefix configuration moved to CSS
- More intuitive than previous JavaScript-based config
New Features and Capabilities
Arbitrary Values
- Can now use arbitrary numeric values without brackets
- Examples:
h-54,h-12.5(0.5 increments supported) - Increases unique class names in codebase
- Some validation -
h-12.4rejected,h-12.5accepted
Color System
- Move to OKLCH color space for wider spectrum/HDR support
- Simplified variable colors using
@theme - Better autocomplete and VS Code extension support
Layout and Spacing
@minand@maxutilities for cleaner responsive design- Replace
hidden md:showwithmax-md:hidden - 3D transforms support (
rotate-x,rotate-y,rotate-z) - Arbitrary spacing scales and explicit scale definitions
Visual Enhancements
- Linear gradients with angle support
- Radial gradients (conic gradients less useful)
- Inset shadows support
- Field sizing content for auto-resizing form fields
Advanced Selectors
- Composable variants and group selectors
@starting-stylefor entrance animationsnth-child,nth-last-childselectors- Descendant variants using
*syntax - Pop-over states and interactive element styling
Technical Implementation
- Git ignore used as heuristic for content parsing
- Built-in import handling eliminates PostCSS import need
- Turbo pack already uses Lightning CSS
- Legacy config import still supported
- Custom utilities syntax improved significantly
Development Experience
- Auto-upgrade command handles migration automatically
- Compatibility layers maintain visual consistency
- Single global CSS file lists all breaking changes for easy migration checklist
- Better documentation and examples
Performance Considerations
- Client-side performance unchanged (Tailwind merge, class variance authority not addressed)
- Focus on build-time performance improvements
- Maintains Tailwind's core performance advantages over other CSS solutions
- Small CSS bundle size with fixed cap growth
