Skip to content

Commit fc64d66

Browse files
committed
Add more detail to keywords section, define <identifier> type and case-sensitivity.
1 parent 13000be commit fc64d66

2 files changed

Lines changed: 197 additions & 112 deletions

File tree

css3-values/Overview.html

Lines changed: 135 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,20 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
146146
<li><a href="#value-defs"><span class=secno>2. </span> Value Definition
147147
Syntax</a>
148148
<ul class=toc>
149-
<li><a href="#value-types"><span class=secno>2.1. </span> Component
149+
<li><a href="#component-types"><span class=secno>2.1. </span> Component
150150
value types</a>
151151

152-
<li><a href="#value-types"><span class=secno>2.2. </span> Component
153-
value combinators</a>
152+
<li><a href="#component-combinators"><span class=secno>2.2. </span>
153+
Component value combinators</a>
154154

155-
<li><a href="#value-types"><span class=secno>2.3. </span> Component
156-
value multipliers</a>
155+
<li><a href="#component-multipliers"><span class=secno>2.3. </span>
156+
Component value multipliers</a>
157157

158-
<li><a href="#value-types"><span class=secno>2.4. </span> Component
159-
values and white space</a>
158+
<li><a href="#component-whitespace"><span class=secno>2.4. </span>
159+
Component values and white space</a>
160160

161-
<li><a href="#value-types"><span class=secno>2.5. </span> Property value
162-
examples</a>
161+
<li><a href="#value-examples"><span class=secno>2.5. </span> Property
162+
value examples</a>
163163
</ul>
164164

165165
<li><a href="#syntax-and-terminology"><span class=secno>3. </span>Syntax
@@ -168,16 +168,27 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
168168
<li><a href="#numbers-with-unit-identifiers"><span class=secno>3.1.
169169
</span>Numbers with unit identifiers</a>
170170

171-
<li><a href="#identifiers"><span class=secno>3.2. </span>Identifiers</a>
172-
173-
174-
<li><a href="#strings"><span class=secno>3.3. </span>Strings</a>
171+
<li><a href="#strings"><span class=secno>3.2. </span>Strings</a>
175172

176-
<li><a href="#functional-notation"><span class=secno>3.4.
173+
<li><a href="#functional-notation"><span class=secno>3.3.
177174
</span>Functional notation</a>
178175
</ul>
179176

180-
<li><a href="#keywords"><span class=secno>4. </span>Keywords</a>
177+
<li><a href="#idents"><span class=secno>4. </span> Keywords and
178+
Identifiers</a>
179+
<ul class=toc>
180+
<li><a href="#keywords"><span class=secno>4.1. </span> Pre-defined
181+
Keywords</a>
182+
<ul class=toc>
183+
<li><a href="#initial-inherit"><span class=secno>4.1.1. </span> The
184+
&lsquo;<code class=css>initial</code>&rsquo; and &lsquo;<code
185+
class=css>inherit</code>&rsquo; keywords</a>
186+
</ul>
187+
188+
<li><a href="#identifiers"><span class=secno>4.2. </span> User-defined
189+
Identifiers: the &lsquo;<code
190+
class=css>&lt;identifier&gt;</code>&rsquo; type</a>
191+
</ul>
181192

182193
<li><a href="#numeric-types"><span class=secno>5. </span> Numeric Data
183194
Types</a>
@@ -319,7 +330,7 @@ <h2 id=value-defs><span class=secno>2. </span> Value Definition Syntax</h2>
319330
<p>The syntax described here is used to define the set of valid values for
320331
CSS properties. A property value can have one or more components.
321332

322-
<h3 id=value-types><span class=secno>2.1. </span> Component value types</h3>
333+
<h3 id=component-types><span class=secno>2.1. </span> Component value types</h3>
323334

324335
<p>Component value types are designated in several ways:
325336

