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

@LeaVerou I took a read through the CSS almanac, thanks for the link (and the research, which is thorough and valuable and interesting!). So apologies in advance for picking out this particular paragraph, but it seems relevant.

> There are also [recent](https://github.com/w3c/csswg-drafts/issues/5009) [discussions](https://github.com/w3c/csswg-drafts/issues/5624) in the CSS WG about introducing a limited form of conditionals, and Sass gives us some data on how commonly this is needed. Almost two thirds of SCSS sheets contain at least one @if block, making up almost two thirds of all control flow statements. There is also an if() function for conditionals within values, which is the second most common function used overall (14%).

That the use of Sass `@if` is an indication of the need for a generic `@if` (the very one we're discussing now) - when in fact they accomplish wildly different things. CSS `@if` will be entirely related to the current execution context, whereas Sass `@if` is evaluated at compile time? You can't replace Sass `@if` calls in any scenario with CSS `@if` (or vice versa). Sass users will need Sass `@if` just as much after this lands as they did before

-- 
GitHub Notification of comment by simonbuerger
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6684#issuecomment-1070532370 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 08:29:44 UTC