- From: wesruv via GitHub <noreply@w3.org>
- Date: Fri, 21 Aug 2026 19:26:32 +0000
- To: public-css-archive@w3.org
Strongly dislike `.foo-*`, it feels more like a specific solution for Tailwind and Bootstrap than an appropriate solution for the spec. The criticisms on with https://github.com/w3c/csswg-drafts/issues/10001#issuecomment-5361621671 ring very true for me.
I'd summarize that as:
* It has unintuitive side effects (e.g. should `.region-*` select `.region-sidebar` and `.region-name`)
* Enforces specific semantics that don't work well for common naming conventions
* Is overly specific in that it focuses on classes and one of the many popular naming conventions
Much prefer something like the second option Lea proposes up top:
> Introducing a new attribute selector, that is basically a combination of `~=` and `^=`. Options for the operator could be `~^=`, `^~=`, or even `^~` if we want to keep it to a max of 2 characters. This is quicker to implement, but very specific to attribute selectors, **and far less intuitive.**
I don't think it's any less intuitive than "class prefix" only working with dashes or only working with the class attribute; or any more/less intuitive than the other attribute selector operators. It's:
* more flexible
* doesn't assume naming/semantics of classes
* easier to implement (per Lea, I wouldn't know)
That feels much more spec worthy than class prefix, which has baggage that feels more appropriate for an _optional_ Sass extension.
Fixing the core concern here seems like "nice to have", which implies a higher level of scrutiny.
The core concern (to my understanding) can be addressed by:
* Having `<div class="foo foo-bar"></div>` is _fine_ for the vast majority of sites
* This could be solved on the CSS side by having a declaration block that styles all variations e.g.:
```css
.foo,
.foo-bar,
.foo-baz {}
```
(which you can use CSS pre/post-processors to get to a lot easier in large projects)
* There are plenty of frameworks that minify/combine CSS selectors and update the markup and styles
--
GitHub Notification of comment by wesruv
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10001#issuecomment-5374305477 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 21 August 2026 19:26:33 UTC