Re: [csswg-drafts] [css-values] add "attr" test to if() (#12519)

> Allowing `attr()` and comparisons in `if()`

We already resolved to add this.

You can try a prototype in Chrome Canary if you use the runtime flag `--enable-blink-features=CSSContainerStyleQueriesRange`:

```
<!DOCTYPE html>
<style>
  div {
    color: if(
      style(attr(data-foo type(<number>)) < 4): green;
      else: red;
    );
  }
</style>
<div data-foo=3>
 Green
</div>
```

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


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

Received on Thursday, 31 July 2025 12:10:29 UTC