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.
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 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.
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 →
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.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
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.