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

> > For users, using the CSS syntax in a current version of Sass will result in a compile error (**independently** of whether it's called `@if` or `@when`).
> 
> [Bold is mine.]
> 
> This [point](https://github.com/w3c/csswg-drafts/issues/6684#issuecomment-1064630704) by @SebastianZ is quite right.

Except that it is not. 😅  See https://jsfiddle.net/SebastianZ/76ars08x/. The proposed syntax causes a syntax error when using `@if` while being ignored and output as is when using `@when`. That confirms what @simonbuerger pointed out earlier.

The rest of my statement still holds true, though. So, I believe, there would be a clear and fairly easy way for Sass to adapt. Sass developers need to handle the CSS syntax of `@if` the way unrecognized at-rules are handled while the Sass syntax stays unchanged. And Sass users won't need to do anything because the existing Sass syntax would still be supported. Only if they want to use the new CSS syntax, they need to update their version of Sass.

@nex3 Would that be a path forward for Sass? Is there anything obvious I am missing?

For what it's worth, while I have a preference for `@if`, I wouldn't mind if it were called `@when`. But I can just speak for  myself. Others obviously have stronger opinions on this.

Sebastian

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


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

Received on Thursday, 17 March 2022 00:08:47 UTC