
The Future of CSS: Target Multiple Classes with the Class Prefix Selector
The proposed Class Prefix Selector would let .btn-* match a family such as .btn-primary and .btn-danger without adding a base class or using a substring attribute selector. A css-selector-benchmark comparison exceeded 6,000 runs per second for a normal class selector but fell as low as 328 for the attribute workaround, nearly a 20-fold gap. The CSS Working Group resolved to add the feature to Selectors Level 5 in August, two years after the original proposal. Open questions remain around empty-prefix matches, invalid class characters, and shared wildcard syntax. It is promising specification work, not a browser feature teams can deploy today.

