Skip to content

Commit 0a8f9f9

Browse files
authored
Reset to the @when from the resolved-on proposal (w3c#6632)
which was chosen to avoid clashing badly with the @if in SASS
1 parent b7049bc commit 0a8f9f9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

css-conditional-4/Overview.bs

+11-11
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ and supported font technologies.
4141
It also adds generalized conditional rules
4242
and chained conditional rules.
4343

44-
It also adds an ''@if'' rule,
44+
It also adds an ''@when'' rule,
4545
which generalizes the concept of a conditional rule.
4646
Anything you can express in an existing conditional rule
47-
can be expressed in ''@if'',
47+
can be expressed in ''@when'',
4848
it just has to be wrapped in an appropriate function
4949
to declare what kind of condition it is.
5050
This allow authors to easily combine multiple types of queries,
@@ -104,15 +104,15 @@ when the text and layout processing engine ingesting
104104
this CSS text is capable of utilising the specified font-technology
105105
in layout and rendering.
106106

107-
<h2 id="if-rule">Generalized Conditional Rules: the ''@if'' rule</h2>
107+
<h2 id="when-rule">Generalized Conditional Rules: the ''@when'' rule</h2>
108108

109-
The <dfn>@if</dfn> at-rule is a <a>conditional group rule</a>
109+
The <dfn>@when</dfn> at-rule is a <a>conditional group rule</a>
110110
that generalizes the individual <a>conditional group rules</a>
111111
such as ''@media'' and ''@supports''.
112112
It is defined as:
113113

114114
<pre class=prod>
115-
@if <<boolean-condition>> {
115+
@when <<boolean-condition>> {
116116
<<stylesheet>>
117117
}
118118
</pre>
@@ -160,7 +160,7 @@ It is defined as:
160160
}
161161
</pre>
162162

163-
''@else'' is interpreted identically to ''@if''.
163+
''@else'' is interpreted identically to ''@when''.
164164
If its <<boolean-condition>> is omitted,
165165
it's treated as having a condition that's always true.
166166

@@ -189,7 +189,7 @@ An ''@else'' rule that is not part of a <a>conditional rule chain</a> is invalid
189189
For example, here's a (somewhat silly) conditional chain:
190190

191191
<pre class="lang-css">
192-
@if media(width >= 400px) and media(pointer: fine) and supports(display: flex) {
192+
@when media(width >= 400px) and media(pointer: fine) and supports(display: flex) {
193193
/* A */
194194
} @else supports(caret-color: pink) and supports(background: double-rainbow()) {
195195
/* B */
@@ -252,7 +252,7 @@ An ''@else'' rule that is not part of a <a>conditional rule chain</a> is invalid
252252
so will always be chosen unless one of the earlier conditions succeeds.
253253

254254
<pre class="lang-css">
255-
@if font-technology(color-COLRv1) and font-technology(variations) {
255+
@when font-technology(color-COLRv1) and font-technology(variations) {
256256
@font-face { font-family: icons; src: url(icons-gradient-var.woff2); }
257257
}
258258
@else font-technology(color-SVG) {
@@ -272,7 +272,7 @@ An ''@else'' rule that is not part of a <a>conditional rule chain</a> is invalid
272272
and font variations are also supported.
273273

274274
Notice too that only one of the available options will be downloaded;
275-
this would not be the case without @if and @else,
275+
this would not be the case without ''@when'' and ''@else'',
276276
as the next example shows.
277277
</div>
278278

@@ -306,7 +306,7 @@ No Security issues have been raised against this document
306306

307307
<h2 class=no-num id="acknowledgments">Acknowledgments</h2>
308308

309-
The @if and @else rules are based on a proposal by Tab Atkins.
309+
The @when and @else rules are based on a proposal by Tab Atkins.
310310

311311
<h2 id='changes' class='no-num'>
312312
Changes</h2>
@@ -317,7 +317,7 @@ The @if and @else rules are based on a proposal by Tab Atkins.
317317

318318
<ul>
319319
<li>Added some examples</li>
320-
<li>Added @if and @else per CSSWG resolution</li>
320+
<li>Added @when and @else per CSSWG resolution</li>
321321
<li>Extended @supports feature to express font capabilities</li>
322322
<li>Added two co-editors per CSSWG resolution</li>
323323
<li>Added Privacy and Security sections</li>

0 commit comments

Comments
 (0)