LodeHQ
AI news for people who shipFree, by email

Dev · css-tricks.com · Tuesday, 25 August 2026

CSS gains a class prefix selector: one `.btn-*` rule replaces six lines

CSS Selectors Level 5 just adopted a wildcard that matches every class with a given prefix — `.btn-*` hits `.btn-primary`, `.btn-secondary`, and friends in a single rule. Today you'd hand-list each variant or lean on slow substring selectors like `[class^="btn-"]`. The ergonomics are great, but you'll need `@supports selector(.btn-*)` until the feature becomes Baseline.

Read the source: css-tricks.com ↗In the 25 August issue →