← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

CSS Working Group Resolves to Add Class Prefix Selector to CSS Selectors Level 5

🔄 Updated 1h ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • New Class Prefix Selector (`.prefix-*`) approved for CSS Selectors Level 5.
  • Simplifies targeting multiple CSS classes with a shared prefix.
  • Reduces HTML bloat and avoids fragile attribute selectors.
  • Currently only in specification, not yet implemented in browsers.

New CSS Selector Approved

The CSS Working Group recently resolved to include a Class Prefix Selector in the CSS Selectors Level 5 specification. This new selector, denoted by `.prefix-*`, will allow developers to apply styles to all classes that begin with a specified prefix.

Addressing Current Limitations

Currently, targeting multiple classes with a shared prefix requires either listing each class individually, adding a separate base class to the markup, or using substring-matching attribute selectors. These methods can lead to verbose code, increased HTML payload, or brittle and error-prone styling.

For example, to style `.btn-primary`, `.btn-secondary`, and `.btn-danger`, developers typically add a `.btn` base class or explicitly list all three selectors.

The Class Prefix Selector Solution

The new Class Prefix Selector offers a more concise solution. With the syntax `.btn-*`, developers can apply styles to all classes starting with `btn-` without needing to modify HTML or write complex selectors. This simplifies the management of utility classes and design systems.

The proposal for this feature was initially made by Lea Verou in 2024 and was resolved at the CSS Working Group F2F meeting in Berlin in August 2026.

Future Implementation and Details

This feature is currently only in the specification text and is not yet available in browsers. The specification may undergo further changes before browser implementation. Discussions are ongoing regarding specific behaviors, such as whether `.foo-*` should match an element with only the `.foo-` class.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~28 min · 23 stories · Aug 19

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Primary sources

GitHub w3c/csswg-drafts

Reporting from

The CSS Working Group resolved to add a new Class Prefix Selector (`.prefix-*`) to the CSS Selectors Level 5 specification, allowing developers to target multiple classes sharing a common prefix more efficiently. This feature simplifies styling for utility classes and design systems by reducing the need for multiple class listings or brittle attribute selectors.