@@ -355,7 +366,16 @@ <h3 id=value-types><span class=secno>2.1. </span> Component value types</h3>
355366
<p>Some property value definitions also include the slash (/) and/or the
356367
comma (,) as literals. These represent their corresponding tokens.
357368

358-
<h3 id=value-types><span class=secno>2.2. </span> Component value
369+
<p>All CSS properties also accept the keyword values &lsquo;<code
370+
class=css>inherit</code>&rsquo; and &lsquo;<code
371+
class=css>initial</code>&rsquo; as their property value, but for
372+
readability these are not listed explicitly in the property value syntax
373+
definitions. These keywords cannot be combined with other component values
374+
in same declaration; such a declaration is invalid. For example,
375+
&lsquo;<code class=css>background: url(corner.png) no-repeat,
376+
inherit;</code>&rsquo; is invalid.
377+
378+
<h3 id=component-combinators><span class=secno>2.2. </span> Component value
359379
combinators</h3>
360380

361381
<p>Component values can be arranged into property values as follows:
@@ -384,7 +404,7 @@ <h3 id=value-types><span class=secno>2.2. </span> Component value
384404
<!----> a b | c || d && e f
385405
<!---->[ a b ] | [ c || [ d && [ e f ]]]</pre>
386406

387-
<h3 id=value-types><span class=secno>2.3. </span> Component value
407+
<h3 id=component-multipliers><span class=secno>2.3. </span> Component value
388408
multipliers</h3>
389409

390410
<p>Every type, keyword, or bracketed group may be followed by one of the
@@ -408,8 +428,8 @@ <h3 id=value-types><span class=secno>2.3. </span> Component value
408428
occurs one or more times, separated by comma tokens.
409429
</ul>
410430

411-
<h3 id=value-types><span class=secno>2.4. </span> Component values and
412-
white space</h3>
431+
<h3 id=component-whitespace><span class=secno>2.4. </span> Component values
432+
and white space</h3>
413433

414434
<p>Component values are specified in terms of tokens, as described in <a
415435
href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">Chapter 4</a>
@@ -428,7 +448,8 @@ <h3 id=value-types><span class=secno>2.4. </span> Component values and
428448
to get this parsed as the two lengths &lsquo;<code
429449
class=css>1em</code>&rsquo; and &lsquo;<code class=css>2em</code>&rsquo;.
430450

431-
<h3 id=value-types><span class=secno>2.5. </span> Property value examples</h3>
451+
<h3 id=value-examples><span class=secno>2.5. </span> Property value
452+
examples</h3>
432453

433454
<p>Below are some examples of properties with their corresponding value
434455
definition fields
@@ -532,21 +553,7 @@ <h3 id=numbers-with-unit-identifiers><span class=secno>3.1. </span>Numbers
532553
</pre>
533554
</div>
534555

535-
<h3 id=identifiers><span class=secno>3.2. </span>Identifiers</h3>
536-
537-
<p>An <dfn id=identifier>identifier</dfn> is an sequence of characters.
538-
Identifiers cannot start with a digit, and there are other restrictions <a
539-
href="#CSS3SYN" rel=biblioentry>[CSS3SYN]<!--{{!CSS3SYN}}--></a> on what
540-
characters an identifier can contain. Identifiers must not be quoted.
541-
542-
<div class=example>
543-
<pre>
544-
pitch-range: inherit;
545-
counter-increment: header;
546-
</pre>
547-
</div>
548-
549-
<h3 id=strings><span class=secno>3.3. </span>Strings</h3>
556+
<h3 id=strings><span class=secno>3.2. </span>Strings</h3>
550557

551558
<p>A <dfn id=string>string</dfn> is a sequence of characters enclosed by
552559
double quotes or single quotes. Double quotes cannot occur inside double
@@ -585,7 +592,7 @@ <h3 id=strings><span class=secno>3.3. </span>Strings</h3>
585592
</pre>
586593
</div>
587594

588-
<h3 id=functional-notation><span class=secno>3.4. </span>Functional
595+
<h3 id=functional-notation><span class=secno>3.3. </span>Functional
589596
notation</h3>
590597

