Re: [csswg-drafts] [selectors] Should `.foo-*` match `foo-`? (#14291)

Sorry for that, you’re completely right and I messed up my browser tabs here probably. If anyone can, feel free to move my generic comments to the correct issue. What remains for this issue is:

> I think .foo-* should match foo--, otherwise it's really weird. We'd have to explain that * matches any sequence, as long as it's not empty, and now as long as it's not all hyphens, but some hyphens are ok?

I agree with that. `*`should match any allowed character for a selector in CSS and the `-` before it is just the initializer for the function. 

Is a matching of empty really an issue? In theory, people would write `.foo` as the root class and use `.foo-anything` for subclasses. Matching empty (`.foo-*` matches the class `.foo-`) would at least mean the `*` works as it works in normal Regular Expressions.

-- 
GitHub Notification of comment by anselmh
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/14291#issuecomment-5372278725 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 16:04:08 UTC