Skip to content

Commit b060a11

Browse files
committed
[css-fonts-4] Font shorthand: set explicitly, reset implicitly and cascade implicitly #7832
1 parent 9e21f54 commit b060a11

File tree

1 file changed

+58
-19
lines changed

1 file changed

+58
-19
lines changed

css-fonts-4/Overview.bs

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,11 @@ Shorthand font property: the 'font' property</h3>
15091509
variations/font-shorthand.html
15101510
</wpt>
15111511

1512+
The syntax of this property is based on a traditional
1513+
typographical shorthand notation
1514+
to set multiple properties related to fonts.
1515+
For historical and backwards-compatibility reasons,
1516+
it is <em>almost</em> a shorthand property.
15121517

15131518
The 'font!!property' property is,
15141519
except as described below,
@@ -1517,6 +1522,7 @@ Shorthand font property: the 'font' property</h3>
15171522
'font-weight!!property', 'font-stretch!!property',
15181523
'font-size!!property', 'line-height', 'font-family!!property'
15191524
at the same place in the stylesheet.
1525+
15201526
Values for the 'font-variant!!property' property can also be included
15211527
but only those supported in CSS 2.1;
15221528
none of the 'font-variant!!property' values added in
@@ -1537,30 +1543,63 @@ Shorthand font property: the 'font' property</h3>
15371543
semi-condensed | semi-expanded | expanded | extra-expanded |
15381544
ultra-expanded]</pre>
15391545

1540-
The syntax of this property is based on a traditional
1541-
typographical shorthand notation
1542-
to set multiple properties related to fonts.
1546+
Therefore we have the following classification
1547+
of font-related properties
1548+
and their interaction with the 'font!!property' property:
1549+
1550+
<dl>
1551+
<dt><dfn>Set Explicitly</dfn></dt>
1552+
<dd><p>These properties may be set using the 'font!!property' property:</p>
1553+
<ul>
1554+
<li>'font-family!!property'</li>
1555+
<li>'font-size!!property'</li>
1556+
<li>'font-stretch!!property' (css3)</li>
1557+
<li>'font-style!!property'</li>
1558+
<li>'font-variant-caps!!property' (css2)</li>
1559+
<li>'font-weight!!property'</li>
1560+
<li>'line-height'</li>
1561+
</ul>
1562+
</dd>
1563+
<dt><dfn>Reset Implicitly</dfn></dt>
1564+
<dd><p>These may not be set, but are reset to their initial values:</p>
1565+
<ul>
1566+
<li>'font-feature-settings!!property'</li>
1567+
<li>'font-kerning!!property'</li>
1568+
<li>'font-language-override!!property'</li>
1569+
<li>'font-optical-sizing!!property'</li>
1570+
<li>'font-size-adjust!!property'</li>
1571+
<li>'font-variant-alternates!!property'</li>
1572+
<li>'font-variant-caps!!property' (css3 and above)</li>
1573+
<li>'font-variant-east-asian!!property'</li>
1574+
<li>'font-variant-ligatures!!property'</li>
1575+
<li>'font-variant-numeric!!property'</li>
1576+
<li>'font-variant-position!!property'</li>
1577+
<li>'font-variation-settings!!property'</li>
1578+
</ul>
1579+
</dd>
1580+
<dt><dfn>Cascaded Independently</dfn></dt>
1581+
<dd><p>There are neither set nor reset by the 'font!!property' property:</p>
1582+
<ul>
1583+
<li>'font-palette!!property'</li>
1584+
<li>'font-synthesis-weight!!property'</li>
1585+
<li>'font-synthesis-style!!property'</li>
1586+
<li>'font-synthesis-caps!!property'</li>
1587+
</ul>
1588+
</dd>
1589+
</dl>
1590+
1591+
All subproperties of the 'font!!property' property
1592+
in the [=Set Explicitly=] and [=Reset Implicitly=] groups
1593+
are first reset
1594+
to their initial values.
15431595

1544-
All subproperties of the 'font!!property' property are first reset
1545-
to their initial values,
1546-
including those listed above
1547-
plus 'font-size-adjust', 'font-kerning',
1548-
all subproperties of 'font-variant!!property',
1549-
'font-feature-settings!!property',
1550-
'font-language-override!!property',
1551-
'font-optical-sizing',
1552-
'font-variation-settings!!property',
1553-
and 'font-palette'.
1554-
Then, those properties that are given explicit values
1596+
Then, those properties the [=Set Explicitly=] group
1597+
that are given explicit values
15551598
in the 'font!!property' shorthand
15561599
are set to those values.
15571600
For a definition of allowed and initial values,
15581601
see the previously defined properties.
1559-
For reasons of backwards compatibility,
1560-
it is not possible to set 'font-size-adjust'
1561-
to anything other than its initial value
1562-
using the 'font' shorthand property;
1563-
instead, use the individual property.
1602+
15641603

15651604
<div class="example" id="ex-font-shorthand">
15661605
<pre>

0 commit comments

Comments
 (0)