Skip to content

Commit 0f0f297

Browse files
committed
[css-values-4][mediaqueries-5] Clarify when minimum font sizes/etc are or aren't applied to relative units. Fixes w3c#5858.
1 parent 670f2f2 commit 0f0f297

2 files changed

Lines changed: 29 additions & 10 deletions

File tree

css-values-4/Overview.bs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,10 +1671,20 @@ Font-relative Lengths: the ''em'', ''ex'', ''cap'', ''ch'', ''ic'', ''rem'', ''l
16711671
that it would be worth adding them?
16721672
Or should we just wait for Houdini Custom Units?
16731673

1674+
Some user-agents allow users to apply additional restrictions to font sizes in a document,
1675+
such as setting minimum font sizes to ensure readability.
1676+
When used in the context of an element,
1677+
these additional restrictions must be applied to the [=used value=] of these properties only;
1678+
they <em>must not</em> affect the resolution of relative units.
1679+
16741680
When used outside the context of an element
16751681
(such as in <a>media queries</a>),
16761682
these units refer to the metrics corresponding
16771683
to the initial values of the 'font' and 'line-height' properties.
1684+
In this context,
1685+
the units must apply any additional restrictions to the values,
1686+
contrary to the normal behavior mentioned above.
1687+
16781688
When used in the value of the 'font-size' property on the element they refer to,
16791689
they resolve against the computed metrics of the parent element--
16801690
or against the computed metrics corresponding to the initial values
@@ -1690,6 +1700,7 @@ Font-relative Lengths: the ''em'', ''ex'', ''cap'', ''ch'', ''ic'', ''rem'', ''l
16901700
(The other font-relative units continue to resolve against
16911701
the element’s own metrics when used in 'line-height'.)
16921702

1703+
16931704
<!--
16941705
██ ██ ██ ██ ██ ████████ ████████ ██████
16951706
██ ██ ██ ██ ██ ██ ██ ██ ██ ██

mediaqueries-5/Overview.bs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ At Risk: The '@media/update' media feature
2525

2626
<pre class=link-defaults>
2727
spec:css-conditional-3; type:at-rule; text:@media
28-
spec:css-values-4; type:type; text:<ratio>
29-
spec:css-values-4; type:type; text:<integer>
30-
spec:css-values-4; type:type; text:<length>
31-
spec:css-values-4; type:type; text:<number>
32-
spec:css-values-4; type:type; text:<resolution>
28+
spec:css-values-4;
29+
type:type;
30+
text:<ratio>
31+
text:<length>
32+
text:<integer>
33+
text:<number>
34+
text:<resolution>
35+
type:dfn; text:relative length
36+
3337
</pre>
3438

3539
<pre class=biblio>
@@ -135,11 +139,15 @@ Units</h3>
135139
defined in [[!CSS-VALUES-4]]. For example, the pixel unit represents CSS pixels and
136140
not physical pixels.
137141

138-
<a spec="css-values">Relative length</a> units in media queries are based on the <a>initial value</a>, which means
139-
that units are never based on results of declarations. <span class=note>For example, in HTML,
142+
[=Relative length=] units in media queries are based on the <a>initial value</a>,
143+
which means that units are never based on results of declarations.
144+
145+
Note: For example, in HTML,
140146
the ''em'' unit is relative to the <a>initial value</a> of 'font-size',
141147
defined by the user agent or the user's preferences,
142-
not any styling on the page.</span>
148+
not any styling on the page.
149+
Note that this will also take into account additional restrictions the user might apply,
150+
such as minimum font sizes.
143151

144152
<h3 id='mq-prefers-security'>
145153
Prefers-* Media Features Security and Privacy</h3>
@@ -2160,13 +2168,13 @@ All Available Interaction Capabilities: the 'any-pointer' and 'any-hover' featur
21602168
</div>
21612169

21622170
<!--
2163-
██ ██ ████ ████████ ████████ ███████
2171+
██ ██ ████ ████████ ████████ ███████
21642172
██ ██ ██ ██ ██ ██ ██ ██
21652173
██ ██ ██ ██ ██ ██ ██ ██
21662174
██ ██ ██ ██ ██ ██████ ██ ██
21672175
██ ██ ██ ██ ██ ██ ██ ██
21682176
██ ██ ██ ██ ██ ██ ██ ██
2169-
███ ████ ████████ ████████ ███████
2177+
███ ████ ████████ ████████ ███████
21702178
-->
21712179

21722180
<h2 id="video-prefixed-features">Video Prefixed Features</h2>

0 commit comments

Comments
 (0)