591598
<p>Some values use a <dfn id=functional-notation0>functional notation</dfn>
@@ -606,45 +613,86 @@ <h3 id=functional-notation><span class=secno>3.4. </span>Functional
606613
that is not a compound value is a <dfn id=simple-value>simple value</dfn>.
607614

608615

609-
<h2 id=keywords><span class=secno>4. </span>Keywords</h2>
616+
<h2 id=idents><span class=secno>4. </span> Keywords and Identifiers</h2>
617+
618+
<p>An <dfn id=identifier>identifier</dfn> is a sequence of characters
619+
conforming to the <code>IDENT</code> token in the <a
620+
href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>.
621+
<a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> Identifiers
622+
cannot be quoted; otherwise they would be interpreted as a string.
610623

611-
<p>In the value definition fields, keywords appear literally. Keywords are
612-
identifiers.
624+
<h3 id=keywords><span class=secno>4.1. </span> Pre-defined Keywords</h3>
625+
626+
<p>In the value definition fields, keywords with a pre-defined meaning
627+
appear literally. Keywords are CSS <i>identifiers</i> and are interpreted
628+
case-insensitively within the ASCII range (i.e., [a-z] and [A-Z] are
629+
equivalent).
613630

614631
<div class=example>
615632
<p>For example, here is the value definition for the &lsquo;<code
616633
class=property>border-collapse</code>&rsquo; property:</p>
617634

618-
<pre>
619-
Value:&nbsp;collapse | separate
620-
</pre>
635+
<pre>Value:&nbsp;collapse | separate</pre>
621636

622637
<p>And here is an example of its use:</p>
623638

624-
<pre>
625-
table { border-collapse: separate }
626-
</pre>
639+
<pre>table { border-collapse: separate }</pre>
627640
</div>
628641

629-
<p>All CSS3 properties accept the keyword values <span
630-
class=css>&lsquo;<code class=property>inherit</code>&rsquo;</span> and
631-
<span class=css>&lsquo;<code class=property>initial</code>&rsquo;</span>,
632-
as described in <a href="#CSS3CASCADE"
633-
rel=biblioentry>[CSS3CASCADE]<!--{{!CSS3CASCADE}}--></a>.
642+
<h4 id=initial-inherit><span class=secno>4.1.1. </span> The &lsquo;<code
643+
class=css>initial</code>&rsquo; and &lsquo;<code
644+
class=css>inherit</code>&rsquo; keywords</h4>
645+
646+
<p>As defined <a href="#component-types">above</a>, all properties accept
647+
the &lsquo;<code class=css>initial</code>&rsquo; and &lsquo;<code
648+
class=css>inherit</code>&rsquo; keywords, which represent value concepts
649+
common to all CSS properties.
650+
651+
<p>The <dfn id=inherit>&lsquo;<code class=css>inherit</code>&rsquo;</dfn>
652+
keyword is <a
653+
href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">defined</a>
654+
in <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
655+
656+
<p>The <dfn id=initial>&lsquo;<code class=css>initial</code>&rsquo;</dfn>
657+
keyword represents the value that is designated as the property's initial
658+
value. <a href="#CSS3CASCADE"
659+
rel=biblioentry>[CSS3CASCADE]<!--{{CSS3CASCADE}}--></a>
660+
661+
<p class=issue>Should these keywords affect the specified or computed
662+
value? See <a
663+
href="http://lists.w3.org/Archives/Public/www-style/2011Jan/0075.html">various</a>
664+
<a
665+
href="http://lists.w3.org/Archives/Public/www-style/2011May/0402.html">issues</a>.
666+
634667

