CSS Custom Highlight Universal Selector ::highlight(*)
- Category
- CSS
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Introduces a universal selector for custom highlights, ::highlight(*), which matches the highlight pseudo-elements of all custom highlights regardless of their name. The * argument contributes zero specificity, so its declarations act as a base style that rules naming a specific highlight override through the cascade.
Motivation
Styling shared properties across custom highlights requires repeating the same declarations for every registered name. The CSSWG resolved to allow ::highlight(*).
Standards & signals
- Specification: https://drafts.csswg.org/css-pseudo-4/#selectordef-highlight-highlight-name-selector
- Firefox: Positive
- Safari: Support
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/408003366
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=css-custom-highlight-universal-selector-highlight
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CSS%20Custom%20Highlight%20Universal%20Selector%20%3A%3Ahighlight(*)
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CSS%20Custom%20Highlight%20Universal%20Selector%20%3A%3Ahighlight(*)
- Baseline status: https://webstatus.dev/?q=CSS%20Custom%20Highlight%20Universal%20Selector%20%3A%3Ahighlight(*)