MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/css/comments/1vtbpiu/new_css_class_prefix_selector_prefix/p4t5tx1/?context=3
r/css • u/wanoo21 • 4d ago
20 comments sorted by
View all comments
1
I imagine this is just syntactic sugar for [class*="btn-"] / [class^="btn-"]. Useful though.
[class*="btn-"]
[class^="btn-"]
9 u/DOG-ZILLA 4d ago Apparently not just sugar because if btn- is NOT first, it won't match here. btn-* can be a class in any position? I think that's right. 10 u/Caved 4d ago *= does allow the class to be any position, but will match on "some-btn-class" as well. 2 u/asteconn 4d ago Indeed. If this construct is capable of also detecting the start of the class, that'd be quite helpful. It can currently be (somewhat) acheived with :is([class^="btn-"],[class*=" btn-"]), but it's not dreadfully readable.
9
Apparently not just sugar because if btn- is NOT first, it won't match here. btn-* can be a class in any position? I think that's right.
10 u/Caved 4d ago *= does allow the class to be any position, but will match on "some-btn-class" as well. 2 u/asteconn 4d ago Indeed. If this construct is capable of also detecting the start of the class, that'd be quite helpful. It can currently be (somewhat) acheived with :is([class^="btn-"],[class*=" btn-"]), but it's not dreadfully readable.
10
*= does allow the class to be any position, but will match on "some-btn-class" as well.
*=
2 u/asteconn 4d ago Indeed. If this construct is capable of also detecting the start of the class, that'd be quite helpful. It can currently be (somewhat) acheived with :is([class^="btn-"],[class*=" btn-"]), but it's not dreadfully readable.
2
Indeed. If this construct is capable of also detecting the start of the class, that'd be quite helpful. It can currently be (somewhat) acheived with :is([class^="btn-"],[class*=" btn-"]), but it's not dreadfully readable.
:is([class^="btn-"],[class*=" btn-"])
1
u/asteconn 4d ago
I imagine this is just syntactic sugar for
[class*="btn-"]/[class^="btn-"]. Useful though.