8/19/2026 at 11:43:43 PM
In their example, they list btn-* as the selector catch all for .btn-primary|secondary|danger. I can't help but think why not just do, .btn.primary for the class name, and just target .btn with the selector?Don't get me wrong, I appreciate the convenience of this, but I do worry about selector slowdown with what will effectively turn into a regex at some point. I'm dubious that this is needed.
by jjcm
8/20/2026 at 12:11:59 AM
I have noticed it's pretty common for devs used to CSS-in-JS to imagine classes as being an exact 1:1 mapping to a specific DOM element, so maybe this is aiming to simplify things for that crowd? I guess similarly to BEM class names from a several years back.Personally I prefer `class="btn primary"` over `class="btn-primary"` just because it aligns conceptually with what "class" literally means, but I have run into folks that would think it's confusing that there's no top-level .primary rule.
For performance... ehhhh yeah. Nesting and :has() already let you easily slow stuff down if you're not careful. Adding just wildcards, even if they're as restrictive as the blog post talks about, is still going to hang another easy-to-reach footgun on the proverbial wall.
by graypegg
8/20/2026 at 12:27:16 AM
> Personally I prefer `class="btn primary"` over `class="btn-primary"` just because it aligns conceptually with what "class" literally means, but I have run into folks that would think it's confusing that there's no top-level .primary rule.Especially now that there is native nesting, these prefix selectors really seem like the wrong way to go.
by nhinck2
8/19/2026 at 11:57:57 PM
I don't think they will go that far. Just look at the attribute selectors, - they're just 5 of them:https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/S...
by Gualdrapo
8/20/2026 at 10:20:18 AM
Even better: <button class="primary>
button.primary { ... }
by theandrewbailey
8/20/2026 at 4:47:36 PM
Then you still need a btn class for styling anchor tagsby ChiperSoft
8/20/2026 at 6:46:09 PM
The proposed mixin support in CSS will offer a way to reference both button.primary and a.primary without having to duplicate the styles in both, but it’s still in draft status.by DHPersonal