@@ -20,8 +20,8 @@ Previous Version: https://www.w3.org/TR/2001/WD-css3-values-20010713/
2020Editor : Tab Atkins, Google, http://xanthir.com/contact/
2121Editor : fantasai, http://fantasai.inkedblade.net/contact
2222Former Editor : Håkon Wium Lie, Opera Software, howcome@opera.com
23- Abstract : This CSS3 module describes the common values and units that CSS properties accept and the syntax used for describing them in CSS property definitions.
24- At Risk : ''toggle()'', '' attr()''
23+ 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.
24+ At Risk : ''attr()''
2525Ignored Terms : <spacing-limit>, containing block
2626Ignored Vars : Cn+1, n
2727Inline Github Issues : yes
@@ -889,12 +889,6 @@ Relative lengths</h3>
889889 <td> 1% of viewport's width
890890 <tr><td> ''vh''
891891 <td> 1% of viewport's height
892- <!--
893- <tr><td> ''vi''
894- <td> 1% of viewport's size in the root element's <a>inline axis</a>
895- <tr><td> ''vb''
896- <td> 1% of viewport's size in the root element's <a>block axis</a>
897- -->
898892 <tr><td> ''vmin''
899893 <td> 1% of viewport's smaller dimension
900894 <tr><td> ''vmax''
@@ -994,7 +988,7 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''rem'' units</h4>
994988-->
995989
996990<h4 id="viewport-relative-lengths">
997- Viewport-percentage lengths: the ''vw'', ''vh'', <!-- ''vi'', ''vb'', --> ''vmin'', ''vmax'' units</h4>
991+ Viewport-percentage lengths: the ''vw'', ''vh'', ''vmin'', ''vmax'' units</h4>
998992
999993 The <dfn export>viewport-percentage lengths</dfn> are relative to the size of the
1000994 <a href="https://www.w3.org/TR/CSS21/visudet.html#containing-block-details">initial containing block</a> .
@@ -1023,17 +1017,7 @@ Viewport-percentage lengths: the ''vw'', ''vh'', <!-- ''vi'', ''vb'', --> ''vmin
10231017 <dt> <dfn id="vh" lt="vh">vh unit</dfn>
10241018 <dd>
10251019 Equal to 1% of the height of the initial containing block.
1026- <!--
1027- <dt> <dfn lt=vi>vi unit</dfn>
1028- <dd>
1029- Equal to 1% of the size of the initial containing block
1030- in the direction of the root element's inline axis.
10311020
1032- <dt> <dfn lt=vb>vb unit</dfn>
1033- <dd>
1034- Equal to 1% of the size of the initial containing block
1035- in the direction of the root element's block axis.
1036- -->
10371021 <dt> <dfn id="vmin" lt="vmin">vmin unit</dfn>
10381022 <dd>
10391023 Equal to the smaller of ''vw'' or ''vh'' .
@@ -1042,13 +1026,7 @@ Viewport-percentage lengths: the ''vw'', ''vh'', <!-- ''vi'', ''vb'', --> ''vmin
10421026 <dd>
10431027 Equal to the larger of ''vw'' or ''vh'' .
10441028 </dl>
1045- <!--
1046- In situations where there is no root element
1047- or it hasn't yet been styled
1048- (such as when evaluating <a>media queries</a> ),
1049- the ''vi'' and ''vb'' units use the initial value of the 'writing-mode' property
1050- to determine which axis they correspond to.
1051- -->
1029+
10521030<!--
10531031████████ ██ ██ ██ ████████ ████████ ██████
10541032██ ██ ██ ██ ██ ██ ██ ██ ██
@@ -1707,186 +1685,7 @@ Range Checking</h4>
17071685<h4 id='calc-serialize'>
17081686Serialization</h4>
17091687
1710- To serialize a ''calc()'' value:
1711-
1712- 1. Simplify the expression by:
1713-
1714- * Replacing nested ''calc()'' values with parentheses containing their contents
1715- * Resolving all multiplications and divisions
1716- * Combining identical units
1717-
1718- Note: The value-computation process can transform disparate units into identical ones.
1719- For example, ''em'' and ''px'' are obviously different at specified-value time,
1720- but at computed-value time they're both absolutized to ''px'' .
1721-
1722- The result must be a summation of unique units.
1723- (Terms with a value of zero <strong> must</strong> be preserved in this summation.)
1724-
1725- 2. If this simplification process results in only a single value
1726- (one <<number>> , one <<dimension>> , or one <<percentage>> ),
1727- and the value being serialized is a <a>computed value</a> or later,
1728- serialize it just as that one value,
1729- without the ''calc()'' wrapper.
1730- If this value is outside the allowed range for the context,
1731- it must be clamped to the nearest allowed value.
1732-
1733- 3. Otherwise, serialize as a ''calc()'' containing the summation,
1734- with the units ordered <a>ASCII case-insensitive</a> alphabetically,
1735- the number (if present) coming before all units,
1736- and the percentage (if present) coming after all units.
1737-
1738- <div class="example">
1739- For example, ''calc(20px + 30px)'' would serialize as ''calc(50px)'' as a specified value,
1740- or as ''50px'' as a computed value.
1741-
1742- A value like ''calc(20px + 0%)'' would serialize as ''calc(20px + 0%)'' ,
1743- maintaining both terms in the serialized value.
1744- (It's important to maintain zero-valued terms,
1745- so the ''calc()'' doesn't suddenly "change shape" in the middle of a transition
1746- when one of the values happens to have a zero value temporarily.
1747- This also removes the need to "pick a unit" when all the terms are zero.)
1748-
1749- A value like ''calc(20px + 2em)'' would serialize as ''calc(2em + 20px)'' as a specified value
1750- (maintaining both units as they're incompatible at specified-value time,
1751- but sorting them alphabetically),
1752- or as something like ''52px'' as a computed value
1753- (''em'' values are converted to absolute lengths at computed-value time,
1754- so assuming ''1em'' = ''16px'' ,
1755- they combine into ''52px'' ,
1756- which then drops the ''calc()'' wrapper.)
1757- </div>
1758-
1759- See [[!CSSOM]] for further information on serialization.
1760-
1761- <!--
1762- ████████ ███████ ██████ ██████ ██ ████████ ███ ███
1763- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
1764- ██ ██ ██ ██ ██ ██ ██ ██ ██
1765- ██ ██ ██ ██ ████ ██ ████ ██ ██████ ██ ██
1766- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
1767- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
1768- ██ ███████ ██████ ██████ ████████ ████████ ███ ███
1769- -->
1770-
1771- <h3 id="toggle-notation">
1772- Toggling Between Values: ''toggle()''</h3>
1773-
1774- The <dfn>toggle()</dfn> expression allows descendant elements
1775- to cycle over a list of values instead of inheriting the same value.
1776-
1777- <div class='example'>
1778- The following example makes <code> <em></code> elements italic in general,
1779- but makes them normal if they're inside something that's italic:
1780-
1781- <pre> em { font-style: toggle(italic, normal); }</pre>
1782- </div>
1783-
1784- <div class='example'>
1785- The following example cycles markers for nested lists,
1786- so that a top level list has ''disc'' -shaped markers,
1787- but nested lists use ''list-style-type/circle'' , then ''square'' , then ''box'' ,
1788- and then repeat through the list of marker shapes,
1789- starting again (for the 5th list deep) with ''disc'' .
1790-
1791- <pre> ul { list-style-type: toggle(disc, circle, square, box); }</pre>
1792- </div>
1793-
1794- The syntax of the ''toggle()'' expression is:
1795-
1796- <pre> toggle( <<toggle-value>> # )</pre>
1797-
1798- where <dfn><toggle-value></dfn> is any CSS value
1799- that is valid where the expression is placed,
1800- and that doesn't contain any top-level commas.
1801- If any of the values inside are not valid,
1802- then the entire ''toggle()'' expression is invalid.
1803- The ''toggle()'' expression may be used as the value of any property,
1804- but must be the only component in that property's value.
1805-
1806- The ''toggle()'' notation is not allowed to be nested; nor may it
1807- contain ''attr()'' or ''calc()'' notations.
1808- Declarations containing such constructs are invalid.
1809-
1810- <div class="example">
1811- The following ''toggle()'' examples are all invalid:
1812-
1813- <pre>
1814- background-position: 10px toggle(50px, 100px);
1815- /* toggle() must be the sole value of the property */
1816-
1817- list-style-type: toggle(disc, 50px);
1818- /* ''50px'' isn't a valid value of 'list-style-type' */
1819- </pre>
1820- </div>
1821-
1822- To determine the computed value of ''toggle()'' ,
1823- first evaluate each argument as if it were the sole value of the property in which ''toggle()'' is placed
1824- to determine the computed value that each represents,
1825- called <var> C<sub> n</sub></var> for the <var> n</var> -th argument to ''toggle()'' .
1826- Then, compare the property's <a>inherited value</a>
1827- with each <var> C<sub> n</sub></var> .
1828- For the earliest <var> C<sub> n</sub></var> that matches the <a>inherited value</a> ,
1829- the computed value of ''toggle()'' is <var> C<sub> n+1</sub></var> .
1830- If the match was the last argument in the list,
1831- or there was no match,
1832- the computed value of ''toggle()'' is the computed value that the first argument represents.
1833-
1834-
1835- Note: This means that repeating values in a ''toggle()'' short-circuits the list.
1836- For example ''toggle(1em, 2em, 1em, 4em)'' will be equivalent to ''toggle(1em, 2em)'' .
1837-
1838- <!-- Issue: Should this short-circuiting affect the computed value? -->
1839-
1840- Note: That ''toggle()'' explicitly looks at the computed value of the parent,
1841- so it works even on non-inherited properties.
1842- This is similar to the ''inherit'' keyword,
1843- which works even on non-inherited properties.
1844-
1845- Note: That the <a href="https://www.w3.org/TR/CSS21/cascade.html#computed-value">computed value</a> of a property is an abstract set of values,
1846- not a particular serialization [[!CSS21]] ,
1847- so comparison between computed values should always be unambiguous and have the expected result.
1848- For example,
1849- a Level 2 <a property spec=css21>background-position</a> computed value
1850- is just two offsets, each represented as an absolute length or a percentage,
1851- so the declarations ''background-position: top center'' and ''background-position: 50% 0%''
1852- produce identical computed values.
1853- If the "Computed Value" line of a property definition seems to define something ambiguous or overly strict,
1854- please <a href="#status">provide feedback</a> so we can fix it.
1855-
1856- If ''toggle()'' is used on a <a>shorthand property</a> ,
1857- it sets each of its longhands to a ''toggle()'' value
1858- with arguments corresponding to what the longhand would have recieved
1859- had each of the original ''toggle()'' arguments been the sole value of the <a>shorthand</a> .
1860-
1861- <div class="example">
1862- For example, the following shorthand declaration:
1863-
1864- <pre> margin: toggle(1px 2px, 4px, 1px 5px 3px);</pre>
1865-
1866- is equivalent to the following longhand declarations:
1867-
1868- <pre>
1869- margin-top: toggle(1px, 4px, 1px);
1870- margin-right: toggle(2px, 4px, 5px);
1871- margin-bottom: toggle(1px, 4px, 3px);
1872- margin-left: toggle(2px, 4px, 5px);
1873- </pre>
1874-
1875- Note that, since ''1px'' appears twice in the top and bottom margins,
1876- they will cycle between only two values
1877- while the left and right margins cycle through three.
1878- In other words, the declarations above will yield the same computed values
1879- as the longhand declarations below:
1880-
1881- <pre>
1882- margin-top: toggle(1px, 3px);
1883- margin-right: toggle(2px, 4px, 5px);
1884- margin-bottom: toggle(1px, 3px);
1885- margin-left: toggle(2px, 4px, 5px);
1886- </pre>
1887-
1888- which may not be what was intended.
1889- </div>
1688+ The serialization of ''calc()'' values is undefined in this level.
18901689
18911690<!--
18921691 ███ ████████ ████████ ████████ ███ ███
@@ -1942,10 +1741,6 @@ Ian's proposal:
19421741 If it's absent,
19431742 the default value for the given <<type-or-unit>> (from the list below) is implied.
19441743
1945- Note: Unlike <<toggle-value>> s,
1946- an ''attr()'' <<attr-fallback>> value may contain top-level commas,
1947- as it is always the last argument in the functional notation.
1948-
19491744 The attr() expression is only valid if:
19501745
19511746 <ul>
@@ -2255,19 +2050,16 @@ Changes</h2>
22552050 Changes since the <a href="https://www.w3.org/TR/2015/CR-css-values-3-20150611/">11 June 2015 Candidate Recomendation</a> are:
22562051
22572052 <ul>
2053+ <li> Dropped ''toggle()'' for lack of implementations.
22582054 <li> Allow zero angles to be represented as ''0'' .
22592055 (Change due to Web-compatibility constraints in transform and gradient syntaxes.)
22602056 <li> Defined <a href="#local-urls">special handling</a> for fragment URLs.
22612057 <li> Defined an empty <<url>> resolves to an invalid resource.
2262- <li> Defined <a href="#calc-serialize">serialization of <css>calc()</css> values</a> .
22632058 <li> Defined <a>compatible units</a> and <a>canonical units</a> for serialization.
22642059 <li> Defined case-sensitivity of ''url()'' attribute argument to match attribute selectors.
22652060 <li> Added definition of <<ident>> notation to definition of <a>identifiers</a> .
22662061 <li> Added <<length-percentage>> as a shorthand for <<length>> | <<percentage>> ,
22672062 along with equivalent productions for angles, numbers, times, and frequencies.
2268- <!--
2269- <li> Added the ''vi'' and ''vb'' units.
2270- -->
22712063 <li> Various clarifications and editorial improvements.
22722064 </ul>
22732065
0 commit comments