Skip to content

Commit 3e9874b

Browse files
committed
Write the illegal example I wanted for @supports.
1 parent a0bfd4f commit 3e9874b

2 files changed

Lines changed: 57 additions & 11 deletions

File tree

css3-conditional/Overview.html

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -639,11 +639,39 @@ <h2 id=at-supports><span class=secno>5. </span>Feature queries: the
639639
}</pre>
640640
</div>
641641

642-
<p>To avoid confusion between and and or, the syntax requires that both and
643-
and or be specified explicitly (rather than, say, using commas or spaces
644-
for one of them). Likewise, to avoid confusion caused by precedence rules,
645-
the syntax does not allow and, or, and not operators to be mixed without a
646-
layer of parentheses. <span class=issue>Add examples.</span>
642+
<p>To avoid confusion between &lsquo;<code class=css>and</code>&rsquo; and
643+
&lsquo;<code class=css>or</code>&rsquo;, the syntax requires that both
644+
&lsquo;<code class=css>and</code>&rsquo; and &lsquo;<code
645+
class=css>or</code>&rsquo; be specified explicitly (rather than, say,
646+
using commas or spaces for one of them). Likewise, to avoid confusion
647+
caused by precedence rules, the syntax does not allow &lsquo;<code
648+
class=css>and</code>&rsquo;, &lsquo;<code class=css>or</code>&rsquo;, and
649+
&lsquo;<code class=css>not</code>&rsquo; operators to be mixed without a
650+
layer of parentheses.
651+
652+
<div class=example>
653+
<p>For example, the following rule is not valid:
654+
655+
<pre class=illegal-example>@supports (transition-property: color) or
656+
(animation-name: foo) and
657+
(transform: rotate(10deg)) {
658+
// ...
659+
}</pre>
660+
661+
<p>Instead, authors must write one of the following:</p>
662+
663+
<pre>@supports ((transition-property: color) or
664+
(animation-name: foo)) and
665+
(transform: rotate(10deg)) {
666+
// ...
667+
}</pre>
668+
669+
<pre>@supports (transition-property: color) or
670+
((animation-name: foo)) and
671+
(transform: rotate(10deg))) {
672+
// ...
673+
}</pre>
674+
</div>
647675

648676
<h2 id=at-document><span class=secno>6. </span>Document queries: the
649677
&lsquo;<code class=css>@document</code>&rsquo; rule</h2>

css3-conditional/Overview.src.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,31 @@ <h2 id="at-supports">Feature queries: the '@supports' rule</h2>
457457
}
458458
}</pre></div>
459459

460-
<p>To avoid confusion between and and or, the syntax requires that both
461-
and and or be specified explicitly (rather than, say, using commas or
462-
spaces for one of them). Likewise, to avoid confusion caused by
463-
precedence rules, the syntax does not allow and, or, and not operators
464-
to be mixed without a layer of parentheses. <span class="issue">Add
465-
examples.</span></p>
460+
<p>To avoid confusion between ''and'' and ''or'', the syntax requires
461+
that both ''and'' and ''or'' be specified explicitly (rather than, say,
462+
using commas or spaces for one of them). Likewise, to avoid confusion
463+
caused by precedence rules, the syntax does not allow ''and'', ''or'',
464+
and ''not'' operators to be mixed without a layer of parentheses.</p>
466465

466+
<div class="example">
467+
<p>For example, the following rule is not valid:
468+
<pre class="illegal-example">@supports (transition-property: color) or
469+
(animation-name: foo) and
470+
(transform: rotate(10deg)) {
471+
// ...
472+
}</pre>
473+
<p>Instead, authors must write one of the following:</p>
474+
<pre>@supports ((transition-property: color) or
475+
(animation-name: foo)) and
476+
(transform: rotate(10deg)) {
477+
// ...
478+
}</pre>
479+
<pre>@supports (transition-property: color) or
480+
((animation-name: foo)) and
481+
(transform: rotate(10deg))) {
482+
// ...
483+
}</pre>
484+
</div>
467485

468486
<h2 id="at-document">Document queries: the '@document' rule</h2>
469487

0 commit comments

Comments
 (0)