Skip to content

Commit f02f9e3

Browse files
author
Florian Rivoal
committed
Adding the "pointer" media feature.
1 parent e2a6506 commit f02f9e3

2 files changed

Lines changed: 120 additions & 6 deletions

File tree

css4-mediaqueries/Overview.html

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
208208

209209
<li><a href="#script"><span class=secno>4.14. </span>script</a>
210210

211-
<li><a href="#hover"><span class=secno>4.15. </span>hover</a>
211+
<li><a href="#pointer"><span class=secno>4.15. </span>pointer</a>
212+
213+
<li><a href="#hover"><span class=secno>4.16. </span>hover</a>
212214
</ul>
213215

214216
<li><a href="#values"><span class=secno>5. </span>Values</a>
@@ -1065,7 +1067,68 @@ <h3 id=script><span class=secno>4.14. </span>script</h3>
10651067
<p>Only 0 and 1 are valid values. (This includes -0.) Thus everything else
10661068
creates a malformed media query.
10671069

1068-
<h3 id=hover><span class=secno>4.15. </span>hover</h3>
1070+
<h3 id=pointer><span class=secno>4.15. </span>pointer</h3>
1071+
1072+
<div class=media-feature><span class=label>Value:</span> none | coarse |
1073+
fine<br>
1074+
<span class=label>Applies to:</span> visual and tactile media types<br>
1075+
<span class=label>Accepts min/max prefixes:</span> no<br>
1076+
</div>
1077+
1078+
<p>The ‘<code class=css>pointer</code>’ media feature is used to query
1079+
about the presence and accuracy of a pointing device such as a mouse. If a
1080+
device has multiple input mechanisms, it is recommended that the UA
1081+
reports the characteristics of the pointing device of the primary input
1082+
mechanism. It takes the following values:
1083+
1084+
<dl>
1085+
<dt><dfn id=none title="pointer:none"><code
1086+
class=css>none</code></dfn>
1087+
1088+
<dd>The input mechanism of the device does not include a pointing device.
1089+
1090+
<dt><dfn id=coarse title="pointer:coarse"><code
1091+
class=css>coarse</code></dfn>
1092+
1093+
<dd>The input mechanism of the device includes a pointing device of
1094+
limited accuracy.
1095+
1096+
<dt><dfn id=fine title="pointer:fine"><code
1097+
class=css>fine</code></dfn>
1098+
1099+
<dd>The input mechanism of the device includes an accurate pointing
1100+
device.
1101+
</dl>
1102+
1103+
<p>Both ‘<code class=css>coarse</code>’ and ‘<code
1104+
class=css>fine</code>’ indicate the presence of a pointing device, but
1105+
differ in accuracy. A pointing device with which it would be difficult or
1106+
impossible to reliably pick one of several small adjacent targets would
1107+
qualify as ‘<code class=css>coarse</code>’.
1108+
1109+
<p class=note>Typical examples of a ‘<code class=css>fine</code>
1110+
pointing system are a mouse, a track-pad or a stylus-based touch screen.
1111+
Finger-based touch screens would qualify as ‘<code
1112+
class=css>coarse</code>’.
1113+
1114+
<p>For accessibility reasons, even on devices whose pointing device can be
1115+
described as ‘<code class=css>fine</code>’, the UA may give a value of
1116+
<code class=css>coarse</code>’ or ‘<code class=css>none</code>
1117+
to this media query, to indicate that the user has difficulties
1118+
manipulating the input device accurately or at all.
1119+
1120+
<div class=example>
1121+
<pre><code>/* Make radio buttons and check boxes larger if we have an inaccurate pointing device */
1122+
@media (pointer:coarse) {
1123+
input[type="checkbox"], input[type="radio"] {
1124+
min-width:30px;
1125+
min-height:40px;
1126+
background:transparent;
1127+
}
1128+
}</code></pre>
1129+
</div>
1130+
1131+
<h3 id=hover><span class=secno>4.16. </span>hover</h3>
10691132

10701133
<div class=media-feature><span class=label>Value:</span>
10711134
&lt;integer&gt;<br>
@@ -1142,9 +1205,6 @@ <h3 id=changes-2012><span class=secno>7.1. </span>Changes Since the Media
11421205
2012 Proposed Recomendation of Media Queries Level 3</a>:
11431206

