:state()
Newly available since 2024-05-17
The :state()
CSS pseudo-class matches custom elements based on their custom state, set through the ElementInternals.states
API.
Compatibility
- Chrome 125 Released on 2024-05-14
- Chrome Android 125 Released on 2024-05-14
- Edge 125 Released on 2024-05-17
- Firefox 126 Released on 2024-05-14
- Firefox for Android 126 Released on 2024-05-14
- Safari 17.4 Released on 2024-03-05
- Safari on iOS 17.4 Released on 2024-03-05
MDN docs
Specifications
- HTML Standard, from HTML Workstream (WHATWG).
BCD data
- api.CustomStateSet
- api.CustomStateSet.@@iterator
- api.CustomStateSet.add
- api.CustomStateSet.clear
- api.CustomStateSet.delete
- api.CustomStateSet.entries
- api.CustomStateSet.forEach
- api.CustomStateSet.has
- api.CustomStateSet.keys
- api.CustomStateSet.size
- api.CustomStateSet.values
- api.ElementInternals.states
- css.selectors.state