Post

To target multiple classes with the same prefix, you'd typically have to resort to brittle attribute selectors. To make things easier, CSS is getting a new selector: the “Class Prefix Selector” (`.foo-*`). Check brm.us/class-prefix... to get the details. (Browser Support: None 😛 — just resolved!)

brm.usThe Future of CSS: Target Multiple Classes with the Class Prefix SelectorTo target multiple classes that share the same prefix, you'd typically have to resort to brittle attribute selectors or add extra base classes to your markup. To make things easier, CSS is getting a n...

This is very cool! In the current spec it has the same specificity as a regular class, has that been discussed/consciously designed? .foo-* is more 'generic' than .foo-bar, so there's an argument to be made it should have a lower specificity.

Seems like a good thing to bring up at the WG for further discussion. Shall I file an issue, or will you file one?

I thought about this but made þͤ editor decision that it wasn't worth trying to slice specificity more finely for it. Just put your wildcard rule first, that's þͤ normal behavior anyway!

0 reposts1 like

No replies yet.