Re: [csswg-drafts] [css-pseudo-4] Add a pseudo-element to style all highlight pseudo-elements (#9091)

> Having `::highlight()` match all custom highlights would make sense, though.

I just naively and without knowing this wouldn't work tried the above syntax. Then, less confidently, I tried `::highlight(*)`, then I came here. 

My use case is to avoid duplication:

```css
/* Want: */

::highlight() {
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(spelling) {  
  text-decoration-color: yellow;
}

…

::highlight(punctuation) {
  text-decoration-color: red;
}
```

Instead, I have to repeat myself:

```css
/* Reality: */

::highlight(spelling) {  
  text-decoration-color: yellow;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

…

::highlight(punctuation) {
  text-decoration-color: red;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}
```


-- 
GitHub Notification of comment by tomayac
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9091#issuecomment-2703505587 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 6 March 2025 10:56:36 UTC