<pre class='metadata'>
Title: CSS Values and Units Module Level 3
Group: CSSWG
Shortname: css-values
Level: 3
Status: ED
Deadline: 2022-02-22
Work Status: Testing
Implementation Report: https://drafts.csswg.org/css-values-3/implementation-report.html
ED: https://drafts.csswg.org/css-values-3/
TR: https://www.w3.org/TR/css-values-3/
Editor: Tab Atkins, Google, http://xanthir.com/contact/, w3cid 42199
Editor: Elika J. Etemad / fantasai, Apple, http://fantasai.inkedblade.net/contact, w3cid 35400
Former Editor: Håkon Wium Lie, Opera Software, howcome@opera.com
Abstract: This CSS module describes the common values and units that CSS properties accept and the syntax used for describing them in CSS property definitions.
Ignored Terms: <spacing-limit>, pairing, property
Ignored Vars: Cn+1, n
Inline Github Issues: no
Default Highlight: css
WPT Display: open
Ignore MDN Failure: calc-constants, exponent-funcs, funcdef-mod, funcdef-rem, funcdef-round, sign-funcs, trig-funcs
</pre>
<pre class='link-defaults'>
spec: css-backgrounds-3;
	type: property;
		text: border-color
		text: box-shadow
	type: type; text: <position>
spec: css-color-4; type: value; text: currentcolor
spec: css2; type: property; text: border-collapse
spec: infra; type: dfn; text: string
</pre>
<pre class="ignored-specs">
spec: css-borders-4;
spec: css-device-adapt-1;
</pre>

<style>
code, small { white-space: nowrap }
pre.value { font: inherit; white-space: pre-wrap; margin: 0; padding: 0; }
#propvalues td { text-align: right; }
#propvalues td + td { text-align: left; }
dt + dt::before { content: ", "; }
dl:not(.switch) dt { display: inline; }
td > small { display: block; }
</style>

<style>
/* Put nice boxes around each algorithm. */
[data-algorithm]:not(.heading) {
	padding: .5em;
	border: thin solid #ddd; border-radius: .5em;
	margin: .5em calc(-0.5em - 1px);
}
[data-algorithm]:not(.heading) > :first-child {
	margin-top: 0;
}
[data-algorithm]:not(.heading) > :last-child {
	margin-bottom: 0;
}
[data-algorithm] [data-algorithm] {
	margin: 1em 0;
}
</style>

<h2 id="intro">
Introduction</h2>

	The value definition field of each CSS property can contain keywords,
	data types (which appear between <css>&lt;</css> and <css>></css>),
	and information on how they can be combined.
	Generic data types (<<length>> being the most widely used)
	that can be used by many properties are described in this specification,
	while more specific data types (e.g., <<spacing-limit>>)
	are described in the corresponding modules.

<h3 id="placement">
Module Interactions</h3>

	This module replaces and extends the data type definitions in [[!CSS2]]
	sections
	<a href="https://www.w3.org/TR/CSS2/about.html#value-defs">1.4.2.1</a>,
	<a href="https://www.w3.org/TR/CSS2/syndata.html#values">4.3</a>,
	and <a href="https://www.w3.org/TR/CSS2/aural.html#aural-intro">A.2</a>.

<!-- Big Text: syntax

 ███▌  █   ▐▌ █    █▌ █████▌  ███▌  █     █
█▌  █▌ ▐▌  █  █▌   █▌   █▌   ▐█ ▐█   █   █ 
█▌      █ ▐▌  ██▌  █▌   █▌   █▌  █▌   █ █  
 ███▌   ▐▌█   █▌▐█ █▌   █▌   █▌  █▌    █   
    █▌   █▌   █▌  ██▌   █▌   █████▌   █ █  
█▌  █▌   █▌   █▌   █▌   █▌   █▌  █▌  █   █ 
 ███▌    █▌   █▌   ▐▌   █▌   █▌  █▌ █     █
-->

<h2 id="value-defs">
Value Definition Syntax</h2>

	The <dfn for=CSS export lt="value definition syntax | CSS value definition syntax">value definition syntax</dfn> described here
	is used to define the set of valid values for CSS properties
	(and the valid syntax of many other parts of CSS).
	A value so described can have one or more components.

