Skip to content

Commit 75e8082

Browse files
committed
[css-fonts-4] Keywords inside local() are an error, #8187
1 parent 6cce777 commit 75e8082

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

css-fonts-4/Overview.bs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,14 +2708,20 @@ or font format.
27082708
within a larger family.
27092709
The name can optionally be enclosed in quotes.
27102710
If unquoted,
2711-
the unquoted font family name processing conventions apply;
2711+
the <a href="#family-name-syntax">unquoted font family name processing conventions</a> apply;
2712+
in other words,
27122713
the name must be a sequence of identifiers
27132714
separated by <a href="https://www.w3.org/TR/css3-syntax/#whitespace">whitespace</a>
27142715
which is converted to a string
27152716
by joining the identifiers together
2716-
separated by a single space.
2717+
separated by a single space;
2718+
and thus,
2719+
<a>CSS-wide keywords</a> such as ''inherit'', and
2720+
<<generic-family>> keywords such as ''serif''
2721+
are not allowed inside <code>local()</code>.
27172722

2718-
<pre>
2723+
2724+
<pre class="lang-css">
27192725
/* regular face of Gentium */
27202726
@font-face {
27212727
font-family: MyGentium;
@@ -2724,6 +2730,17 @@ or font format.
27242730
}
27252731
</pre>
27262732

2733+
<div class="invalid example">
2734+
For example, this use of <code>local()</code> would be an error:
2735+
2736+
<pre class="lang-css">
2737+
@font-face {
2738+
font-family: foo;
2739+
src: local(inherit);
2740+
}
2741+
</pre>
2742+
</div>
2743+
27272744
For OpenType and TrueType fonts,
27282745
this string is used to match only the Postscript name
27292746
or the full font name

0 commit comments

Comments
 (0)