-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
selectors-4Current WorkCurrent Work
Description
The current attribute substring allows matching start and end of value
[attr^="value"]
// Will match
1 <div attr="value">
2 <div attr="value list">
3 <div attr="values">
4 <div attr="value-list">
To add precision the substring start/end (^$) could be combined with the whitespace-separated flag (~) to ensure an exact match of the substring - simplifying the current :is([attr="value"],[attr^="value "]) solution
[attr^~="value"]
// Would only match
1 <div attr="value">
2 <div attr="value list">
Syntax suggestion
[attr^~="value"] { ... }
[attr$~="value"] { ... }
Spec:
https://www.w3.org/TR/selectors-4/#attribute-representation
https://www.w3.org/TR/selectors-4/#attribute-substrings
Metadata
Metadata
Assignees
Labels
selectors-4Current WorkCurrent Work