Frontend
October 14, 2026
1 views
2 min read

Resolved: CSS Class Prefix Selector

Curated by Patrick
Source: CSS-Tricks
Resolved: CSS Class Prefix Selector
Tech Daily Byte Analysis

Bramus, a front‑end advocate known for surfacing Chrome‑centric features, announced that the class‑prefix selector has moved from proposal to “resolved” status in the Selectors Level 5 working draft. The syntax—`.prefix-*`—lets developers match any class that begins with a given string, replacing the verbose attribute selectors `[class^="prefix-"]` and `[class*=" prefix-"]`. The idea was first raised by Lea in 2024 and has been championed through the CSS Working Group, with the latest update indicating that Chrome is likely to ship support within weeks. Bramus notes that the selector inherits normal class specificity (0,1,0) and can be feature‑detected via `@supports selector(.prefix-*)`.

The addition arrives amid a broader push to make CSS more expressive while trimming boilerplate. Recent changes like the modernized HSL color syntax demonstrate a pattern of simplifying common patterns without breaking existing code. By offering a concise way to target component‑style class families, the new selector could reduce stylesheet size and improve readability, especially for utility‑first frameworks that generate many variant classes (e.g., Tailwind’s `bg‑red‑500`). However, it also raises questions about redundancy, since substring attribute selectors already exist, and about the timeline for cross‑browser support, which may affect progressive‑enhancement strategies.

Developers should watch for Chrome’s implementation schedule and test the selector behind a `@supports` block to avoid regressions on browsers that lag behind. Performance claims—namely that attribute‑based substring matching hurts rendering speed—remain unverified, so benchmarking will be essential before adopting the selector at scale. Additionally, the current spec limits the wildcard to simple dash‑separated prefixes, leaving more complex patterns unsupported, which could influence how component libraries design their class naming conventions.

Key Takeaways

The class‑prefix selector (`.prefix-*`) is now a resolved feature in the Selectors Level 5 draft, moving it closer to browser implementation.

It offers a cleaner alternative to attribute substring selectors, inheriting normal class specificity and supporting `@supports` detection.

Adoption may be delayed by uneven browser rollout, so developers should guard usage with feature queries.

Real‑world performance benefits are still speculative; teams should benchmark before relying on the selector for critical UI paths.

About the Source

This analysis is based on reporting by CSS-Tricks. Here is a short excerpt for context:

A newly resolved proposal would allow us to select classes that are a prefix for variations with a wildcard, like .prefix-*. Resolved: CSS Class Prefix Selector originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.
Read the original at CSS-Tricks

More in Frontend