11441207
<ul>
1145-
<li>The <a href="#script"><code class=css>script</code>’ media
1146-
feature</a> was added.
1147-
11481208
<li>For a media feature <var>feature</var>,
11491209
<code>(<var>feature</var>)</code> will evaluate to true if
11501210
<code>(<var>feature</var>:<var>x</var>)</code> will evaluate to true for
@@ -1153,6 +1213,12 @@ <h3 id=changes-2012><span class=secno>7.1. </span>Changes Since the Media
11531213
<code>0em</code>, etc.)<ins> or the keyword ‘<code
11541214
class=property>none</code></ins>.
11551215

1216+
<li>The <a href="#script"><code class=css>script</code>’ media
1217+
feature</a> was added.
1218+
1219+
<li>The <a href="#pointer"><code class=css>pointer</code>’ media
1220+
feature</a> was added.
1221+
11561222
<li>The <a href="#hover"><code class=css>hover</code>’ media
11571223
feature</a> was added.
11581224
</ul>

css4-mediaqueries/Overview.src.html

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,53 @@ <h3 id="script">script</h3>
937937
<p>Only 0 and 1 are valid values. (This includes -0.) Thus everything else
938938
creates a malformed media query.</p>
939939

940+
<h3 id="pointer">pointer</h3>
941+
<div class="media-feature"><span class="label">Value:</span> none | coarse | fine<br>
942+
<span class="label">Applies to:</span> visual and tactile media types<br>
943+
<span class="label">Accepts min/max prefixes:</span> no<br>
944+
</div>
945+
946+
<p>The ''pointer'' media feature is used to query about the presence and
947+
accuracy of a pointing device such as a mouse. If a device has multiple input
948+
mechanisms, it is recommended that the UA reports the characteristics of the
949+
pointing device of the primary input mechanism. It takes the following
950+
values:</p>
951+
952+
<dl>
953+
<dt><dfn title="pointer:none">''none''</dfn></dt>
954+
<dd>The input mechanism of the device does not include a pointing device.</dd>
955+
956+
<dt><dfn title="pointer:coarse">''coarse''</dfn></dt>
957+
<dd>The input mechanism of the device includes a pointing device of limited accuracy.</dd>
958+
959+
<dt><dfn title="pointer:fine">''fine''</dfn></dt>
960+
<dd>The input mechanism of the device includes an accurate pointing device.</dd>
961+
</dl>
962+
963+
<p>Both ''coarse'' and ''fine'' indicate the presence of a pointing device, but
964+
differ in accuracy. A pointing device with which it would be difficult or
965+
impossible to reliably pick one of several small adjacent targets would qualify
966+
as ''coarse''.</p>
967+
968+
<p class="note">Typical examples of a ''fine'' pointing system are a mouse, a track-pad or a
969+
stylus-based touch screen. Finger-based touch screens would qualify as ''coarse''.</p>
970+
971+
<p>For accessibility reasons, even on devices whose pointing device can be
972+
described as ''fine'', the UA may give a value of ''coarse'' or ''none'' to
973+
this media query, to indicate that the user has difficulties
974+
manipulating the input device accurately or at all.</p>
975+
976+
<div class="example">
977+
<pre><code>/* Make radio buttons and check boxes larger if we have an inaccurate pointing device */
978+
@media (pointer:coarse) {
979+
input[type="checkbox"], input[type="radio"] {
980+
min-width:30px;
981+
min-height:40px;
982+
background:transparent;
983+
}
984+
}</code></pre>
985+
</div>
986+
940987
<h3 id="hover">hover</h3>
941988
<div class="media-feature"><span class="label">Value:</span> &lt;integer&gt;<br>
942989
<span class="label">Applies to:</span> visual and tactile media types<br>
@@ -1004,13 +1051,14 @@ <h3 id="changes-2012">Changes Since the Media Queries Level 3</h3>
10041051
<a href="http://www.w3.org/TR/2012/PR-css3-mediaqueries-20120426/">26 April 2012
10051052
Proposed Recomendation of Media Queries Level 3</a>:
10061053
<ul>
1007-
<li>The <a href="#script">''script'' media feature</a> was added.
10081054
<li>For a media feature <var>feature</var>,
10091055
<code>(<var>feature</var>)</code> will evaluate to true if
10101056
<code>(<var>feature</var>:<var>x</var>)</code> will evaluate to true
10111057
for a value <var>x</var> other than zero or zero followed by a unit
10121058
identifier (i.e., other than <code>0</code>, <code>0px</code>,
10131059
<code>0em</code>, etc.)<ins> or the keyword 'none'</ins>.
1060+
<li>The <a href="#script">''script'' media feature</a> was added.
1061+
<li>The <a href="#pointer">''pointer'' media feature</a> was added.
10141062
<li>The <a href="#hover">''hover'' media feature</a> was added.
10151063
</ul>
10161064

0 commit comments

Comments
 (0)