635668
<p class=issue>Would it be useful to have a &lsquo;<code
636-
class=property>default</code>&rsquo; value, defined to be equivalent to
637-
<span class=css>&lsquo;<code class=property>inherit</code>&rsquo;</span>
638-
for properties that are inherited by default and equivalent to <span
639-
class=css>&lsquo;<code class=property>initial</code>&rsquo;</span> for
640-
properties that are not inherited by default? This might be easier for
641-
authors to use than <span class=css>&lsquo;<code
642-
class=property>initial</code>&rsquo;</span> and <span
643-
class=css>&lsquo;<code class=property>inherit</code>&rsquo;</span> since
644-
it wouldn't require thinking about whether a property is inherited by
645-
default or not (which isn't obvious for some properties, such as
669+
class=property>default</code>&rsquo; value, defined to be equivalent to <a
670+
class=css href="#inherit">&lsquo;<code
671+
class=property>inherit</code>&rsquo;</a> for properties that are inherited
672+
by default and equivalent to <a class=css href="#initial">&lsquo;<code
673+
class=property>initial</code>&rsquo;</a> for properties that are not
674+
inherited by default? This might be easier for authors to use than <a
675+
class=css href="#initial">&lsquo;<code
676+
class=property>initial</code>&rsquo;</a> and <a class=css
677+
href="#inherit">&lsquo;<code class=property>inherit</code>&rsquo;</a>
678+
since it wouldn't require thinking about whether a property is inherited
679+
by default or not (which isn't obvious for some properties, such as
646680
text-decoration and visibility).
647681

682+
<h3 id=identifiers><span class=secno>4.2. </span> User-defined Identifiers:
683+
the &lsquo;<a href="#identifier-value"><code
684+
class=css>&lt;identifier&gt;</code></a>&rsquo; type</h3>
685+
686+
<p>Some properties accept arbitrary user-defined identifiers as a component
687+
value. This generic data type is denoted by <dfn
688+
id=identifier-value><code>&lt;identifier&gt;</code></dfn>, and represents
689+
any valid CSS <a href="#identifier"><i>identifier</i></a> that does not
690+
otherwise appear as a pre-defined keyword in that property's value
691+
definition. Such identifiers are fully case-sensitive, even in the ASCII
692+
range (e.g. &lsquo;<code class=css>example</code>&rsquo; and &lsquo;<code
693+
class=css>EXAMPLE</code>&rsquo; are two different, unrelated user-defined
694+
identifiers).
695+
648696
<h2 id=numeric-types><span class=secno>5. </span> Numeric Data Types</h2>
649697

650698
<h3 id=integers><span class=secno>5.1. </span> Integers: the &lsquo;<a
@@ -1940,16 +1988,6 @@ <h3 class=no-num id=normative-references>Normative references</h3>
19401988
href="http://www.w3.org/TR/2007/WD-css3-grid-20070905">http://www.w3.org/TR/2007/WD-css3-grid-20070905</a>
19411989
</dd>
19421990
<!---->
1943-
1944-
<dt id=CSS3SYN>[CSS3SYN]
1945-
1946-
<dd>L. David Baron. <a
1947-
href="http://www.w3.org/TR/2003/WD-css3-syntax-20030813"><cite>CSS3
1948-
module: Syntax.</cite></a> 13 August 2003. W3C Working Draft. (Work in
1949-
progress.) URL: <a
1950-
href="http://www.w3.org/TR/2003/WD-css3-syntax-20030813">http://www.w3.org/TR/2003/WD-css3-syntax-20030813</a>
1951-
</dd>
1952-
<!---->
19531991
</dl>
19541992
<!--end-normative-->
19551993

@@ -1961,6 +1999,16 @@ <h3 class=no-num id=other-references>Other references</h3>
19611999
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
19622000
<!---->
19632001

2002+
<dt id=CSS3CASCADE>[CSS3CASCADE]
2003+
2004+
<dd>H&#229;kon Wium Lie. <a
2005+
href="http://www.w3.org/TR/2005/WD-css3-cascade-20051215"><cite>CSS3
2006+
module: Cascading and inheritance.</cite></a> 15 December 2005. W3C
2007+
Working Draft. (Work in progress.) URL: <a
2008+
href="http://www.w3.org/TR/2005/WD-css3-cascade-20051215">http://www.w3.org/TR/2005/WD-css3-cascade-20051215</a>
2009+
</dd>
2010+
<!---->
2011+
19642012
<dt id=CSS3NAMESPACE>[CSS3NAMESPACE]
19652013

19662014
<dd>Elika J. Etemad; Anne van Kesteren. <a
@@ -2016,7 +2064,7 @@ <h2 class=no-num id=index>Index</h2>
20162064
title="&lt;color&gt;"><strong>5.6.</strong></a>
20172065

20182066
<li>compound value, <a href="#compound-value" title="compound
2019-
value"><strong>3.4.</strong></a>
2067+
value"><strong>3.3.</strong></a>
20202068

20212069
<li>computed value, <a href="#computed-value" title="computed
20222070
value"><strong>6.2.</strong></a>
@@ -2040,7 +2088,7 @@ <h2 class=no-num id=index>Index</h2>
20402088
(unit)"><strong>5.13.1.</strong></a>
20412089

20422090
<li>functional notation, <a href="#functional-notation0" title="functional
2043-
notation"><strong>3.4.</strong></a>
2091+
notation"><strong>3.3.</strong></a>
20442092

20452093
<li>grad (grads), <a href="#grad" title="grad
20462094
(grads)"><strong>5.7.</strong></a>
@@ -2052,7 +2100,17 @@ <h2 class=no-num id=index>Index</h2>
20522100

20532101

20542102
<li>identifier, <a href="#identifier"
2055-
title=identifier><strong>3.2.</strong></a>
2103+
title=identifier><strong>4.</strong></a>
2104+
2105+
<li><a href="#identifier-value"><code>&lt;identifier&gt;</code></a>, <a
2106+
href="#identifier-value"
2107+
title="&lt;identifier&gt;"><strong>4.2.</strong></a>
2108+
2109+
<li>&lsquo;<code class=css>inherit</code>&rsquo;, <a href="#inherit"
2110+
title="''inherit''"><strong>4.1.1.</strong></a>
2111+
2112+
<li>&lsquo;<code class=css>initial</code>&rsquo;, <a href="#initial"
2113+
title="''initial''"><strong>4.1.1.</strong></a>
20562114

20572115
<li>integer, <a href="#integer" title=integer><strong>5.1.</strong></a>
20582116

@@ -2072,7 +2130,7 @@ <h2 class=no-num id=index>Index</h2>
20722130
<li>ms (milliseconds), <a href="#ms" title="ms
20732131
(milliseconds)"><strong>5.8.</strong></a>
20742132

2075-
<li>newline, <a href="#newline" title=newline>3.3.</a>
2133+
<li>newline, <a href="#newline" title=newline>3.2.</a>
20762134

20772135
<li>number, <a href="#number" title=number><strong>5.2.</strong></a>
20782136

@@ -2113,15 +2171,15 @@ <h2 class=no-num id=index>Index</h2>
21132171
<li>root em, <a href="#rem" title="root em"><strong>5.4.2.4.</strong></a>
21142172

21152173
<li>simple value, <a href="#simple-value" title="simple
2116-
value"><strong>3.4.</strong></a>
2174+
value"><strong>3.3.</strong></a>
21172175

21182176
<li>specified value, <a href="#specified-value" title="specified
21192177
value"><strong>6.1.</strong></a>
21202178

21212179
<li>s (seconds), <a href="#s" title="s
21222180
(seconds)"><strong>5.8.</strong></a>
21232181

2124-
<li>string, <a href="#string" title=string><strong>3.3.</strong></a>
2182+
<li>string, <a href="#string" title=string><strong>3.2.</strong></a>
21252183

21262184
<li>&lt;string&gt;, <a href="#ltstringgt0"
21272185
title="&lt;string&gt;"><strong>5.5.</strong></a>

0 commit comments

Comments
 (0)