Best of CSS-TricksMarch 2026

  1. 1
    Article
    Avatar of css_tricksCSS-Tricks·5w

    4 Reasons That Make Tailwind Great for Building Layouts

    Tailwind CSS excels at building layouts for four key reasons: layout styles are tightly coupled to HTML structure making them easier to visualize inline, utility classes eliminate the need to name layouts, context-specific layout variations can be applied directly without modifier classes, and responsive variants can be created on the fly. The post also introduces a CSS variable-based approach (grid-simple with --cols and --span) that makes grid layouts even more readable than standard Tailwind utilities, and promotes combining Tailwind with vanilla CSS synergistically rather than relying solely on utility classes.

  2. 2
    Article
    Avatar of css_tricksCSS-Tricks·7w

    The Different Ways to Select <html> in CSS

    A fun exploration of the various ways to select the HTML root element in CSS beyond the obvious `html` selector. Covers `:root`, `:scope`, the `&` nesting selector, `:has(head)` / `:has(body)`, and the quirky `:not(* *)` pattern. Each approach is explained with its specificity implications, practical use cases, and notable edge cases — including when `:scope` differs from `:root` inside `@scope` blocks and how `&` behaves outside of nested contexts.

  3. 3
    Article
    Avatar of css_tricksCSS-Tricks·5w

    JavaScript for Everyone: Destructuring

    A comprehensive lesson on JavaScript destructuring assignment, excerpted from the 'JavaScript for Everyone' course. Covers binding pattern destructuring for arrays and objects, assignment pattern destructuring, renaming variables during destructuring, default values, nested destructuring of mixed data structures, and rest properties using the spread syntax. Includes practical examples showing how to unpack complex nested objects from external APIs into clean, usable variables in a single line of code.