Skip to content

Commit 06fb2cc

Browse files
committed
[mediaqueries] Allow literal true and false as custom MQ values, since you can hack always-true and always-false via boolean algebra already.
1 parent 2bfd67e commit 06fb2cc

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

mediaqueries/Overview.bs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,15 +1837,19 @@ Custom Media Queries</h2>
18371837

18381838
A <dfn>custom media query</dfn> is defined with the ''@custom-media'' rule:
18391839

1840-
<pre class='prod'><dfn>@custom-media</dfn> = @custom-media <<extension-name>> <<media-query-list>> ;</pre>
1841-
1842-
This defines that the <a>custom media query</a> named by the <<extension-name>> represents the given <<media-query-list>>.
1840+
<pre class='prod'>
1841+
<dfn>@custom-media</dfn> = @custom-media <<extension-name>> [ <<media-query-list>> | true | false ] ;
1842+
</pre>
18431843

18441844
The <<extension-name>> can then be used in a <a>media feature</a>.
18451845
It <strong>must</strong> be used in a <a>boolean context</a>;
18461846
using them in a normal or <a>range context</a> is a syntax error.
1847-
The <a>custom media query</a> evaluates to true if the <<media-query-list>> it represents evaluates to true,
1847+
If a <<media-query-list>> is given,
1848+
the <a>custom media query</a> evaluates to true
1849+
if the <<media-query-list>> it represents evaluates to true,
18481850
and false otherwise.
1851+
If <dfn value for="@custom-media">true</dfn> or <dfn value for="@custom-media">false</dfn> is given,
1852+
the <a>custom media query</a> evaluates to true or false, respectively.
18491853

18501854
<div class='example'>
18511855
For example, if a responsive site uses a particular breakpoint in several places,

0 commit comments

Comments
 (0)