Re: [csswg-drafts] [css-pseudo-5] ::text / ::text-node pseudoelement (#2208)

I think this selector will enable pretty cool features in combination with `:has`.
For example:
```css
.button {
  display: flex;
  height: 40px;
  padding: 8px 16px;
  column-gap: 8px;
  align-items: center;
}

.button:has(svg):not(:has(::text)) {
  width: 40px;
  padding: 0;
  justify-content: center;
}
```
This will make one class for regular buttons with icon and text and for square buttons if it contains only icon.
For now we have to make additional class for square buttons and I wish we could have more smart, "component-like" classes.

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


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

Received on Sunday, 14 May 2023 05:54:19 UTC