877: Tailwind 4

877: Tailwind 4

Update: 2025-02-172
Share

Digest

This podcast episode details the significant updates in Tailwind CSS v4, focusing on performance enhancements and new features. The smaller engine and integration with Lightning CSS (built in Rust) result in faster build times. First-class support for CSS variables simplifies their usage and eliminates the need for a JavaScript layer. Improved container query support, utilizing the `@container` syntax, enhances responsive design capabilities. The adoption of the P3 color space allows for more vibrant colors, although browser support is a factor. The episode also covers improvements to dynamic utilities and variants, with a simplified syntax, and introduces starting style support for smoother animations. Finally, the discussion touches upon descendant selectors and the continued relevance of inline styles for complex scenarios.

Outlines

00:00:04
Tailwind CSS v4: Core Improvements & Performance Enhancements

This chapter introduces Tailwind CSS v4, highlighting its smaller engine, faster build times (thanks to Lightning CSS and Tailwind Oxide), and the incorporation of modern CSS features like CSS variables and improved container query support.

00:02:51
Advanced Features & Workflow Enhancements in Tailwind v4

This section covers favorite additions in Tailwind v4, including first-class CSS variable support, simplified container query syntax using `@container`, improvements to dynamic utilities and variants (with simplified syntax), and the introduction of starting style support for smoother animations and transitions.

00:10:47
Color, Performance, and Future Considerations in Tailwind v4

This chapter discusses the use of the P3 color space for richer colors, the role of Tailwind Oxide and Lightning CSS in optimizing performance, and the continued use of inline styles for complex CSS scenarios alongside the framework's utilities. The trade-offs between using Tailwind exclusively and incorporating traditional CSS are also debated.

Keywords

Tailwind CSS v4


The latest version of the popular CSS framework, featuring performance improvements, modern CSS features (like container queries and CSS variables), and a simplified configuration.

Lightning CSS


A fast CSS parser, transformer, bundler, and minifier built in Rust, used by Tailwind CSS v4 to significantly improve build times.

CSS Variables (Custom Properties)


Variables defined using `--variable-name` syntax, allowing for reusable styles and easier theme management. Tailwind v4 offers first-class support.

Container Queries


A CSS feature enabling styles to adapt based on the size of their containing element, improving responsiveness. Tailwind v4 offers improved support.

Tailwind Oxide


The underlying engine powering Tailwind CSS v4, leveraging Lightning CSS for enhanced performance and a streamlined workflow.

P3 Color Space


A wider color gamut offering more vibrant and realistic colors compared to sRGB. Tailwind v4 uses P3 by default.

`@container`


CSS syntax for defining container queries in Tailwind v4.

Starting Styles


Tailwind v4 feature enabling styling of elements before they enter the DOM, improving animations and transitions.

Q&A

  • What are the most significant performance improvements in Tailwind CSS v4?

    Tailwind v4 boasts a smaller engine, faster build times due to the integration of Lightning CSS via Tailwind Oxide, and improved handling of large projects.

  • How does Tailwind CSS v4 handle CSS variables?

    Tailwind v4 offers first-class support for CSS variables, allowing direct definition within the CSS config file, eliminating the need for a separate JavaScript layer.

  • What are container queries and how are they improved in Tailwind v4?

    Container queries allow styles to respond to the dimensions of their parent container. Tailwind v4 simplifies their implementation with improved syntax and direct support.

  • What is the benefit of using the P3 color space in Tailwind v4?

    The P3 color space offers a wider range of colors, resulting in more vivid and brighter visuals. Browser and device support is crucial.

Show Notes

Tailwind 4.0 is here, and Scott and Wes break down all the spicy new features, from CSS-powered configs to first-class container queries. Plus, they dig into Tailwind Oxide, @property magic, and whether it’s finally time to stop asking, “Why not just use normal CSS?”

Show Notes Hit us up on Socials!

Syntax: X Instagram Tiktok LinkedIn Threads

Wes: X Instagram Tiktok LinkedIn Threads

Scott: X Instagram Tiktok LinkedIn Threads

Randy: X Instagram YouTube Threads

Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

877: Tailwind 4

877: Tailwind 4

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers