Skip to content

Commit a82464f

Browse files
committed
[mediaqueries] Add the 'inverted-colors' media feature
1 parent d2aed03 commit a82464f

2 files changed

Lines changed: 103 additions & 24 deletions

File tree

mediaqueries/Overview.bs

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Group: csswg
55
Shortname: mediaqueries
66
Level: 4
77
Status: ED
8-
Date: 2014-09-12
98
ED: http://dev.w3.org/csswg/mediaqueries4/
109
TR: http://www.w3.org/TR/mediaqueries-4/
1110
Editor: Florian Rivoal, Invited Expert, florian@rivoal.net
@@ -1375,6 +1374,49 @@ monochrome</h3>
13751374
</pre>
13761375
</div>
13771376

1377+
<h3 id="inverted">
1378+
inverted-colors</h3>
1379+
1380+
<pre class='descdef mq'>
1381+
Name: inverted-colors
1382+
Value: none | inverted
1383+
For: @media
1384+
Type: discrete
1385+
</pre>
1386+
1387+
The 'inverted-colors' media feature indicates whether the content is displayed normally, or whether colors have been inverted.
1388+
1389+
<p class="note">This is an indication that the user agent or underlying
1390+
operating system has forcibly inverted all colors, not a request to do so. This
1391+
is sometimes provided as a simple accessibility feature, allowing users to
1392+
switch between light-on-dark and dark-on-light text. However, this has
1393+
unpleasant side effects, such as inverting pictures, or turning shadows into
1394+
highlights, which reduce the readability of the content.
1395+
1396+
<dl dfn-type=value dfn-for="@media/inverted-colors">
1397+
<dt><dfn>none</dfn>
1398+
<dd>
1399+
Colors are displayed normally.
1400+
1401+
<dt><dfn>inverted</dfn>
1402+
<dd>
1403+
All pixels within the displayed area have been inverted.
1404+
1405+
</dl>
1406+
1407+
<div class="example">
1408+
For example, a user frequently using his operating system's
1409+
ability to invert the screens color may want to add the following to his user
1410+
style sheet, to limit the undesirable side effects of the inversion.
1411+
1412+
<pre>@media (inverted-colors) {
1413+
img { filter: invert(100%); }
1414+
* { text-shadow: none; background-shadow: none; }
1415+
}
1416+
</pre>
1417+
</div>
1418+
1419+
13781420
<!--
13791421
████ ██ ██ ████████ ████████ ████████ ███ ██████ ████████ ████ ███████ ██ ██
13801422
██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██
@@ -1643,8 +1685,6 @@ light-level</h3>
16431685
Using this media feature for accessibility purposes overlaps a lot with <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465764.aspx">the high-contrast media feature proposed by Microsoft</a>.
16441686
Can we adjust this so that it covers all use cases for both,
16451687
or somehow modify them to work in an orthogonal, rather than overlapping, fashion?
1646-
Also, the high-contrast media feature could be extended to also cover inverted colors,
1647-
as discussed in http://lists.w3.org/Archives/Public/www-style/2013Oct/0672.html
16481688

16491689
<div class="example">
16501690
<pre>

0 commit comments

Comments
 (0)