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

@daKmoR I think the fact that @nex3 saying the change would be catastrophic tells you enough about how easy this would be to implement. Scss module land is not nearly as clean afaik and not sure the compiler knows or cares about npm package syntax and package.json files - it only gets passed load paths (which might include some node_modules, but it certainly isn't fully integrated into the npm ecosystem). So that would leave library authors having to specify the expected behaviour on a per file basis. Not sure how that would look. 

Also if any library actually wrote `@scss-if` in their library and that was then imported and compiled on an old version of Scss it would actually output the `@scss-if` as-is as if it were CSS syntax in the compiled output if I'm not mistaken. That's how Scss treats @ rules it doesn't understand Though of course the library in question also just wouldn't work either. Breaking backwards compatibility I guess is the biggest issue and will cause the most stress.

In reality Scss would be forced to probably keep the current `@if` behaviour and make CSS `@if` another syntax like `@css-if` - but that would be horribly unexpected and confusing for end users who will simply copy the some new `@if` code from stackoverflow, paste it into their stylesheets (which could be very old) and it'll simply not work. Old versions of Scss would break entirely and new versions might be able to provide a better error telling them to switch to `@css-if`. 

However `@when` would work in all existing Scss codebases right out of the box without any code changes because of how Sass treats unrecognised `@-rule` syntax (try it).


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


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

Received on Wednesday, 16 March 2022 11:45:11 UTC