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

@jonathantneal 

This is a good way to articulate it. `@matches` or `@when` as it's being proposed is like "when this is true for the sheet / environment". In other words, a single state across everything at a point in time. However, the `@if` in Sass (and other imperative languages) is like "when this is true at this point in the evaluation". 

A counter-point is that XSLT has `xsl:if` although it's reserved for a single statement. For an "else-like" construct, it needs `xsl:choose` like:
```xml
<xsl:choose>
   <xsl:when test="number($gender) mod 2 = 0">Male<xsl:when>
   <xsl:otherwise>Female<xsl:otherwise>
<xsl:choose>
```
Interestingly, `@when` / `@otherwise` or `@media` / `@otherwise` may actually be a more sound / logical pairing than `@when` / `@else`.


@meyerweb `@given` also sounds good for condition testing!

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


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

Received on Monday, 28 March 2022 22:33:42 UTC