conv.

All stories
TechQuiet 87d · day 87

CSS gets Class Prefix Selector for easier multi-class targeting

The CSS Working Group resolves to add .prefix-* syntax, letting developers style groups of related classes without brittle attribute selectors.

What to know

  • The CSS Working Group approved a new .prefix-* selector syntax in August 2026 to target multiple classes sharing a hyphen-separated prefix in a single rule.
  • The feature addresses a common problem in utility-based design systems where developers previously had to either list classes individually or use brittle attribute selectors.
  • The selector is currently spec-only with no browser implementation; the specification will likely see changes before browsers adopt it.
  • The syntax only matches classes with at least one character beyond the prefix, excluding edge cases like .foo- or .foo--.

“It's a huge win for utility classes and design systems, allowing you to easily target groups of related elements without having to bloat your HTML payload or write fragile attribute selectors.”

Bramus, Technical writer · bram.us blog post · Aug 19

Lea Verou CSS proposal originatorBramus Front-end developer and technical writerCSS Working Group Standards body

CSS gets Class Prefix Selector for easier multi-class targeting
bram.us

The record 2 articles and posts · last 30 days

  1. The Future of CSS: Target Multiple Classes with the Class Prefix Selector press · HN Frontpage · cdrnsf · 87d ago
  2. To target multiple classes with the same prefix, you'd typically have to resort to brittle attribute selectors. To make… post · Mastodon · bramus@front-end.social · 87d ago