Modern CSS articles

Articles on modern CSS features: nesting, cascade layers, :has(), :is()/:where(), and anchor positioning. Each article is a deep dive with code examples, browser-support notes, and practical tips.

Experimental

Anchor positioning

Tooltips and popovers that stay tethered without JavaScript. CSS Anchor Positioning.

New

CSS nesting syntax

Native CSS nesting in 2026: syntax, specificity, and migrating from Sass. No preprocessor required.

no-js

CSS specificity explained

Understand CSS specificity: how the cascade scores selectors, how :is() and :where() change the game, and how @layer tames !important.

Form validation with :has()

Style form groups, labels, and messages based on input validity using :has(:invalid) and :has(:placeholder-shown) — no JavaScript.

hasforms

:has() for sibling conditions

Use :has() with sibling combinators to style elements based on what comes after them — a pattern impossible before :has().

has

:is() and :where() selectors

Learn the :is() and :where() pseudo-class selectors: specificity differences, forgiving selector lists, practical patterns, and use with CSS nesting.

Quantity queries with :has()

Count children with :has(:nth-child()) and adapt layouts — show grid when 4+ items, hide labels when empty, and more.

has
New

State-aware CSS

How if(), @scope, and scroll-state queries reduce JavaScript.

no-js