Re: [csswg-drafts] [css-conditional-4] Rename @when to @if (#6684)

_I am almost sure this must have been considered at some point and probably is not an option but after reading through (almost) all of this thread I did not see it mentioned directly._

Is it possible that sass `@if` can still be a superset of css `@if`?

As far as I can tell it's possible to detect sass `@if` in the syntax of the boolean condition. (not expert and likely wrong about this)

The discussion so quickly focussed on "is it ok to break sass" that I am not sure if it was researched if there is an actual conflict. If it was, please ignore all this.

Currently css `@if` conditionals with `media(...)` or `supports()` give parser errors.

I am definitely oversimplifying this bit, but if it gives parser errors it might be safe to just add support for css `@if` on top of sass `@if`?

Looking at the AST of the sass conditionals above it appears that there are no conflicts in the boolean conditions themselves with css `@if`.

- `media` does not appear as a function token (does not exist at all in the list)
- `supports` does not appear as a function token (does not exist at all in the list)
- `not` only appears a function token, not as an ident.
- `and` appears as an ident token but maybe this is ok? 

In other words, is there maybe a way to have both that was overlooked?

I know this will place significant burden on sass and the sass community to get it working.

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


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

Received on Wednesday, 23 March 2022 18:43:13 UTC