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

I'm not a SASS user but say that `@if` should prevail, would setting out an upgrade path for SASS Users work, in order to open up the road for `@if` in CSS?

Something like start showing warnings in current versions of SASS when it encounters an `@if` somewhere. The warning should indicate that from `$nextMajorVersion` of SASS on, the `@if`s must be replaced with `@sass-if` _(name to be bikeshed)_, as from then on`@if` will be the `@if` as described in the CSS spec. The `$currentMajorVersion` of SASS would also support `@sass-if` _(which at that time would simply be an alias for SASS-`@if`)_, so that authors can already transition to the new syntax.

That way, if SASS users want to start using CSS-`@if`, they must upgrade SASS to `$nextMajorVersion`, knowing that it includes breaking changes. If they don’t want to upgrade _(or aren’t aware of CSS-`@if`)_ they can keep using `$currentMajorVersion` with unaltered behavior. The README for `$nextMajorVersion` of SASS _(and articles on CSS-`@if`)_ would list the changed interpretation of `@if` as a breaking change.

Perhaps even `$nextMajorVersion` could include a post-install script to auto-rename all `@if`s to `@sass-if` when it upgrades from `$currentMajorVersion`? This could also be offloaded to an upgrade helper.

I think this could solve the problem, but it could be that details in the SASS-ecosystem — which I don't have a view on right now — could make this a flawed proposal.

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


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

Received on Thursday, 10 March 2022 10:19:15 UTC