<h3 id="component-types">
Component Value Types</h3>

	Component value types are designated in several ways:

	1. <a href="#keywords">Keyword</a> values (such as <css>auto</css>, ''disc'', etc.),
		which appear literally, without quotes (e.g. <code>auto</code>).

	2. Basic data types,
		which appear between <css>&lt;</css> and <css>></css>
		(e.g., <<length>>, <<percentage>>, etc.).
		For <a>numeric data types</a>,
		this type notation can annotate any range restrictions
		using the [[#numeric-ranges|bracketed range notation]] described below.

	3. Property value ranges,
		which represent the same pattern of values as a property bearing the same name.
		These are written as the property name,
		surrounded by single quotes,
		between <css>&lt;</css> and <css>></css>,
		e.g., <<'border-width'>>, <<'background-attachment'>>, etc.

		These types <em>do not</em> include <a href="#common-keywords">CSS-wide keywords</a> such as ''inherit''.
		Additionally,
		if the property's value grammar
		is a <a lt=# grammar>comma-separated repetition</a>,
		the corresponding type
		does not include the top-level <a lt=# grammar>comma-separated list multiplier</a>.
		(E.g. if a property named <css>pairing</css> is defined as <css>[ <<custom-ident>> <<integer>>? ]#</css>,
		then <css>&lt;\'pairing'></css> is equivalent to <css>[ <<custom-ident>> <<integer>>? ]</css>,
		not <css>[ <<custom-ident>> <<integer>>? ]#</css>.)\

		<details class=note>
			<summary>Why remove the multiplier?</summary>

			The top-level multiplier is ripped out of these value types
			because top-level comma-separated repetitions are mostly used for
			[=coordinating list properties=],
			and when a shorthand combines several such properties,
			it needs the unmultiplied grammar
			so it can construct its <em>own</em> comma-separated repetition.

			Without this special treatment,
			every such longhand would have to be defined
			with an ad-hoc production just for the inner value,
			which makes the grammars harder to understand overall.
		</details>

	4. Functional notations and their arguments.
		These are written as the function's name,
		followed by an empty parentheses pair,
		between <css>&lt;</css> and <css>></css>,
		e.g. <<calc()>>,
		and references the correspondingly-named [=functional notation=].

	5. Other non-terminals.
		These are written as the name of the non-terminal
		between <css>&lt;</css> and <css>></css>,
		as in <<spacing-limit>>.
		Notice the distinction between <<border-width>> and <<'border-width'>>:
		the latter represents the grammar of the 'border-width' property,
		the former requires an explicit expansion elsewhere.
		The definition of a non-terminal is typically located near its first appearance in the specification.

	Some property value definitions also include the slash (/),
	the comma (,),
	and/or parentheses as literals.
	These represent their corresponding tokens.
	Other non-keyword literal characters that may appear in a component value,
	such as “+”,
	must be written enclosed in single quotes.

	<strong><dfn lt="," id='comb-comma' export grammar>Commas</dfn> specified in the grammar are implicitly omissible</strong> in some circumstances,
	when used to separate optional terms in the grammar.
	Within a top-level list in a property or other CSS value,
	or a function's argument list,
	a comma specified in the grammar must be omitted if:

	<ul>
		<li>
			all items preceding the comma have been omitted

		<li>
			all items following the comma have been omitted

		<li>
			multiple commas would be adjacent (ignoring <a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a>/comments),
			due to the items between the commas being omitted.
	</ul>

	<div class='example'>
		For example, if a function can accept three arguments in order,
		but all of them are optional,
		the grammar can be written like:

		<pre class='prod'>
		example( first? , second? , third? )
		</pre>

		Given this grammar,
		writing ''example(first, second, third)'' is valid,
		as is ''example(first, second)'' or ''example(first, third)'' or ''example(second)''.
		However, ''example(first, , third)'' is invalid, as one of those commas are no longer separating two options;
		similarly, ''example(,second)'' and ''example(first,)'' are invalid.
		''example(first second)'' is also invalid,
		as commas are still required to actually separate the options.

		If commas were not implicitly omittable,
		the grammar would have to be much more complicated
		to properly express the ways that the arguments can be omitted,
		greatly obscuring the simplicity of the feature.
	</div>

	All CSS properties also accept the <a href="#common-keywords">CSS-wide keyword values</a>
	as the sole component of their property value.
	For readability these are not listed explicitly in the property value syntax definitions.
	For example, the full value definition of 'border-color'
	under [[CSS-CASCADE-3|CSS Cascading and Inheritance Level 3]]
	is <code>&lt;color>{1,4} | inherit | initial | unset</code>
	(even though it is listed as <code>&lt;color>{1,4}</code>).

	Note: This implies that, in general,
	combining these keywords with other component values in the same declaration
	results in an invalid declaration.
	For example,
	''background: url(corner.png) no-repeat, inherit;'' is invalid.

<h3 id="component-combinators">
Component Value Combinators</h3>

	Component values can be arranged into property values as follows:

	<ul export dfn-type="grammar">
		<li>Juxtaposing components means that
			all of them must occur, in the given order.
		<li>A double ampersand (<dfn id='comb-all'>&&</dfn>) separates two or more components,
			all of which must occur, in any order.
		<li>A double bar (<dfn id='comb-any'>||</dfn>) separates two or more options:
			one or more of them must occur, in any order.
		<li>A bar (<dfn id='comb-one'>|</dfn>) separates two or more alternatives:
			exactly one of them must occur.
		<li>Brackets ([&nbsp;]) are for grouping.
	</ul>

	Juxtaposition is stronger than the double ampersand, the double
	ampersand is stronger than the double bar, and the double bar
	is stronger than the bar. Thus, the following lines are equivalent:

	<pre>
	  a b   |   c ||   d &&   e f
	[ a b ] | [ c || [ d && [ e f ]]]
	</pre>

	For reorderable combinators (||, &&),
	ordering of the grammar does not matter:
	components in the same grouping may be interleaved in any order.
	Thus, the following lines are equivalent:

	<pre>
	a || b || c
	b || a || c
	</pre>

	Note: Combinators are <em>not</em> associative, so grouping is significant.
	For example, ''a || b || c'' and ''a || [ b || c ]'' are distinct grammars:
	the first allows a value like ''b a c'', but the second does not.

<h3 id="component-multipliers">
Component Value Multipliers</h3>

	Every type, keyword, or bracketed group may be followed by one of
	the following modifiers:

	<ul export dfn-type="grammar">
		<li>An asterisk (<dfn id='mult-zero-plus'>*</dfn>)
			indicates that the preceding type, word, or group
			occurs zero or more times.

		<li>A plus (<dfn id='mult-one-plus'>+</dfn>)
			indicates that the preceding type, word, or group
			occurs one or more times.

		<li>A question mark (<dfn id='mult-opt'>?</dfn>)
			indicates that the preceding type, word, or group
			is optional (occurs zero or one times).

		<li>A single number in curly braces (<dfn id='mult-num'>{<var>A</var>}</dfn>)
			indicates that the preceding type, word, or group
			occurs <var>A</var> times.

		<li>A comma-separated pair of numbers in curly braces (<dfn id='mult-num-range'>{<var>A</var>,<var>B</var>}</dfn>)
			indicates that the preceding type, word, or group
			occurs at least <var>A</var> and at most <var>B</var> times.
			The <var>B</var> may be omitted ({<var>A</var>,})
			to indicate that there must be at least <var>A</var> repetitions,
			with no upper bound on the number of repetitions.

		<li>A hash mark (<dfn id='mult-comma'>#</dfn>)
			indicates that the preceding type, word, or group
			occurs one or more times, separated by comma tokens
			(which may optionally be surrounded by <a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a> and/or comments).
			It may optionally be followed by the curly brace forms, above,
			to indicate precisely how many times the repetition occurs,
			like ''&lt;length>#{1,4}''.

		<li>An exclamation point (<dfn id='mult-req'>!</dfn>) after a group
			indicates that the group is required
			and must produce at least one value;
			even if the grammar of the items within the group
			would otherwise allow the entire contents to be omitted,
			at least one component value must not be omitted.
	</ul>

	The <css>+</css> and <css>#</css> multipliers may be stacked as ''+#'';
	similarly, the <css>#</css> and <css>?</css> multipliers may be stacked as ''#?''.
	These stacks each represent the later multiplier
	applied to the result of the earlier multiplier.
	(These same stacks can be represented using grouping,
	but in complex grammars this can push the number of brackets beyond readability.)

	For repeated component values (indicated by <css>*</css>, <css>+</css>, or <css>#</css>),
	[=UAs=] must support at least 20 repetitions of the component.
	If a property value contains more than the supported number of repetitions,
	the declaration must be ignored as if it were invalid.

<h3 id='combinator-multiplier-patterns'>
Combinator and Multiplier Patterns</h3>

	There are a small set of common ways to combine multiple independent <a>component values</a> in particular numbers and orders.
	In particular, it's common to want to express that,
	from a set of component value,
	the author must select zero or more, one or more, or all of them,
	and in either the order specified in the grammar or in any order.

	All of these can be easily expressed using simple patterns of <a href="#component-combinators">combinators</a> and <a href="#component-multipliers">multipliers</a>:

	<table class='data'>
		<thead>
			<tr>
				<th>
				<th>in order
				<th>any order
		<tbody>
			<tr>
				<th>zero or more
				<td><code>A? B? C?</code>
				<td><code>A? || B? || C?</code>

			<tr>
				<th>one or more
				<td><code>[ A? B? C? ]!</code>
				<td><code>A || B || C</code>

			<tr>
				<th>all
				<td><code>A B C </code>
				<td><code>A && B && C</code>
	</table>

	Note that all of the "any order" possibilities are expressed using combinators,
	while the "in order" possibilities are all variants on juxtaposition.

<h3 id="component-whitespace">
Component Values and White Space</h3>

	Unless otherwise specified,
	<a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a> and/or comments may appear before, after, and/or between
	components combined using the above
	<a href="#component-combinators">combinators</a> and
	<a href="#component-multipliers">multipliers</a>.

	Note: In many cases, spaces will in fact be <em>required</em> between components
	in order to distinguish them from each other.
	For example, the value ''1em2em'' would be parsed as a single <<dimension-token>>
	with the number ''1'' and the identifier ''em2em'',
	which is an invalid unit.
	In this case, a space would be required before the ''2''
	to get this parsed as the two lengths ''1em'' and ''2em''.

<h3 id="value-examples">
Property Value Examples</h3>

	Below are some examples of properties with their corresponding value
	definition fields

	<div class=example>
		<table class="data" id="propvalues">
			<thead>
				<tr>
					<th>Property
					<th>Value definition field
					<th>Example value
			</thead>
			<tbody>
				<tr>
					<td>'orphans'
					<td>&lt;integer>
					<td>''3''
				<tr>
					<td>'text-align'
					<td>left | right | center | justify
					<td>''text-align/center''
				<tr>
					<td>'padding-top'
					<td>&lt;length> | &lt;percentage>
					<td>''5%''
				<tr>
					<td>'outline-color'
					<td>&lt;color> | invert
					<td>''#fefefe''
				<tr>
					<td>'text-decoration'
					<td>none | underline || overline || line-through || blink
					<td>''overline underline''
				<tr>
					<td><a property>font-family</a>
					<td>[ &lt;font-family-name> | &lt;generic-font-family> ]#
					<td>''"Gill Sans", Futura, sans-serif''
				<tr>
					<td>'border-width'
					<td>[ &lt;length> | thick | medium | thin ]{1,4}
					<td>''2px medium 4px''
				<tr>
					<td>'box-shadow'
					<td>[ inset? && &lt;length>{2,4} && &lt;color>? ]# | none
					<td>''3px 3px rgba(50%, 50%, 50%, 50%), lemonchiffon 0 0 4px inset''
			</tbody>
		</table>
	</div>

<h2 id="textual-values">
Textual Data Types</h2>

	The <dfn export for=CSS>textual data types</dfn> include
	various keywords and identifiers
	as well as strings (<<string>>) and URLs (<<url>>).

	CSS <dfn export lt="CSS identifier | CSS ident | identifier | ident" for="CSS">identifiers</dfn>,
	generically denoted by <dfn>&lt;ident></dfn>,
	consist of a sequence of characters conforming to the <<ident-token>> grammar. [[!CSS-SYNTAX-3]]
	Identifiers cannot be quoted;
	otherwise they would be interpreted as strings.
	CSS properties accept two classes of [=CSS/identifiers=]:
	[[#keywords|pre-defined keywords]]
	and [[#custom-idents|author-defined identifiers]].

	Note: The <<ident>> production is not meant for property value definitions--
	<<custom-ident>> should be used instead.
	It is provided as a convenience for defining other syntactic constructs.

<!-- Big Text: keywords

█▌  █▌ █████▌ █   ▐▌ █▌    █▌  ███▌  ████▌  ████▌   ███▌ 
█▌ █▌  █▌     ▐▌  █  █▌    █▌ █▌  █▌ █▌  █▌ █▌  █▌ █▌  █▌
█▌█▌   █▌      █ ▐▌  █▌    █▌ █▌  █▌ █▌  █▌ █▌  █▌ █▌    
██     ████    ▐▌█   █▌    █▌ █▌  █▌ ████▌  █▌  █▌  ███▌ 
█▌█▌   █▌       █▌   █▌ ▐  █▌ █▌  █▌ █▌▐█   █▌  █▌     █▌
█▌ █▌  █▌       █▌   █▌ █▌ █▌ █▌  █▌ █▌ ▐█  █▌  █▌ █▌  █▌
█▌  █▌ █████▌   █▌    ██ ▐█▌   ███▌  █▌  █▌ ████▌   ███▌ 
-->

<h3 id="keywords">
Pre-defined Keywords</h3>

	In the value definition fields,
	<dfn lt="keyword" export for=CSS>keywords</dfn> with a pre-defined meaning appear literally.
	Keywords are [=CSS/identifiers=]
	and are interpreted <a lt="ASCII case-insensitive">ASCII case-insensitively</a>
	(i.e., [a-z] and \[A-Z] are equivalent).

	<div class="example">
		For example, here is the value definition for the 'border-collapse'
		property:

		<pre>Value: collapse | separate</pre>

		And here is an example of its use:

		<pre>table { border-collapse: separate }</pre>
	</div>

<h4 id="common-keywords">
CSS-wide keywords: ''initial'', ''inherit'' and ''unset''</h4>

	As defined <a href="#component-types">above</a>,
	all properties accept the <dfn export>CSS-wide keywords</dfn>,
	which represent value computations common to all CSS properties.
	These keywords are normatively defined in
	the <a href="https://www.w3.org/TR/css-cascade/#defaulting-keywords">CSS Cascading and Inheritance Module</a>.

	<wpt>
	css/css-multicol/multicol-inherit-002.xht
	css/css-multicol/multicol-rule-color-inherit-001.xht
	css/css-multicol/multicol-rule-color-inherit-002.xht
	css/CSS2/values/units-008.xht
	</wpt>

	Other CSS specifications can define additional CSS-wide keywords.

	<!-- Make it easier to add CSS-wide keywords by defining a grammar production. -->

<h3 id='custom-idents'>
Author-defined Identifiers: the <<custom-ident>> type</h3>

	Some properties accept arbitrary author-defined identifiers as a component value.
	This generic data type is denoted by <dfn id="identifier-value">&lt;custom-ident></dfn>,
	and represents any valid [=CSS identifier=]
	that would not be misinterpreted as a pre-defined keyword in that property's value definition.
	Such identifiers are fully case-sensitive,
	even in the ASCII range
	(e.g. ''example'' and ''EXAMPLE'' are two different, unrelated user-defined identifiers).

	The <a>CSS-wide keywords</a> are not valid <<custom-ident>>s.
	The <css>default</css> keyword is reserved
	and is also not a valid <<custom-ident>>.
	Specifications using <<custom-ident>> must specify clearly
	what other keywords are excluded from <<custom-ident>>, if any--
	for example by saying that any pre-defined keywords in that property's value definition are excluded.
	Excluded keywords are excluded in all <a lt="ASCII case-insensitive">ASCII case permutations</a>.

	When parsing positionally-ambiguous keywords in a property value,
	a <<custom-ident>> production can only claim the keyword if no other unfulfilled production can claim it.

	<div class="example">
		For example, the shorthand declaration ''animation: ease-in ease-out''
		is equivalent to the longhand declarations
		''animation-timing-function: ease-in; animation-name: ease-out;''.
		''ease-in'' is claimed by the <<easing-function>> production belonging to 'animation-timing-function',
		leaving ''ease-out'' to be claimed by the <<custom-ident>> production belonging to 'animation-name'.
	</div>

	Note: When designing grammars with <<custom-ident>>,
	the <<custom-ident>> should always be “positionally unambiguous”,
	so that it's impossible to conflict with any keyword values in the property.

<!-- Big Text: string

 ███▌  █████▌ ████▌  ████ █    █▌  ███▌ 
█▌  █▌   █▌   █▌  █▌  ▐▌  █▌   █▌ █▌  █▌
█▌       █▌   █▌  █▌  ▐▌  ██▌  █▌ █▌    
 ███▌    █▌   ████▌   ▐▌  █▌▐█ █▌ █▌ ██▌
    █▌   █▌   █▌▐█    ▐▌  █▌  ██▌ █▌  █▌
█▌  █▌   █▌   █▌ ▐█   ▐▌  █▌   █▌ █▌  █▌
 ███▌    █▌   █▌  █▌ ████ █▌   ▐▌  ███▌ 
-->

<h3 id="strings">
Quoted Strings: the <<string>> type</h3>

	[=Strings=] are denoted by <dfn id="string-value">&lt;string></dfn>.
	When written literally,
	they consist of a sequence of characters delimited by double quotes or single quotes,
	corresponding to the <<string-token>> production
	in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS-SYNTAX-3]].

	<div class=example>
		Double quotes cannot occur inside double quotes, unless
		<a href="https://www.w3.org/TR/CSS2/syndata.html#escaped-characters">escaped</a>
		(as <code>"\""</code> or as <code>"\22"</code>).
		Analogously for single quotes (<code>&#39;\&#39;&#39;</code> or <code>&#39;\27&#39;</code>).

		<pre>
		content: "this is a &#39;string&#39;.";
		content: "this is a \"string\".";
		content: &#39;this is a "string".&#39;;
		content: &#39;this is a \&#39;string\&#39;.&#39;
		</pre>
	</div>

	It is possible to break strings over several lines, for aesthetic or
	other reasons, but in such a case the newline itself has to be escaped
	with a backslash (\). The newline is subsequently removed from the
	string. For instance, the following two selectors are exactly the
	same:

	<div class="example">
		<p style="display:none">Example(s):
		<pre>
		a[title="a not s\
		o very long title"] {/*...*/}
		a[title="a not so very long title"] {/*...*/}
		</pre>
	</div>

	Since a string cannot directly represent a newline, to include a
	newline in a string, use the escape "\A". (Hexadecimal A is the line
	feed character in Unicode (U+000A), but represents the generic notion
	of "newline" in CSS.)

<!-- Big Text: url

█▌  █▌ ████▌  █▌   
█▌  █▌ █▌  █▌ █▌   
█▌  █▌ █▌  █▌ █▌   
█▌  █▌ ████▌  █▌   
█▌  █▌ █▌▐█   █▌   
█▌  █▌ █▌ ▐█  █▌   
 ███▌  █▌  █▌ █████
-->

<h3 id="urls">
Resource Locators: the <<url>> type</h3>

	The <dfn>url()</dfn> <a>functional notation</a>,
	denoted by <<url>>,
	represents a <dfn noexport>URL</dfn>,
	which is a pointer to a resource.
	The typical syntax of a <<url>> is:

	<pre class="prod">
		<dfn id="url-value">&lt;url></dfn> = url( <<string>> <<url-modifier>>* )
	</pre>

	<div class="example">
		This example shows a URL being used as a background image:

		<pre highlight=css>
		body { background: url("http://www.example.com/pinkish.gif") }
		</pre>
	</div>

	A ''url()'' can alternatively be written be written without quotation marks around the URL value,
	in which case it is <a lt="consume a url token" spec=css-syntax-3>specially-parsed</a>
	as a <<url-token>>; see [[css-syntax-3#consume-url-token]]. [[!CSS-SYNTAX-3]]

	<div class="example">
		For example, the following declarations are identical:

		<pre>
			background: url("http://www.example.com/pinkish.gif");
			background: url(http://www.example.com/pinkish.gif);
		</pre>
	</div>

	Note: The unquoted ''url()'' syntax cannot accept a <<url-modifier>> argument
	and has extra escaping requirements:
	parentheses, <a href="https://www.w3.org/TR/css-syntax/#whitespace">whitespace</a> characters,
	single quotes (&#39;) and double quotes (") appearing in a URL
	must be escaped with a backslash,
	e.g. ''url(open\(parens)'', ''url(close\)parens)''.
	(In quoted <<string>> ''url()''s,
	only newlines and the character used to quote the string need to be escaped.)
	Depending on the type of URL,
	it might also be possible to write these characters as URL-escapes
	(e.g. ''url(open%28parens)'' or ''url(close%29parens)'')
	as described in [[URL]].

	Some CSS contexts (such as ''@import'') also allow a <<url>>
	to be represented by a bare <<string>>, without the function wrapper.
	In such cases the string behaves identically to a ''url()'' function containing that string.

	<div class="example">
		For example, the following statements act identically:
		<pre>
			@import url("base-theme.css");
			@import "base-theme.css";
		</pre>
	</div>

<h4 id="relative-urls">
Relative URLs</h4>

	In order to create modular style sheets that are not dependent on
	the absolute location of a resource, authors should use relative URLs.
	Relative URLs (as defined in [[!URL]]) are resolved to full URLs
	using a base URL. RFC&nbsp;3986, section&nbsp;3, defines the normative
	algorithm for this process.
	For CSS style sheets, the base URL is that of the style sheet itself,
	not that of the styled source document.
	Style sheets embedded within a document have
	the base URL associated with their container.

	Note: For HTML documents,
	the <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dynamic-changes-to-base-urls">base URL is mutable</a>.

	When a <<url>> appears in the computed value of a property,
	it is resolved to an absolute URL,
	as described in the preceding paragraph.
	The computed value of a URL that the [=UA=] cannot resolve to an absolute URL is the specified value.

	<div class="example">
		For example, suppose the following rule:

		<pre>body { background: url("tile.png") }</pre>

		is located in a style sheet designated by the URL:

		<pre>http://www.example.org/style/basic.css</pre>

		The background of the source document's <code>&lt;body></code>
		will be tiled with whatever image is described by the resource designated by the URL:

		<pre>http://www.example.org/style/tile.png</pre>

		The same image will be used regardless of the URL of the source document containing the <code>&lt;body></code>.
	</div>

<h5 id='local-urls'>
Fragment URLs</h5>

	To work around some common eccentricities in browser URL handling,
	CSS has special behavior for fragment-only urls.

	If a ''url()''’s value starts with a U+0023 NUMBER SIGN (<code>#</code>) character,
	parse it as per normal for URLs,
	but additionally set the <dfn export for="url()">local url flag</dfn> of the ''url()''.

	When matching a ''url()'' with the <a>local url flag</a> set,
	ignore everything but the URL's fragment,
	and resolve that fragment against the current document that relative URLs are resolved against.
	This reference must always be treated as same-document
	(rather than cross-document).

	When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a>
	a ''url()'' with the <a>local url flag</a> set,
	it must serialize as just the fragment.

	<details class=note>
		<summary>What “browser eccentricities”?</summary>

		Theoretically, browsers should re-resolve any relative URLs,
		including fragment-only URLs,
		whenever the document's base URL changes
		(such as through mutation of the <{base}> element,
		or calling {{History/pushState()}}).
		In many cases they don't, however,
		and so without special handling,
		fragment-only URLs will suddenly become cross-document references
		(pointing at the previous base URL)
		and break in many of the places they're used.

		Since fragment-only URLs express a clear semantic
		of wanting to refer to the current document
		regardless of what its current URL is,
		this hack preserves the expected behavior at least in these cases.
	</details>

<h4 id="url-empty">
Empty URLs</h4>

	If the value of the <<url>> is the empty string
	(like ''url("")'' or ''url()''),
	the url must resolve to an invalid resource
	(similar to what the url ''about:invalid'' does).

	Its computed value is ''url("")'',
	and it must serialize as such.

	<wpt>
	css/css-values/urls/empty.html
	</wpt>

	Note: This matches the behavior of empty urls for embedded resources elsewhere in the web platform,
	and avoids excess traffic re-requesting the stylesheet or host document
	due to editing mistakes leaving the ''url()'' value empty,
	which are almost certain to be invalid resources for whatever the ''url()'' shows up in.
	Linking on the web platform <em>does</em> allow empty urls,
	so if/when CSS gains some functionality to control hyperlinks,
	this restriction can be relaxed in those contexts.

<h4 id='url-modifiers'>
URL Modifiers</h4>

	The ''url()'' function supports specifying additional <dfn>&lt;url-modifier></dfn>s,
	which change the meaning or the interpretation of the URL somehow.
	A <<url-modifier>> is either an <<ident>> or a <a>functional notation</a>.

	This specification does not define any <<url-modifier>>s,
	but other specs may do so.

	Note: A <<url>> that is either unquoted or not wrapped in ''url()'' notation
	cannot accept any <<url-modifier>>s.

<h2 id="numeric-types">
Numeric Data Types</h2>

	Numeric data types are used to represent
	quantities, indexes, positions, and other such values.
	Although many syntactic variations can exist
	in expressing the quantity (numeric aspect) in a given numeric value,
	the <a lt="specified value">specified</a> and <a>computed value</a>
	do not distinguish these variations:
	they represent the value’s abstract quantity,
	not its syntactic representation.

	The <dfn>numeric data types</dfn> include
	<<integer>>,
	<<number>>,
	<<percentage>>,
	and various <a>dimensions</a>
	including <<length>>, <<angle>>, <<time>>, <<frequency>>, and <<resolution>>.

	Note: While general-purpose <a>dimensions</a> are defined here,
	some other modules define additional data types
	(e.g. [[css-grid-1]] introduces ''fr'' units)
	whose usage is more localized.

<h3 id="numeric-ranges">
Range Restrictions and Range Definition Notation</h3>

	Properties can restrict numeric values to some range.
	If the value is outside the allowed range,
	then unless otherwise specified,
	the declaration is invalid and must be <a href="https://www.w3.org/TR/CSS2/conform.html#ignore">ignored</a>.
	Range restrictions can be annotated in the numeric type notation
	using <dfn export local-lt="bracketed range notation">CSS bracketed range notation</dfn>--
	<code>[<var>min</var>,<var>max</var>]</code>--
	within the angle brackets, after the identifying keyword,
	indicating a closed range
	between (and including) <var>min</var> and <var>max</var>.
	For example, <<integer [0,10]>> indicates an integer between ''0'' and ''10'', inclusive,
	while <<angle [0, 180deg]>> indicates an angle between ''0deg'' and ''180deg''
	(expressed in any unit).

	Note: CSS values generally do not allow open ranges;
	thus only square-bracket notation is used.

	CSS theoretically supports infinite precision and infinite ranges for all value types;
	however in reality implementations have finite capacity.
	[=UAs=] should support reasonably useful ranges and precisions.
	Range extremes that are ideally unlimited
	are indicated using ∞ or &minus;∞ as appropriate.
	For example, <<length [0, ∞]>> indicates a non-negative length.

	If no range is indicated,
	either by using the <a>bracketed range notation</a>
	or in the property description,
	then <code>[&minus;∞,∞]</code> is assumed.

	Values of &minus;∞ or ∞ must be written without units,
	even if the value type uses units.
	Values of ''0'' <em>can</em> be written without units,
	even if the value type doesn't allow “unitless zeroes”
	(such as <<time>>).

	Note: At the time of writing,
	the <a>bracketed range notation</a> is new;
	thus in most CSS specifications
	any range limitations are described only in prose.
	(For example, “Negative values are not allowed” or
	“Negative values are invalid”
	indicate a <code>[0,∞]</code> range.)
	This does not make them any less binding.

<!--
	The recommended minimum ranges and precision,
	and the required rounding and clamping rules,
	are given in <a href="#required-ranges">Appendix A</a>.
-->

<!-- Big Text: integer

████ █    █▌ █████▌ █████▌  ███▌  █████▌ ████▌ 
 ▐▌  █▌   █▌   █▌   █▌     █▌  █▌ █▌     █▌  █▌
 ▐▌  ██▌  █▌   █▌   █▌     █▌     █▌     █▌  █▌
 ▐▌  █▌▐█ █▌   █▌   ████   █▌ ██▌ ████   ████▌ 
 ▐▌  █▌  ██▌   █▌   █▌     █▌  █▌ █▌     █▌▐█  
 ▐▌  █▌   █▌   █▌   █▌     █▌  █▌ █▌     █▌ ▐█ 
████ █▌   ▐▌   █▌   █████▌  ███▌  █████▌ █▌  █▌
-->

<h3 id="integers">
Integers: the <<integer>> type</h3>

	Integer values are denoted by <dfn id="integer-value">&lt;integer></dfn>.

	When written literally,
	an <dfn export>integer</dfn> is one or more decimal digits ''0'' through ''9''
	and corresponds to a subset of the <<number-token>> production
	in the CSS Syntax Module [[!CSS-SYNTAX-3]].
	The first digit of an integer may be immediately preceded by <css>-</css> or <css>+</css>
	to indicate the integer's sign.

	<wpt>
	css/css-multicol/multicol-count-non-integer-001.xht
	css/css-multicol/multicol-count-non-integer-002.xht
	css/css-multicol/multicol-count-non-integer-003.xht
	css/CSS2/values/numbers-units-001.xht
	css/CSS2/values/numbers-units-004.xht
	</wpt>

<!-- Big Text: number

█    █▌ █▌  █▌ █     █ ████▌  █████▌ ████▌ 
█▌   █▌ █▌  █▌ ██   ██ █▌  █▌ █▌     █▌  █▌
██▌  █▌ █▌  █▌ █▌█ █▐█ █▌  █▌ █▌     █▌  █▌
█▌▐█ █▌ █▌  █▌ █▌ █ ▐█ █████  ████   ████▌ 
█▌  ██▌ █▌  █▌ █▌   ▐█ █▌  █▌ █▌     █▌▐█  
█▌   █▌ █▌  █▌ █▌   ▐█ █▌  █▌ █▌     █▌ ▐█ 
█▌   ▐▌  ███▌  █▌   ▐█ ████▌  █████▌ █▌  █▌
-->

<h3 id="numbers">
Real Numbers: the <<number>> type</h3>

	Number values are denoted by <dfn id="number-value">&lt;number></dfn>,
	and represent real numbers, possibly with a fractional component.

	<wpt>
	css/css-animations/animation-iteration-count-calc.html
	css/CSS2/values/numbers-units-003.xht
	</wpt>

	When written literally,
	a <dfn export>number</dfn> is either an <a>integer</a>,
	or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits;
	optionally, it can be concluded by the letter “e” or “E”
	followed by an integer indicating the base-ten exponent
	in <a href="https://en.wikipedia.org/wiki/Scientific_notation">scientific notation</a>.
	It corresponds to the <<number-token>> production
	in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS-SYNTAX-3]].
	As with integers, the first character of a number
	may be immediately preceded by <css>-</css> or <css>+</css>
	to indicate the number's sign.

<h3 id='dimensions'>
Numbers with Units: <a>dimension</a> values</h3>

	The general term <dfn export>dimension</dfn> refers to
	a number with a unit attached to it;
	and is denoted by <dfn>&lt;dimension></dfn>.

	When written literally,
	a <a>dimension</a> is a <a>number</a>
	immediately followed by a unit identifier,
	which is an [=CSS/identifier=].
	It corresponds to the <<dimension-token>> production
	in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS-SYNTAX-3]].
	Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.

	<wpt>
	css/css-values/angle-units-003.html
	</wpt>

	CSS uses <<dimension>>s to specify
	distances (<<length>>),
	durations (<<time>>),
	frequencies (<<frequency>>),
	resolutions (<<resolution>>),
	and other quantities.

<h4 id="compat">
Compatible Units</h4>

	When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a> <a>computed values</a> [[!CSSOM]],
	<dfn export local-lt=compatible>compatible units</dfn>
	(those related by a static multiplicative factor,
	like the 96:1 factor between ''px'' and ''in'',
	or the computed 'font-size' factor between ''em'' and ''px'')
	are converted into a single <dfn export local-lt=canonical>canonical unit</dfn>.
	Each group of compatible units defines which among them is the <a>canonical unit</a>
	that will be used for serialization.

	When serializing <a href="https://www.w3.org/TR/cssom-1/#resolved-values">resolved values</a>
	that are <a>used values</a>,
	all value types (percentages, numbers, keywords, etc.)
	that represent lengths are considered <a>compatible</a> with lengths.
	Likewise any future API that returns <a>used values</a>
	must consider any values that represent distances/durations/frequencies/etc.
	as <a>compatible</a> with the relevant class of <a>dimensions</a>,
	and canonicalize accordingly.

	<wpt>
	css/css-values/calc-serialization-002.html
	</wpt>

<!-- Big Text: %

▐█▌  █  
█ █ ▐▌  
▐█▌ █   
   ▐▌   
   █ ▐█▌
  ▐▌ █ █
  █  ▐█▌
-->

<h3 id="percentages">
Percentages: the <<percentage>> type</h3>

	Percentage values are denoted by <dfn id="percentage-value">&lt;percentage></dfn>,
	and indicates a value that is some fraction of another reference value.

	When written literally,
	a <dfn export>percentage</dfn> consists of a <a>number</a>
	immediately followed by a percent sign <css>%</css>.
	It corresponds to the <<percentage-token>> production
	in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS-SYNTAX-3]].

	Percentage values are always relative to another quantity,
	for example a length.
	Each property that allows percentages also defines the quantity to which the percentage refers.
	This quantity can be a value of another property for the same element,
	the value of a property for an ancestor element,
	a measurement of the formatting context
	(e.g., the width of a <a>containing block</a>),
	or something else.

	<wpt>
	css/CSS2/values/numbers-units-016.xht
	css/CSS2/values/numbers-units-017.xht
	</wpt>

<h3 id="mixed-percentages">
Mixing Percentages and Dimensions</h3>

	In cases where a <<percentage>> can represent the same quantity
	as a <a>dimension</a> in the same <a>component value</a> position,
	and can therefore be combined with them in a ''calc()'' expression,
	the following convenience notations may be used in the property grammar:

	: <dfn>&lt;length-percentage></dfn>
	:: Equivalent to <code class=prod>[ <<length>> | <<percentage>> ]</code>,
		where the <<percentage>> will resolve to a <<length>>.
	: <dfn>&lt;frequency-percentage></dfn>
	:: Equivalent to <code class=prod>[ <<frequency>> | <<percentage>> ]</code>,
		where the <<percentage>> will resolve to a <<frequency>>.
	: <dfn>&lt;angle-percentage></dfn>
	:: Equivalent to <code class=prod>[ <<angle>> | <<percentage>> ]</code>,
		where the <<percentage>> will resolve to an <<angle>>.
	: <dfn>&lt;time-percentage></dfn>
	:: Equivalent to <code class=prod>[ <<time>> | <<percentage>> ]</code>,
		where the <<percentage>> will resolve to a <<time>>.

	<div class="example">
		For example, the 'width' property can accept a <<length>> or a <<percentage>>,
		both representing a measure of distance.
		This means that ''width: calc(500px + 50%);'' is allowed--
		both values are converted to absolute lengths and added.
		If the containing block is ''1000px'' wide,
		then ''width: 50%;'' is equivalent to ''width: 500px'',
		and ''width: calc(50% + 500px)'' thus ends up equivalent to ''width: calc(500px + 500px)'' or ''width: 1000px''.

		On the other hand, the second and third arguments of the ''hsl()'' function
		can only be expressed as <<percentage>>s.
		Although ''calc()'' productions are allowed in their place,
		they can only combine percentages with themselves,
		as in ''calc(10% + 20%)''.
	</div>

	Note: Specifications should never alternate <<percentage>> in place of a dimension
	in a grammar unless they are <a>compatible</a>.

	Note: More &lt;<var ignore>type</var>-percentage> productions can be added in the future as needed.
	A &lt;number-percentage> will never be added,
	as <<number>> and <<percentage>> can't be combined in ''calc()''.

<!-- Big Text: length

█▌    █████▌ █    █▌  ███▌  █████▌ █▌  █▌
█▌    █▌     █▌   █▌ █▌  █▌   █▌   █▌  █▌
█▌    █▌     ██▌  █▌ █▌       █▌   █▌  █▌
█▌    ████   █▌▐█ █▌ █▌ ██▌   █▌   █████▌
█▌    █▌     █▌  ██▌ █▌  █▌   █▌   █▌  █▌
█▌    █▌     █▌   █▌ █▌  █▌   █▌   █▌  █▌
█████ █████▌ █▌   ▐▌  ███▌    █▌   █▌  █▌
-->

<h2 id="lengths">
Distance Units: the <<length>> type</h2>

	Lengths refer to distance measurements
	and are denoted by <dfn id="length-value">&lt;length></dfn> in the property definitions.
	A length is a <a>dimension</a>.

	For zero lengths the unit identifier is optional
	(i.e. can be syntactically represented as the <<number>> ''0'').
	However, if a ''0'' could be parsed as either a <<number>> or a <<length>> in a property
	(such as 'line-height'),
	it must parse as a <<number>>.

	Properties may restrict the length value to some range.
	If the value is outside the allowed range,
	the declaration is invalid and must be <a href="https://www.w3.org/TR/CSS2/conform.html#ignore">ignored</a>.

	<wpt>
	css/mediaqueries/min-width-001.xht
	css/CSS2/values/numbers-units-005.xht
	css/CSS2/values/numbers-units-006.xht
	</wpt>

	While some properties allow negative length values,
	this may complicate the formatting and there may be implementation-specific limits.
	If a negative length value is allowed but cannot be supported,
	it must be converted to the nearest value that can be supported.

	In cases where the <a lt="used value">used</a> length cannot be supported,
	user agents must approximate it in the <a lt="actual value">actual</a> value.

	There are two types of length units:
	[=relative length|relative=] and [=absolute length|absolute=].

	<wpt>
	css/css-values/calc-unit-analysis.html
	css/css-shapes/shape-outside/values/shape-outside-circle-002.html
	css/css-shapes/shape-outside/values/shape-outside-circle-004.html
	css/css-shapes/shape-outside/values/shape-outside-ellipse-002.html
	css/css-shapes/shape-outside/values/shape-outside-ellipse-004.html
	css/css-shapes/shape-outside/values/shape-outside-inset-003.html
	css/css-shapes/shape-outside/values/shape-outside-polygon-004.html
	</wpt>

<h3 id="relative-lengths">
Relative Lengths</h3>

	<dfn lt="relative length | relative length unit">Relative length units</dfn>
	specify a length relative to another length.
	Style sheets that use relative units can more easily scale from one output environment to another.

	The relative units are:

	<table class="data">
	<caption>Informative Summary of Relative Units</caption>
	<thead>
		<tr><th>unit<th>relative to
	</thead>
	<tbody>
		<tr><td>''em''
			<td>font size of the element
		<tr><td>''ex''
			<td>x-height of the element's font
		<tr><td>''ch''
			<td><a lt="advance measure">character advance</a> of the “0” (ZERO, U+0030) glyph in the element's font
		<tr><td>''rem''
			<td>font size of the root element
		<tr><td>''vw''
			<td>1% of viewport's width
		<tr><td>''vh''
			<td>1% of viewport's height
		<tr><td>''vmin''
			<td>1% of viewport's smaller dimension
		<tr><td>''vmax''
			<td>1% of viewport's larger dimension
	</tbody>
	</table>

	Child elements do not inherit the relative values as specified for their parent;
	they inherit the <a>computed values</a>.

<!-- Big Text: em/etc

█████▌ █     █    █ █████▌ █████▌  ███▌ 
█▌     ██   ██   ▐▌ █▌       █▌   █▌  █▌
█▌     █▌█ █▐█   █  █▌       █▌   █▌    
████   █▌ █ ▐█  ▐▌  ████     █▌   █▌    
█▌     █▌   ▐█  █   █▌       █▌   █▌    
█▌     █▌   ▐█ ▐▌   █▌       █▌   █▌  █▌
█████▌ █▌   ▐█ █    █████▌   █▌    ███▌ 
-->

<h4 id="font-relative-lengths">
Font-relative Lengths: the ''em'', ''ex'', ''ch'', ''rem'' units</h4>

	The <dfn export id="font-relative-length">font-relative lengths</dfn>
	refer to the font metrics of the element on which they are used--
	or, in the case of ''rem'', the metrics of the root element.

	<dl export dfn-type=value dfn-for="<length>">
		<dt><dfn id="em" lt="em | em unit">em</dfn>
		<dd>
			Equal to the computed value of the 'font-size' property of the element on which it is used.

			<div class="example">
				The rule:

				<pre>h1 { line-height: 1.2em }</pre>

				means that the line height of <code>h1</code> elements
				will be 20% greater than the font size of <code>h1</code> element.
				On the other hand:

				<pre>h1 { font-size: 1.2em }</pre>

				means that the font size of <code>h1</code> elements
				will be 20% greater than the computed font size inherited by <code>h1</code> elements.
			</div>

		<dt><dfn id="rem" lt="rem | rem unit" caniuse="rem">rem</dfn>
		<dd>
			Equal to the computed value of the ''em'' unit on the root element.

			<wpt>
			css/css-values/calc-rem-lang.html
			</wpt>

		<dt><dfn id="ex" lt="ex | ex unit">ex unit</dfn>
		<dd>
			Equal to the used x-height of the <a href="https://www.w3.org/TR/css3-fonts/#first-available-font">first available font</a> [[!CSS3-FONTS]].
			The x-height is so called because it is often equal to the height of the lowercase "x".
			However, an ''ex'' is defined even for fonts that do not contain an "x".
			The x-height of a font can be found in different ways.
			Some fonts contain reliable metrics for the x-height.
			If reliable font metrics are not available,
			[=UAs=] may determine the x-height from the height of a lowercase glyph.
			One possible heuristic is to look at
			how far the glyph for the lowercase "o" extends below the baseline,
			and subtract that value from the top of its bounding box.
			In the cases where it is impossible or impractical to determine the x-height,
			a value of 0.5em must be assumed.

			<wpt>
			css/css-values/ex-unit-001.html
			css/css-values/ex-unit-002.html
			css/css-values/ex-unit-003.html
			css/CSS2/values/numbers-units-007.xht
			css/CSS2/values/numbers-units-009.xht
			css/CSS2/values/numbers-units-010.xht
			css/CSS2/values/numbers-units-011.xht
			css/CSS2/values/numbers-units-012.xht
			css/CSS2/values/numbers-units-013.xht
			css/CSS2/values/numbers-units-015.xht
			css/CSS2/values/numbers-units-019.xht
			css/CSS2/values/units-001.xht
			css/CSS2/values/units-002.xht
			css/CSS2/values/units-003.xht
			css/CSS2/values/units-004.xht
			css/CSS2/values/units-005.xht
			css/css-values/calc-ch-ex-lang.html
			</wpt>

		<dt><dfn id="ch" lt="ch | ch unit">ch unit</dfn>
		<dd>
			Represents the typical <a>advance measure</a> of European alphanumeric characters,
			and measured as the used <a>advance measure</a> of the “0” (ZERO, U+0030) glyph
			in the font used to render it.
			(The <dfn dfn>advance measure</dfn> of a glyph is its advance width or height,
			whichever is in the inline axis of the element.)

			Note: This measurement is an approximation
			(and in monospace fonts, an exact measure)
			of a single narrow glyph’s <a>advance measure</a>,
			thus allowing measurements based on an expected glyph count.

			Note: The advance measure of a glyph depends on writing-mode and text-orientation
			as well as font settings, text-transform, and any other properties that affect glyph selection or orientation.

			In the cases where it is impossible or impractical to determine the measure of the “0” glyph,
			it must be assumed to be 0.5em wide by 1em tall.
			Thus, the ''ch'' unit falls back to ''0.5em'' in the general case,
			and to ''1em'' when it would be typeset upright
			(i.e. 'writing-mode' is ''vertical-rl'' or ''vertical-lr''
			and 'text-orientation' is ''text-orientation/upright'').

			<wpt>
			css/css-values/ch-unit-001.html
			css/css-values/ch-unit-002.html
			css/css-values/ch-unit-003.html
			css/css-values/ch-unit-004.html
			css/css-values/ch-unit-008.html
			css/css-values/ch-unit-009.html
			css/css-values/ch-unit-010.html
			css/css-values/ch-unit-011.html
			css/css-values/ch-unit-012.html
			css/css-values/ch-unit-016.html
			css/css-values/ch-unit-017.html
			css/css-values/line-break-ch-unit.html
			css/css-values/calc-ch-ex-lang.html
			</wpt>
	</dl>

	When used outside the context of an element
	(such as in <a>media queries</a>),
	these units refer to the computed font metrics corresponding to the initial values of the 'font' property.
	When used in the value of the 'font-size' property on the element they refer to,
	these units refer to the computed font metrics of the parent element
	(or the computed font metrics corresponding to the initial values of the 'font' property,
	if the element has no parent).

	The [=font-relative lengths=] are calculated in the absence of shaping.

<!-- Big Text: vw/etc

█▌   █▌ █▌    █▌    █ █████▌ █████▌  ███▌ 
█▌   █▌ █▌    █▌   ▐▌ █▌       █▌   █▌  █▌
█▌   █▌ █▌    █▌   █  █▌       █▌   █▌    
▐▌   █  █▌    █▌  ▐▌  ████     █▌   █▌    
 █  ▐▌  █▌ ▐  █▌  █   █▌       █▌   █▌    
 ▐▌ █   █▌ █▌ █▌ ▐▌   █▌       █▌   █▌  █▌
  ▐█     ██ ▐█▌  █    █████▌   █▌    ███▌ 
-->

<h4 id="viewport-relative-lengths">
Viewport-percentage Lengths: the ''vw'', ''vh'', ''vmin'', ''vmax'' units</h4>

	The <dfn export>viewport-percentage lengths</dfn> are relative to the size of the
	<a href="https://www.w3.org/TR/CSS2/visudet.html#containing-block-details">initial containing block</a>--
	which is itself based on the size of either
	the viewport (for [=continuous media=])
	or the [=page area=] (for [=paged media=]).
	When the height or width of the initial containing block is changed,
	they are scaled accordingly.
	However, any scrollbars are assumed not to exist.

	For [=paged media=], the exact definition of the viewport-percentage lengths
	is deferred to [[!CSS3PAGE]].

	<dl export dfn-type=value dfn-for="<length>">
		<dt><dfn id="vw" lt="vw">vw unit</dfn>
		<dd>
			Equal to 1% of the width of the initial containing block.

			<div class="example">
				In the example below, if the width of the viewport is 200mm,
				the font size of <code>h1</code> elements will be 16mm
				(i.e. (8×200mm)/100).

				<pre>h1 { font-size: 8vw }</pre>
			</div>

		<dt><dfn id="vh" lt="vh">vh unit</dfn>
		<dd>
			Equal to 1% of the height of the initial containing block.

		<dt><dfn id="vmin" lt="vmin">vmin unit</dfn>
		<dd>
			Equal to the smaller of ''vw'' or ''vh''.

		<dt><dfn id="vmax" lt="vmax">vmax unit</dfn>
		<dd>
			Equal to the larger of ''vw'' or ''vh''.
	</dl>

	<wpt>
	css/css-values/vh-calc-support-pct.html
	css/css-values/vh-calc-support.html
	css/css-values/vh-em-inherit.html
	css/css-values/vh-inherit.html
	css/css-values/vh-interpolate-pct.html
	css/css-values/vh-interpolate-px.html
	css/css-values/vh-interpolate-vh.html
	css/css-values/vh-support.html
	css/css-values/vh-support-margin.html
	css/css-values/vh-support-transform-origin.html
	css/css-values/vh-support-transform-translate.html
	css/css-values/vh-zero-support.html
	css/css-values/viewport-relative-lengths-scaled-viewport.html
	css/css-values/viewport-unit-011.html
	css/css-values/viewport-units-css2-001.html
	</wpt>

<!-- Big Text: px/etc

████▌  █     █    █ █████▌ █████▌  ███▌ 
█▌  █▌  █   █    ▐▌ █▌       █▌   █▌  █▌
█▌  █▌   █ █     █  █▌       █▌   █▌    
████▌     █     ▐▌  ████     █▌   █▌    
█▌       █ █    █   █▌       █▌   █▌    
█▌      █   █  ▐▌   █▌       █▌   █▌  █▌
█▌     █     █ █    █████▌   █▌    ███▌ 
-->

<h3 id="absolute-lengths">
Absolute Lengths: the ''cm'', ''mm'', ''Q'', ''in'', ''pt'', ''pc'', ''px'' units</h3>

	The <dfn lt="absolute length | absolute length unit">absolute length units</dfn>
	are fixed in relation to each other
	and [=anchored=] to some physical measurement.
	They are mainly useful when the output environment is known.
	The absolute units consist of
	the <dfn export lt="physical unit">physical units</dfn> (''in'', ''cm'', ''mm'', ''pt'', ''pc'', ''Q'')
	and the <dfn export lt="visual angle unit | pixel unit">visual angle unit (pixel unit)</dfn> (''px''):

	<table class="data" export>
	<thead>
		<tr>
			<th>unit
			<th>name
			<th>equivalence
	<tbody dfn-type=value dfn-for="<length>">
		<tr>
			<th><dfn id="cm">cm</dfn>
			<td>centimeters
			<td>1cm = 96px/2.54
		<tr>
			<th><dfn id="mm">mm</dfn>
			<td>millimeters
			<td>1mm = 1/10th of 1cm
		<tr>
			<th><dfn id="Q">Q</dfn>
			<td>quarter-millimeters
			<td>1Q = 1/40th of 1cm
		<tr>
			<th><dfn id="in">in</dfn>
			<td>inches
			<td>1in = 2.54cm = 96px
		<tr>
			<th><dfn id="pc">pc</dfn>
			<td>picas
			<td>1pc = 1/6th of 1in
		<tr>
			<th><dfn id="pt">pt</dfn>
			<td>points
			<td>1pt = 1/72nd of 1in
		<tr>
			<th><dfn id="px" lt="px">px</dfn>
			<td>pixels
			<td>1px = 1/96th of 1in
	</table>

	<div class="example">
		<pre>
		h1 { margin: 0.5in }      /* inches  */
		h2 { line-height: 3cm }   /* centimeters */
		h3 { word-spacing: 4mm }  /* millimeters */
		h3 { letter-spacing: 1Q } /* quarter-millimeters */
		h4 { font-size: 12pt }    /* points */
		h4 { font-size: 1pc }     /* picas */
		p  { font-size: 12px }    /* px */
		</pre>
	</div>

	Note: Lengths in publishing contexts
	are sometimes written like <code>2p3</code>,
	indicating a length of 2 picas and 3 points.
	These can be written in CSS as ''calc(2pc + 3pt)''
	(see [[#calc-func]]).

	All of the absolute length units are <a>compatible</a>,
	and ''px'' is their <a>canonical unit</a>.

	For a CSS device, these dimensions are <dfn lt="anchor unit | anchor">anchored</dfn> either

	<ol type=i>
		<li>by relating the <a>physical units</a> to their physical measurements, or
		<li>by relating the <a>pixel unit</a> to the <a>reference pixel</a>.
	</ol>

	For print media at typical viewing distances,
	the [=anchor unit=] should be one of the [=physical units=] (inches, centimeters, etc).
	For screen media (including high-resolution devices),
	low-resolution devices,
	and devices with unusual viewing distances,
	it is recommended instead that the [=anchor unit=] be the [=pixel unit=].
	For such devices it is recommended that the [=pixel unit=]
	refer to the whole number of [=device pixels=] that best approximates the reference pixel.

	Note: If the [=anchor unit=] is the [=pixel unit=],
	the [=physical units=] might not match their physical measurements.
	Alternatively if the [=anchor unit=] is a [=physical unit=],
	the [=pixel unit=] might not map to a whole number of [=device pixels=].

	Note: This definition of the [=pixel unit=] and the [=physical units=]
	differs from the earlier editions of CSS1 and CSS2.
	In particular, in previous versions of CSS the [=pixel unit=] and the [=physical units=]
	were not related by a fixed ratio:
	the [=physical units=] were always tied to their physical measurements
	while the [=pixel unit=] would vary to most closely match the reference pixel.
	(This unfortunate change
	was made because too much existing content relies on the assumption of 96dpi,
	and breaking that assumption broke the content.)

	Note: Units are [=ASCII case-insensitive=] and serialize as lowercase, for example 1Q serializes as 1q.

	<wpt>
	css/css-values/absolute-length-units-001.html
	css/css-values/q-unit-case-insensitivity-001.html
	css/css-values/q-unit-case-insensitivity-002.html
	css/CSS2/values/units-001.xht
	css/CSS2/values/units-006.xht
	css/CSS2/values/units-008.xht
	css/CSS2/values/units-009.xht
	</wpt>

	The <dfn export>reference pixel</dfn> is the visual angle of one pixel on a device with a [=device pixel=] density of 96dpi
	and a distance from the reader of an arm's length.
	For a nominal arm's length of 28 inches,
	the visual angle is therefore about 0.0213 degrees.
	For reading at arm's length,
	1px thus corresponds to about 0.26&nbsp;mm (1/96&nbsp;inch).

	The image below illustrates the effect of viewing distance on the size of a reference pixel:
	a reading distance of 71&nbsp;cm (28&nbsp;inches)
	results in a reference pixel of 0.26&nbsp;mm,
	while a reading distance of 3.5&nbsp;m (12&nbsp;feet)
	results in a reference pixel of 1.3&nbsp;mm.

	<figure>
		<img src="images/pixel1.png" width="500" height="360"
		     alt="This diagram illustrates how the definition of a pixel
		          depends on the users distance from the viewing surface
		          (paper or screen).
		          The image depicts the user looking at two planes,
		          one 28 inches (71 cm) from the user,
		          the second 140 inches (3.5 m) from the user.
		          An expanding cone is projected from the user's eye onto each plane.
		          Where the cone strikes the first plane,
		          the projected pixel is 0.26 mm high.
		          Where the cone strikes the second plane,
		          the projected pixel is 1.4 mm high.">
		<figcaption>
			Showing that pixels must become larger if the viewing distance increases
		</figcaption>
	</figure>

	This second image illustrates the effect of a device's resolution on the pixel unit:
	an area of 1px by 1px is covered by a single dot in a low-resolution device
	(e.g. a typical computer display),
	while the same area is covered by 16 dots in a higher resolution device
	(such as a printer).

	<figure>
		<img src="images/pixel2.png" width="412" height="321"
		     alt="This diagram illustrates the relationship between
		          the reference pixel and device pixels (called “dots” below).
		          The image depicts
		          a high resolution (large dot density) laser printer output on the left
		          and a low resolution monitor screen on the right.
		          For the laser printer, one square reference pixel is implemented by 16 dots.
		          For the monitor screen, one square reference pixel is implemented by a single dot.">
		<figcaption>
			Showing that more device pixels (dots) are needed
			to cover a 1px by 1px area on a high-resolution device
			than on a lower-resolution one
			(of the same approximate viewing distance)
		</figcaption>
	</figure>

	<wpt>
	css/css-values/absolute-length-units-001.html
	</wpt>

	A <dfn export>device pixel</dfn> is the smallest unit of area on the device output
	capable of displaying its full range of colors.
	For typical color screens, it's a square or somewhat rectangular region
	containing a red, green, and blue subpixel.
	Many non-traditional outputs exist that can blur this definition,
	such as by displaying some colors at higher resolutions.
	Such devices still expose some equivalent notion of "device pixel",
	however.

<h2 id="other-units">
Other Quantities</h2>

<!-- Big Text: angle

 ███▌  █    █▌  ███▌  █▌    █████▌
▐█ ▐█  █▌   █▌ █▌  █▌ █▌    █▌    
█▌  █▌ ██▌  █▌ █▌     █▌    █▌    
█▌  █▌ █▌▐█ █▌ █▌ ██▌ █▌    ████  
█████▌ █▌  ██▌ █▌  █▌ █▌    █▌    
█▌  █▌ █▌   █▌ █▌  █▌ █▌    █▌    
█▌  █▌ █▌   ▐▌  ███▌  █████ █████▌
-->

<h3 id="angles">
Angle Units: the <<angle>> type and ''deg'', ''grad'', ''rad'', ''turn'' units</h3>

	Angle values are <<dimension>>s denoted by <dfn id="angle-value">&lt;angle></dfn>.
	The angle unit identifiers are:

	<dl export dfn-type=value dfn-for="<angle>">
		<dt><dfn id="deg">deg</dfn>
		<dd>
			Degrees. There are 360 degrees in a full circle.

		<dt><dfn id="grad">grad</dfn>
		<dd>
			Gradians, also known as "gons" or "grades".
			There are 400 gradians in a full circle.

		<dt><dfn id="rad">rad</dfn>
		<dd>
			Radians. There are 2&pi; radians in a full circle.

		<dt><dfn id="turn">turn</dfn>
		<dd>
			Turns. There is 1 turn in a full circle.
	</dl>

	For example, a right angle is ''90deg'' or ''100grad'' or ''0.25turn'' or
	approximately ''1.57rad''.

	All <<angle>> units are <a>compatible</a>,
	and ''deg'' is their <a>canonical unit</a>.

	<div class="note">
		By convention,
		when an angle denotes a direction in CSS,
		it is typically interpreted as a <dfn export>bearing angle</dfn>,
		where 0deg is "up" or "north" on the screen,
		and larger angles are more clockwise
		(so 90deg is "right" or "east").

		For example, in the ''linear-gradient()'' function,
		the <<angle>> that determines the direction of the gradient
		is interpreted as a bearing angle.
	</div>

	Note: For legacy reasons,
	some uses of <<angle>> allow a bare ''0'' to mean ''0deg''.
	This is not true in general, however,
	and will not occur in future uses of the <<angle>> type.

	<wpt>
	css/css-values/angle-units-001.html
	css/css-values/angle-units-002.html
	css/css-values/angle-units-003.html
	css/css-values/angle-units-004.html
	css/css-values/angle-units-005.html
	css/css-values/calc-angle-values.html
	</wpt>

<!-- Big Text: time

█████▌ ████ █     █ █████▌
  █▌    ▐▌  ██   ██ █▌    
  █▌    ▐▌  █▌█ █▐█ █▌    
  █▌    ▐▌  █▌ █ ▐█ ████  
  █▌    ▐▌  █▌   ▐█ █▌    
  █▌    ▐▌  █▌   ▐█ █▌    
  █▌   ████ █▌   ▐█ █████▌
-->

<h3 id="time">
Duration Units: the <<time>> type and ''s'', ''ms'' units</h3>

	Time values are <a>dimensions</a> denoted by <dfn id="time-value">&lt;time></dfn>.
	The time unit identifiers are:

	<dl export dfn-type=value dfn-for="<time>">
		<dt><dfn id="s">s</dfn>
		<dd>Seconds.
		<dt><dfn id="ms">ms</dfn>
		<dd>Milliseconds. There are 1000 milliseconds in a second.
	</dl>

	All <<time>> units are <a>compatible</a>,
	and ''s'' is their <a>canonical unit</a>.

	Properties may restrict the time value to some range.
	If the value is outside the allowed range,
	the declaration is invalid and must be <a href="https://www.w3.org/TR/CSS2/conform.html#ignore">ignored</a>.

	<wpt>
	css/css-values/calc-time-values.html
	css/css-transitions/transition-delay-001.html
	css/css-transitions/transition-duration-001.html
	</wpt>

<!-- Big Text: frequency

█████▌ ████▌  █████▌  ███▌  █▌  █▌ █████▌ █    █▌  ███▌  █   ▐▌
█▌     █▌  █▌ █▌     █▌  █▌ █▌  █▌ █▌     █▌   █▌ █▌  █▌ ▐▌  █ 
█▌     █▌  █▌ █▌     █▌  █▌ █▌  █▌ █▌     ██▌  █▌ █▌      █ ▐▌ 
████   ████▌  ████   █▌  █▌ █▌  █▌ ████   █▌▐█ █▌ █▌      ▐▌█  
█▌     █▌▐█   █▌     █▌▐ █▌ █▌  █▌ █▌     █▌  ██▌ █▌       █▌  
█▌     █▌ ▐█  █▌     █▌ ▐▌  █▌  █▌ █▌     █▌   █▌ █▌  █▌   █▌  
█▌     █▌  █▌ █████▌  ██▌ ▌  ███▌  █████▌ █▌   ▐▌  ███▌    █▌  
-->

<h3 id="frequency">
Frequency Units: the <<frequency>> type and ''Hz'', ''kHz'' units</h3>

	Frequency values are <a>dimensions</a> denoted by <dfn id="frequency-value">&lt;frequency></dfn>.
	The frequency unit identifiers are:

	<dl export dfn-type=value dfn-for="<frequency>">
		<dt><dfn id="Hz">Hz</dfn>
		<dd>Hertz. It represents the number of occurrences per second.
		<dt><dfn id="kHz">kHz</dfn>
		<dd>KiloHertz. A kiloHertz is 1000 Hertz.
	</dl>

	For example, when representing sound pitches, 200Hz (or 200hz)
	is a bass sound, and 6kHz (or 6khz) is a treble sound.

	All <<frequency>> units are <a>compatible</a>,
	and ''hz'' is their <a>canonical unit</a>.

	Note: Units are [=ASCII case-insensitive=] and serialize as lowercase, for example 1Hz serializes as 1hz.

<!-- Big Text: reso

████▌  █████▌  ███▌   ███▌ 
█▌  █▌ █▌     █▌  █▌ █▌  █▌
█▌  █▌ █▌     █▌     █▌  █▌
████▌  ████    ███▌  █▌  █▌
█▌▐█   █▌         █▌ █▌  █▌
█▌ ▐█  █▌     █▌  █▌ █▌  █▌
█▌  █▌ █████▌  ███▌   ███▌ 
-->

<h3 id="resolution">
Resolution Units: the <<resolution>> type and ''<resolution>/dpi'', ''<resolution>/dpcm'', ''<resolution>/dppx'' units</h3>

	Resolution units are <a>dimensions</a> denoted by <dfn id="resolution-value">&lt;resolution></dfn>.
	The resolution unit identifiers are:

	<dl export dfn-type=value dfn-for="<resolution>">
		<dt><dfn id="dpi">dpi</dfn>
		<dd>Dots per inch.

		<dt><dfn id="dpcm">dpcm</dfn>
		<dd>Dots per centimeter.

		<dt><dfn id="dppx">dppx</dfn>
		<dd>Dots per ''px'' unit.
	</dl>

	The <<resolution>> unit represents the size of a single "dot" in a graphical representation
	by indicating how many of these dots fit in a CSS ''in'', ''cm'', or ''px''.
	For uses, see e.g. the  ''resolution'' media query in [[MEDIAQ]]
	or the 'image-resolution' property defined in [[CSS3-IMAGES]].

	All <<resolution>> units are <a>compatible</a>,
	and ''<resolution>/dppx'' is their <a>canonical unit</a>.

	The allowed range of <<resolution>> values
	<em>always</em> excludes negative values,
	in addition to any explicit ranges that might be specified.

	<p class="note">Note that due to the 1:96 fixed ratio of CSS ''in'' to CSS ''px'',
	''1dppx'' is equivalent to ''96dpi''.
	This corresponds to the default resolution of images displayed in CSS:
	see 'image-resolution'.

	<div class="example">
		The following @media rule uses Media Queries [[MEDIAQ]]
		to assign some special style rules to devices that use two or more device pixels per CSS ''px'' unit:

		<pre>@media (min-resolution: 2dppx) { ... }</pre>
	</div>


<h2 id="defined-elsewhere">
Data Types Defined Elsewhere</h2>

	Some data types are defined in their own modules.
	This example talks about some of the most common ones
	used across several specifications.

<!-- Big Text: color

 ███▌   ███▌  █▌     ███▌  ████▌ 
█▌  █▌ █▌  █▌ █▌    █▌  █▌ █▌  █▌
█▌     █▌  █▌ █▌    █▌  █▌ █▌  █▌
█▌     █▌  █▌ █▌    █▌  █▌ ████▌ 
█▌     █▌  █▌ █▌    █▌  █▌ █▌▐█  
█▌  █▌ █▌  █▌ █▌    █▌  █▌ █▌ ▐█ 
 ███▌   ███▌  █████  ███▌  █▌  █▌
-->

<h3 id="colors">
Colors: the <<color>> type</h3>

	The <<color>> data type is defined in [[!CSS3COLOR]].
	UAs that support CSS Color Level 3 or its successor must interpret <<color>> as defined therein.

<!-- Big Text: image

████ █     █  ███▌   ███▌  █████▌
 ▐▌  ██   ██ ▐█ ▐█  █▌  █▌ █▌    
 ▐▌  █▌█ █▐█ █▌  █▌ █▌     █▌    
 ▐▌  █▌ █ ▐█ █▌  █▌ █▌ ██▌ ████  
 ▐▌  █▌   ▐█ █████▌ █▌  █▌ █▌    
 ▐▌  █▌   ▐█ █▌  █▌ █▌  █▌ █▌    
████ █▌   ▐█ █▌  █▌  ███▌  █████▌
-->

<h3 id="images">
Images: the <<image>> type</h3>

	The <<image>> data type is defined in [[!CSS3-IMAGES]].
	UAs that support CSS Images Level 3 or its successor
	must interpret <<image>> as defined therein.
	UAs that do not yet support CSS Images Level 3
	must interpret <<image>> as <<url>>.

<!-- Big Text: position

████▌   ███▌   ███▌  ████ █████▌ ████  ███▌  █    █▌
█▌  █▌ █▌  █▌ █▌  █▌  ▐▌    █▌    ▐▌  █▌  █▌ █▌   █▌
█▌  █▌ █▌  █▌ █▌      ▐▌    █▌    ▐▌  █▌  █▌ ██▌  █▌
████▌  █▌  █▌  ███▌   ▐▌    █▌    ▐▌  █▌  █▌ █▌▐█ █▌
█▌     █▌  █▌     █▌  ▐▌    █▌    ▐▌  █▌  █▌ █▌  ██▌
█▌     █▌  █▌ █▌  █▌  ▐▌    █▌    ▐▌  █▌  █▌ █▌   █▌
█▌      ███▌   ███▌  ████   █▌   ████  ███▌  █▌   ▐▌
-->

<h3 id="position">
2D Positioning: the <<position>> type</h3>

	The <dfn><<position>></dfn> value specifies the position of a object area (e.g. background image)
	inside a positioning area (e.g. background positioning area).
	It is computed and interpreted as specified for 'background-position'. [[!CSS3-BACKGROUND]]

	<pre class=prod>
		<<position>> = [
		  [ left | center | right | top | bottom | <<length-percentage>> ]
		|
		  [ left | center | right ] && [ top | center | bottom ]
		|
		  [ left | center | right | <<length-percentage>> ]
		  [ top | center | bottom | <<length-percentage>> ]
		|
		  [ [ left | right ] <<length-percentage>> ] &&
		  [ [ top | bottom ] <<length-percentage>> ]
		]
	</pre>

	Note: The 'background-position' property also accepts a three-value syntax.
	This has been disallowed generically because it creates parsing ambiguities
	when combined with other length or percentage components in a property value.

	The canonical order when serializing is
	the horizontal component followed by the vertical component.

	When specified in a grammar alongside other keywords, <<length>>s, or <<percentage>>s,
	<<position>> is <em>greedily</em> parsed;
	it consumes as many components as possible.

	<div class=example>
		For example,
		'transform-origin' defines a 3D position
		as (effectively) ''<<position>> <<length>>?''.
		A value such as ''left 50px''
		will be parsed as a 2-value <<position>>,
		with an omitted z-component;
		on the other hand,
		a value such as ''top 50px''
		will be parsed as a single-value <<position>>
		followed by a <<length>>.
	</div>

<h2 id="functional-notations">
Functional Notations</h2>

	A <dfn export>functional notation</dfn> is a type of component value
	that can represent more complex types or invoke special processing.
	The syntax starts with the name of the function
	immediately followed by a left parenthesis
	(i.e. a <<function-token>>)
	followed by the argument(s) to the notation
	followed by a right parenthesis.
	Like keywords, function names are [=ASCII case-insensitive=].
	<a href="https://www.w3.org/TR/css-syntax/#whitespace">White space</a> is allowed, but optional,
	immediately inside the parentheses.
	Functions can take multiple arguments,
	which are formatted similarly to a CSS property value.

	Note: Some legacy <a>functional notations</a>, such as ''rgba()'', use commas unnecessarily,
	but generally commas are only used to separate items in a list,
	or pieces of a grammar that would be ambiguous otherwise.
	If a comma is used to separate arguments,
	<a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a> is optional before and after the comma.

	<div class="example">
		<pre>
		background: url(http://www.example.org/image);
		color: rgb(100, 200, 50 );
		content: counter(list-item) ". ";
		width: calc(50% - 2em);
		</pre>
	</div>

<!-- Big Text: calc()

 ███▌   ███▌  █▌     ███▌    ██ ██  
█▌  █▌ ▐█ ▐█  █▌    █▌  █▌  █▌   ▐█ 
█▌     █▌  █▌ █▌    █▌     █▌     ▐█
█▌     █▌  █▌ █▌    █▌     █▌     ▐█
█▌     █████▌ █▌    █▌     █▌     ▐█
█▌  █▌ █▌  █▌ █▌    █▌  █▌  █▌   ▐█ 
 ███▌  █▌  █▌ █████  ███▌    ██ ██  
-->

<h3 id="calc-func" oldids="calc-notation">
Mathematical Expressions: ''calc()''</h3>

	The <dfn>calc()</dfn> function
	allows a numeric CSS component value
	to be written as a mathematical expression
	using addition (''+''), subtraction (''-''), multiplication (''*''), and/or division (''/'').

	The ''calc()'' expression represents the result of the mathematical calculation it contains,
	which is evaluated using standard operator precedence rules
	(<css>*</css> and <css>/</css> bind tighter than <css>+</css> and <css>-</css>,
	and operators are otherwise evaluated left-to-right).

	It can be used wherever
	<<length>>,
	<<frequency>>,
	<<angle>>,
	<<time>>,
	<<percentage>>,
	<<number>>, or
	<<integer>>
	values are allowed.
	Components of a ''calc()'' expression can be literal values or
	or ''calc()'' expressions.

	<div class="example">
		<pre>
		section {
		  float: left;
		  margin: 1em; border: solid 1px;
		  width: calc(100%/3 - 2*1em - 2*1px);
		}
		</pre>
	</div>

	<div class="example">
		<pre>
		p {
		  margin: calc(1rem - 2px) calc(1rem - 1px);
		}
		</pre>
	</div>

	<div class="example">
		The following sets the 'font-size' so that exactly 40em fits within the viewport,
		ensuring that roughly the same amount of text always fills the screen no matter the screen size.

		<pre>
		:root {
			font-size: calc(100vw / 40);
		}
		</pre>

		If the rest of the design is specified using the ''rem'' unit,
		the entire layout will scale to match the viewport width.
	</div>

	<div class='example'>
		The following example stacks two background images,
		with the first perfectly centered
		and the second offset 20px to the bottom and to the left of the first.

		<pre>
		.foo {
			background: url(top.png), url(bottom.png);
			background-repeat: no-repeat;
			background-position: 50% 50%, calc(50% + 20px) calc(50% + 20px);
		}
		</pre>
	</div>

	<div class='example'>
		This example shows how to place color-stops on a gradient an equal distance from either end.

		<pre>
		.foo {
			background-image: linear-gradient(to right, silver,
			                                            white 50px,
			                                            white calc(100% - 50px),
			                                            silver);
		}
		</pre>
	</div>

	<wpt>
	css/css-values/calc-in-calc.html
	css/css-values/calc-in-counter-001.xhtml
	css/css-values/calc-in-media-queries-001.html
	css/css-values/calc-in-media-queries-002.html
	css/css-values/calc-invalid-range-clamping.html
	css/css-values/calc-min-height.html
	css/css-values/calc-nesting.html
	css/css-values/calc-parenthesis-stack.html
	css/css-values/calc-background-image-gradient-1.html
	css/css-values/calc-background-linear-gradient-1.html
	css/css-values/calc-background-position-1.html
	css/css-values/calc-background-size-1.html
	css/css-values/calc-border-radius-1.html
	css/css-values/calc-height-block-1.html
	css/css-values/calc-height-table-1.html
	css/css-values/calc-margin-block-1.html
	css/css-values/calc-max-height-block-1.html
	css/css-values/calc-max-width-block-1.html
	css/css-values/calc-max-width-block-intrinsic-1.html
	css/css-values/calc-min-height-block-1.html
	css/css-values/calc-min-width-block-1.html
	css/css-values/calc-min-width-block-intrinsic-1.html
	css/css-values/calc-offsets-absolute-bottom-1.html
	css/css-values/calc-offsets-absolute-left-1.html
	css/css-values/calc-offsets-absolute-right-1.html
	css/css-values/calc-offsets-absolute-top-1.html
	css/css-values/calc-offsets-relative-bottom-1.html
	css/css-values/calc-offsets-relative-left-1.html
	css/css-values/calc-offsets-relative-right-1.html
	css/css-values/calc-offsets-relative-top-1.html
	css/css-values/calc-padding-block-1.html
	css/css-values/calc-text-indent-1.html
	css/css-values/calc-text-indent-intrinsic-1.html
	css/css-values/calc-transform-origin-1.html
	css/css-values/calc-vertical-align-1.html
	css/css-values/calc-width-block-1.html
	css/css-values/calc-width-block-intrinsic-1.html
	css/css-values/calc-width-table-auto-1.html
	css/css-values/calc-width-table-fixed-1.html
	css/mediaqueries/mq-calc-001.html
	css/mediaqueries/mq-calc-002.html
	css/mediaqueries/mq-calc-003.html
	css/mediaqueries/mq-calc-004.html
	css/mediaqueries/mq-calc-005.html
	css/motion/offset-supports-calc.html
	css/css-shapes/shape-outside/values/shape-outside-circle-010.html
	css/css-shapes/shape-outside/values/shape-outside-circle-011.html
	css/css-shapes/shape-outside/values/shape-outside-ellipse-010.html
	css/css-shapes/shape-outside/values/shape-outside-ellipse-011.html
	css/css-shapes/shape-outside/values/shape-outside-inset-008.html
	css/css-shapes/shape-outside/values/shape-outside-inset-009.html
	css/css-shapes/shape-outside/values/shape-outside-polygon-006.html
	css/css-transforms/transforms-support-calc.html
	css/css-values/vh-calc-support-pct.html
	css/css-values/vh-calc-support.html
	css/css-values/calc-ch-ex-lang.html
	css/css-values/calc-in-color-001.html
	css/css-values/calc-in-font-feature-settings.html
	css/css-values/calc-rem-lang.html
	css/css-values/calc-rounding-001.html
	css/css-values/ex-calc-expression-001.html
	</wpt>

<h4 id='calc-syntax'>
Syntax</h4>

	The syntax of a ''calc()'' function is:

	<pre class='prod'>
	<<calc()>> = calc( <<calc-sum>> )
	<dfn>&lt;calc-sum></dfn> = <<calc-product>> [ [ '+' | '-' ] <<calc-product>> ]*
	<dfn>&lt;calc-product></dfn> = <<calc-value>> [ '*' <<calc-value>> | / <<calc-number-value>> ]*
	<dfn>&lt;calc-value></dfn> = <<number>> | <<dimension>> | <<percentage>> | ( <<calc-sum>> )
	<dfn>&lt;calc-number-sum></dfn> = <<calc-number-product>> [ [ '+' | '-' ] <<calc-number-product>> ]*
	<dfn>&lt;calc-number-product></dfn> = <<calc-number-value>> [ '*' <<calc-number-value>> | / <<calc-number-value>> ]*
	<dfn>&lt;calc-number-value></dfn> = <<number>> | ( <<calc-number-sum>> )
	</pre>

	In addition, <a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a>
	is required on both sides of the ''+'' and ''-'' operators.
	(The ''*'' and ''/'' operators can be used without white space around them.)

	UAs must support ''calc()'' expressions of at least 20 terms,
	where each <code>NUMBER</code>, <code>DIMENSION</code>, or <code>PERCENTAGE</code> is a term.
	If a ''calc()'' expression contains more than the supported number of terms,
	it must be treated as if it were invalid.


<h4 id='calc-type-checking'>
Type Checking</h4>

	A math expression has a <dfn>resolved type</dfn>, which is one of
	<<length>>,
	<<frequency>>,
	<<angle>>,
	<<time>>,
	<<percentage>>,
	<<number>>, or
	<<integer>>.
	The <a>resolved type</a> must be valid for where the expression is placed;
	otherwise, the expression is invalid.
	The <a>resolved type</a> of the expression is determined by the types of the values it contains.
	<<number-token>>s are of type <<number>> or <<integer>>.
	A <<dimension-token>>’s type is given by its unit
	(''cm'' is <<length>>, ''deg'' is <<angle>>, etc.).

	Note: Because <<number-token>>s are always interpreted as <<number>>s or <<integer>>s,
	"unitless 0" <<length>>s aren't supported in ''calc()''.
	That is, ''width: calc(0 + 5px);'' is invalid,
	even though both ''width: 0;''
	and ''width: 5px;''
	are valid.

	If percentages are accepted in the context in which the expression is placed,
	and they are defined to be relative to another type besides <<number>>,
	a <<percentage-token>> is treated as that type.
	For example, in the 'width' property, percentages have the <<length>> type.
	A percentage only has the <<percentage>> type if in that context
	<<percentage>> values are not used-value compatible with any other type.
	If percentages are not normally allowed in place of the ''calc()'',
	then a ''calc()'' expression containing percentages is invalid in that context.

	Note: Note that <<percentage>>s relative to <<number>>s,
	such as in 'opacity',
	are not allowed in ''calc()''.
	Allowing this would cause significant problems with "unit algebra"
	(allowing multiplication/division of <<dimension>>s),
	and in every case so far,
	doesn't provide any new functionality.
	(For example, ''opacity: 25%'' is identical to ''opacity: .25'';
	it's just a trivial syntax transform.)

	Note: Although there are a few properties in which a bare <<number>>
	becomes a <<length>> at used-value time
	(specifically, 'line-height' and 'tab-size'),
	<<number>>s never become "length-like" in ''calc()''.
	They always stay as <<number>>s.

	Operators form sub-expressions, which gain types based on their arguments.
	To make expressions simpler,
	operators have restrictions on the types they accept.
	At each operator,
	the types of the left and right argument are checked for these restrictions.
	If compatible, the type resolves as described below
	(the following ignores precedence rules on the operators for simplicity):

	<ul>
		<li>
			At ''+'' or ''-'',
			check that both sides have the same type,
			or that one side is a <<number>> and the other is an <<integer>>.
			If both sides are the same type,
			resolve to that type.
			If one side is a <<number>> and the other is an <<integer>>,
			resolve to <<number>>.

		<li>
			At ''*'',
			check that at least one side is <<number>>.
			If both sides are <<integer>>,
			resolve to <<integer>>.
			Otherwise,
			resolve to the type of the other side.

		<li>
			At ''/'',
			check that the right side is <<number>>.
			If the left side is <<integer>>,
			resolve to <<number>>.
			Otherwise,
			resolve to the type of the left side.
	</ul>

	If an operator does not pass the above checks, the expression is invalid.
	Also, division by zero is invalid.  This includes both dividing by the
	literal number zero, as well as any numeric expression that evaluates to zero
	(as purely-numeric expressions can be evaluated without any additional
	information at parse time).

	Note: Algebraic simplifications do not affect the validity of the ''calc()'' expression or its resolved type.
	For example, ''calc(5px - 5px + 10s)'' and ''calc(0 * 5px + 10s)'' are both invalid
	due to the attempt to add a length and a time.

	<wpt>
	css/css-values/calc-unit-analysis.html
	</wpt>

<h4 id='calc-computed-value'>
Computed Value</h4>

	The computed value of a ''calc()'' expression is the expression
	with all components computed.

	Where percentages are not resolved at computed-value time,
	they are not resolved in ''calc()'' expressions,
	e.g. ''calc(100% - 100% + 1em)'' resolves to ''calc(1em + 0%)'',
	not to ''1em''.
	If there are special rules for computing percentages in a value
	(e.g. <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">the <css>height</css> property</a>),
	they apply whenever a ''calc()'' expression contains percentages.

	<div class='example'>
		For example,
		whereas 'font-size' computes percentage values at <a>computed value</a> time
		so that <a>font-relative length</a> units can be computed,
		'background-position' has layout-dependent behavior for percentage values,
		and thus does not resolve percentages until used-value time.

		Due to this, 'background-position' computation preserves the percentage in a ''calc()''
		whereas 'font-size' will compute such expressions directly into a length.
	</div>

	<!-- http://lists.w3.org/Archives/Public/www-style/2010May/0001.html
	This has notes on how we should handle things when calc() is extended to
	handle unit mult/div. Related to this is <unit>mod<unit>, which can return
	0 and thus introduce computed-time division-by-zero. -->

	Given the complexities of width and height calculations on table cells and table elements,
	math expressions involving percentages for widths and heights on
	table columns, table column groups, table rows, table row groups, and table cells
	in both auto and fixed layout tables
	MAY be treated as if ''width/auto'' had been specified.

	<wpt>
	css/css-values/calc-background-position-002.html
	css/css-values/calc-letter-spacing.html
	css/css-values/calc-numbers.html
	css/css-values/calc-time-values.html
	css/css-values/getComputedStyle-border-radius-002.html
	</wpt>

<h4 id='calc-range'>
Range Checking</h4>

	Parse-time range-checking of values is not performed within ''calc()'',
	and therefore out-of-range values do not cause the declaration to become invalid.
	However, the value resulting from an expression
	must be clamped to the range allowed in the target context.
	Clamping is performed on <a>computed values</a> to the extent possible,
	and also on <a>used values</a>
	if computation was unable to sufficiently simplify the expression
	to allow range-checking.
	(Clamping is not performed on <a>specified values</a>.)

	Note: This requires all contexts accepting ''calc()''
	to define their allowable values as a closed (not open) interval.

	<div class=example>
		Since widths smaller than 0px are not allowed,
		these three declarations are equivalent:

		<pre>
		width: calc(5px - 10px);
		width: calc(-5px);
		width: 0px;
		</pre>

		Note however that ''width: -5px'' is not equivalent to ''width: calc(-5px)''!
		Out-of-range values <em>outside</em> ''calc()'' are syntactically invalid,
		and cause the entire declaration to be dropped.
	</div>

	<wpt>
	css/css-values/calc-numbers.html
	</wpt>

<h4 id='calc-serialize'>
Serialization</h4>

	The serialization of ''calc()'' values is undefined in this level.



<!--
<h2 id="limits">
Appendix A: Recommended Minimum Ranges and Precision of Computed Values</h2>

	For unrestricted values, the recommended minimum range and precision
	of computed values
	is given in the table below.

	<table class="data">
	<thead>
		<tr>
			<th>Type
			<th>Recommended Minimum Precision
			<th>Recommended Minimum Maximum (Absolute Value)
	<tbody>
		<tr>
			<th><<integer>>
			<td>1
			<td>2<sup>23</sup>&minus;1
		<tr>
			<th><<number>>
			<td>0.01
				<small>(within the range -100 &lt; <var>x</var> &lt; 100)</small>
			<td>2<sup>17</sup>&minus;1
		<tr>
			<th><<percentage>>
			<td>0.01%
				<small>(within the range -100 &lt; <var>x</var> &lt; 100)</small>
			<td>(2<sup>17</sup>&minus;1)%
		<tr>
			<th><<length>>
			<td>0.1px
			<td>(2<sup>23</sup>&minus;1)px
		<tr>
			<th><<angle>>
			<td>0.1deg
			<td>(2<sup>23</sup>&minus;1)deg
		<tr>
			<th><<time>>
			<td>1ms
			<td>(2<sup>23</sup>&minus;1)ms
		<tr>
			<th><<frequency>>
			<td>0.01Hz
			<td>(2<sup>17</sup>&minus;1)Hz
	</table>

	Values outside the supported range must be clamped into the supported range.
	Values specified with an unsupported amount of precision must be rounded
	to the closest supported value when parsed;
	except that values that are not equal to, but would round to,
	either zero or the boundary of a closed range,
	should be rounded away from that value rather than to it.

	<div class="example">
		For example, in a UA that only supports a precision of 0.01,
		an 'opacity' value of ''0.9999'' would round to ''0.99'', not ''1.0'',
		and would therefore cause the element to create a stacking context.
		Similarly, a ''flex-grow'' value of ''0.001'' would round to ''0.01'',
		not ''0'', and would therefore be flexible.
	</div>


	When arithmetic is performed with numeric types
	(for example, in the ''calc()'' expression),
	if the result is unsupported
	it must also be clamped/rounded as necessary.
	<span class="note">
		Note this means that rounding errors <em>may</em> accumulate.
	</span>
-->


<h2 id='iana'>
Appendix A: IANA Considerations</h2>

<h3 id='about-invalid'>
Registration for the <code>about:invalid</code> URL scheme</h3>

	This sections defines and registers the <code>about:invalid</code> URL,
	in accordance with the registration procedure defined in [[RFC6694]].


	The official record of this registration can be found at <a href="http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xhtml">http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xhtml</a>.

	<table class="data longlastcol">
		<tr>
			<th>Registered Token
			<td><code>invalid</code>
		<tr>
			<th>Intended Usage
			<td>
				The <code>about:invalid</code> URL references a non-existent document with a generic error condition.
				It can be used when a URL is necessary, but the default value shouldn't be resolvable as any type of document.
		<tr>
			<th>Contact/Change controller
			<td>CSS WG &lt;<a href="mailto:www-style@w3.org">www-style@w3.org</a>> (on behalf of W3C)
		<tr>
			<th>Specification
			<td><a href="https://www.w3.org/TR/css3-values/">CSS Values and Units Module Level 3</a>
	</table>


<!-- Big Text: etc

█████▌ █████▌  ███▌ 
█▌       █▌   █▌  █▌
█▌       █▌   █▌    
████     █▌   █▌    
█▌       █▌   █▌    
█▌       █▌   █▌  █▌
█████▌   █▌    ███▌ 
-->


<h2 class="no-num" id="acknowledgments">
Acknowledgments</h2>

	Comments and suggestions from
	Giovanni Campagna,
	Christoph Päper,
	Keith Rarick,
	Alex Mogilevsky,
	Ian Hickson,
	David Baron,
	Edward Welbourne,
	Boris Zbarsky,
	Björn Höhrmann
	and Michael Day
	improved this module.

<div class="informative">
<h2 class="no-num" id="changes">
Changes</h2>

	Changes since the <a href="https://www.w3.org/TR/2022/CR-css-values-3-20221201/">1 December 2022 Candidate Recommenation Snapshot</a> are:

	* Editorial synchronization with [[css-values-4 inline]].
	* Added definition for <css>&lt;func()></css> notation to the [=value definition syntax=].
	* Clarified stacking of multipliers.
	* Clarified that <<resolution>> cannot be negative.

	Changes since the <a href="https://www.w3.org/TR/2019/CR-css-values-3-20190606/">6 June 2019 Candidate Recommendation</a> are:

	* Dropped the ''attr()'' function, since it was punted to Level 5.
	* Specified serialization of empty urls to be <code>url("")</code>.
		(<a href="https://github.com/w3c/csswg-drafts/issues/6447">Issue 6447</a>)
	* Clarified that the [=font-relative lengths=] are calculated without text shaping.
		(<a href="https://github.com/w3c/csswg-drafts/issues/5498">Issue 5498</a>)
	* Added a definition for [=device pixel=].
		(<a href="https://github.com/w3c/csswg-drafts/issues/7287">Issue 7287</a>)
	* Cleaned up interaction of this specification and [[CSS-CASCADE-3]] in defining the [=CSS-wide keywords=].
		(<a href="https://github.com/w3c/csswg-drafts/issues/7439">Issue 7439</a>)
	* Removed definition of <css>&lt;length-number></css>, since it is impossible to combine them with ''calc()''.
		(<a href="https://github.com/w3c/csswg-drafts/issues/2789">Issue 2789</a>)
	* Fixed definition of [=numbers=] to allow decimals in combination with scientific notation,
		as originally intended and as defined in [[CSS-SYNTAX-3]].
		(<a href="https://github.com/w3c/csswg-drafts/issues/7248">Issue 7248</a>)
	* Editorial improvements.

	Changes since the <a href="https://www.w3.org/TR/2019/CR-css-values-3-20190131/">31 January 2019 Candidate Recommendation</a> are:

	<ul>
		<li>Added the new <a>bracketed range notation</a> to the CSS <a>value definition syntax</a>.
			This has no normative implications on implementations,
			just allows more routine annotation of ranges in future CSS specifications.
			(<a href="https://github.com/w3c/csswg-drafts/issues/355">Issue 355</a>)
	</ul>

	Changes since the <a href="https://www.w3.org/TR/2018/CR-css-values-3-20180814/">14 August 2018 Candidate Recommendation</a> are:

	<ul>
		<li>Defined <<'property'>> syntax to refer to the property without any top-level #-multiplier,
			to make the notation usable with common list-valued property patterns.
			(<a href="https://github.com/w3c/csswg-drafts/issues/3146">Issue 3146</a>)
		<li>Clarified that numeric values outside the allowed range
			are not ignored if a more specific spec defines other handling.
			(<a href="https://github.com/w3c/csswg-drafts/issues/3270">Issue 3270</a>)
			<blockquote>
				Properties may restrict numeric values to some range.
				If the value is outside the allowed range,
				<ins>unless otherwise specified,</ins>
				the declaration is invalid and must be <a href="https://www.w3.org/TR/CSS2/conform.html#ignore">ignored</a>.
			</blockquote>
		<li>Fixed some 'background-position' examples to be less confusing.
			(<a href="https://github.com/w3c/csswg-drafts/issues/3482#issuecomment-453257033">Issue 3482</a>)
	</ul>

	A <a href="http://drafts.csswg.org/css-values-3/issues-cr-2018">Disposition of Comments</a> is available.

	Changes since the <a href="https://www.w3.org/TR/2016/CR-css-values-3-20160929/">29 September 2016 Candidate Recommendation</a> are:

	<ul>
		<li>Removed <a href="#change-2012-vwh-scrollbars">consideration of scrollbars</a>
			in computing viewport units due to lack of implementations.
			(<a href="https://drafts.csswg.org/css-values-3/issues-cr-2016#issue-15">Issue 15</a>)
		<li>Inlined the <<position>> definition and dropped the three-value syntaxes
			to allow for unambiguous combination in complex grammars.
			This effectively removes that syntax from 'object-position',
			but allows <<position>> to be re-used e.g. in [[CSS-TRANSFORMS-1]] for 3D positions.
			(See <a href="https://lists.w3.org/Archives/Public/www-style/2017Feb/0052.html">discussion</a>.)
		<li>Reverted previous change to allow zero angles to drop their unit;
			this will instead be special-cased where needed for backwards-compatibility.
			(See <a href="https://lists.w3.org/Archives/Public/www-style/2017Apr/0027.html">discussion</a>)
		<li>Defined that range checking, and any resulting clamping, of ''calc()'' values
			is performed both at computed time and at used time.
			(<a href="https://github.com/w3c/csswg-drafts/issues/434">Issue #434</a>)
		<li>Fixed grammar error that disallowed numeric expressions as denominators in ''calc()''.
			(<a href="https://drafts.csswg.org/css-values-3/issues-cr-2016#issue-12">Issue 12</a>)
		<li>Defined handling of font-relative units outside the context of an element.
			(<a href="https://drafts.csswg.org/css-values-3/issues-cr-2016#issue-9">Issue 9</a>)
		<li>Defined that ''0'' parses as <<number>> if it's ambiguous whether it's a <<number>> or a <<length>>.
			(<a href="https://github.com/w3c/csswg-drafts/issues/489">Issue 489</a>)
		<li>Defined empty ''url()''s to refer to an invalid URL, rather than resolving to the URL of the style sheet.
			(<a href="https://github.com/w3c/csswg-drafts/issues/2211">Issue 2211</a>)
		<li>Removed (unused) ability for percentages to be treated as a <<number>> type in ''calc()''.
			(<a href="https://github.com/w3c/csswg-drafts/issues/1463">Issue 1463</a>)
		<li>Clarified that high-resolution screens should anchor on device pixels, not physical units.
			(<a href="https://drafts.csswg.org/css-values-3/issues-cr-2016#issue-8">Issue 8</a>)
		<li>Clarified definition of ''url()'' to normatively say that it accepts unquoted syntax.
		<li>Defined that fragment-only ''url()'' are specially handled to always be page-local links,
			regardless of base-url shenanigans.
			(See [[#local-urls]].)
		<li>Defined attr() parsing in terms of the Syntax spec, not CSS2.1 grammar.

	</ul>

	A <a href="https://drafts.csswg.org/css-values-3/issues-cr-2016">Disposition of Comments</a> is available.

	Changes since the <a href="https://www.w3.org/TR/2015/CR-css-values-3-20150611/">11 June 2015 Candidate Recommendation</a> are:

	<ul>
		<li>Dropped ''toggle()'' for lack of implementations.
		<li>Allow zero angles to be represented as ''0''.
		    (Change due to Web-compatibility constraints in transform and gradient syntaxes.)
		<li>Defined <a href="#local-urls">special handling</a> for fragment URLs.
		<li>Defined an empty <<url>> resolves to an invalid resource.
		<li>Defined <a>compatible units</a> and <a>canonical units</a> for serialization.
		<li>Defined case-sensitivity of ''url()'' attribute argument to match attribute selectors.
		<li>Added definition of <<ident>> notation to definition of [=CSS/identifiers=].
		<li>Added <<length-percentage>> as a shorthand for <<length>> | <<percentage>>,
			along with equivalent productions for angles, numbers, times, and frequencies.
		<li>Allowed <<percentage>>s inside ''calc()'' to resolve as their own type,
			if they occur in some (as yet theoretical) context
			where they are not compatible with any other type.
		<li>Various clarifications and editorial improvements.
	</ul>

	Changes since the <a href="https://www.w3.org/TR/2013/CR-css3-values-20130730/">30 July 2013 Candidate Recommendation</a> are:

	<ul>
		<li>Specified that, in the absence of font information, ''1ch'' equal ''.5em''.
		<li>Added ''Q'' unit.
		<li>Relaxed unnecessary restrictions on <<custom-ident>>.
			Require specs referencing it to be clear about excluded keywords,
			because the new rule isn't as simple.
		<li>Clarified relative URL resolution for embedded style sheets.
		<li>Clarified {<var>A</var>} variant of {<var>A</var>,<var>B</var>} notation.
		<li>Added notation for restricting the length of comma-separated lists
			specified with the ''#'' notation.
		<li>Clarified handling of ''toggle()'' when used in shorthand declarations.
		<li>Clarified that stringing together reorderable combinations allows interleaving.
		<li>Changed syntax references from the 2.1 grammar to the Syntax spec.
	</ul>

	<p>A <a href="https://drafts.csswg.org/css-values-3/issues-cr-2013">Disposition of Comments</a> is available.

	Changes since the <a href="https://www.w3.org/TR/2012/CR-css3-values-20120828/">28 August 2012 Candidate Recommendation</a> are:

	<ul>
		<li>Corrected <code>wqname</code> in the ''attr()'' syntax to <code>qname</code>
		<li>Made undefined namespace prefixes in ''attr()'' invalidate the function.
		<li id="change-2012-vwh-scrollbars">
			Per <a href="http://lists.w3.org/Archives/Public/www-style/2013Jan/0616.html">WG resolution</a>,
			made <a href="#viewport-relative-lengths">viewport-percentage units</a> respect scrollbars on the viewport
			unless 'overflow' is ''overflow/auto'' (in which case they ignore the presence of scrollbars).
		<li>Deferred exact definition of <a href="#viewport-relative-lengths">viewport-percentage units</a>
			in [=paged media=] to <a href="https://www.w3.org/TR/css3-page/">CSS Paged Media</a>.
		<li>Added back the <<custom-ident>> term as a convenience notation, so that other specs can refer to it.
	</ul>

	Changes since the <a href="https://www.w3.org/TR/2013/CR-css3-values-20130404/">4 April 2013 Candidate Recommendation</a> are:

	<ul>
		<li>Noted that the list of <a>CSS-wide keywords</a> may be expanded by other specs.
		<li>Clarified definition of ''ex'' to refer to the “first available font”.
		<li>Specified that ''attr()'' with ''string'' or ''url'' types doesn't reparse the attribute contents, just takes the value literally as the value of a <<string>>.
	</ul>
</div>

<h2 class="no-num" id="security">
Security Considerations</h2>

	This specification presents no new security considerations.

	This specification defines the ''url()'' function (<<url>>),
	which allows CSS to make network requests.
	Depending on what features they are used in,
	these can potentially expose whether or not the user has access to resources on a network,
	and expose information about their contents
	(such as the rules within a style sheet, the size of an image, the metrics of a font).
	They can also allow exfiltrating data via URL.

<h2 class="no-num" id="privacy">
Privacy Considerations</h2>

	This specification introduces units that expose the user's screen size
	(the [=viewport-percentage lengths=]),
	default font size,
	and potentially some information about
	which fonts are available on the user's system
	(the [=font-relative lengths=]).

	This specification defines the ''url()'' function (<<url>>),
	which allows CSS to make network requests.
	Depending on what features they are used in,
	these can potentially expose whether or not the user has access to resources on a network,
	and expose information about their contents
	(such as the rules within a style sheet, the size of an image, the metrics of a font).
	They can also allow exfiltrating data via URL.
