@@ -1720,6 +1720,17 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
17201720 < pre > em { font-style: toggle(italic, normal); }</ pre >
17211721 </ div >
17221722
1723+ < div class =example >
1724+ < p > The following example cycles markers for nested lists, so that a top
1725+ level list has ‘< code class =css > disc</ code > ’-shaped markers, but
1726+ nested lists use ‘< code class =css > circle</ code > ’, then ‘< code
1727+ class =css > square</ code > ’, then ‘< code class =css > box</ code > ’, and
1728+ then repeat through the list of marker shapes, starting again (for the
1729+ 5th list deep) with ‘< code class =css > disc</ code > ’.
1730+
1731+ < pre > ul { list-style-type: toggle(disc, circle, square, box); }</ pre >
1732+ </ div >
1733+
17231734 < p > The syntax of the ‘< a href ="#toggle "> < code
17241735 class =css > toggle()</ code > </ a > ’ expression is:
17251736
@@ -1730,18 +1741,25 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
17301741 any of the values inside are not valid, then the entire ‘< a
17311742 href ="#toggle "> < code class =css > toggle()</ code > </ a > ’ expression is
17321743 invalid. The ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’
1733- expression may be used as the value of any property (but must be the only
1734- component in that property's value).
1735-
1736- < p class =note > Note that because toggled values are separated by commas,
1737- they cannot themselves include top-level commas.
1744+ expression may be used as the value of any property, but must be the only
1745+ component in that property's value.
17381746
17391747 < p > The ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’
17401748 notation is not allowed to be nested; nor may it contain ‘< a
17411749 href ="#attr "> < code class =css > attr()</ code > </ a > ’ or ‘< a
17421750 href ="#calc "> < code class =css > calc()</ code > </ a > ’ notations. Declarations
17431751 containing such constructs are invalid.
17441752
1753+ < div class =example > The following ‘< a href ="#toggle "> < code
1754+ class =css > toggle()</ code > </ a > ’ examples are all invalid:
1755+ < pre >
1756+ background-position: 10px toggle(50px, 100px);
1757+ /* toggle() must be the sole value of the property */
1758+
1759+ list-style-type: toggle(disc, 50px);
1760+ /* ''50px'' isn't a valid value of 'list-style-type' */</ pre >
1761+ </ div >
1762+
17451763 < p > To determine the computed value of ‘< a href ="#toggle "> < code
17461764 class =css > toggle()</ code > </ a > ’, first evaluate each argument as if it
17471765 were the sole value of the property in which ‘< a href ="#toggle "> < code
@@ -1758,18 +1776,6 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
17581776 class =css > toggle()</ code > </ a > ’ is the computed value that the first
17591777 argument represents.
17601778
1761- < div class =example >
1762- < p > The following example cycles markers for nested lists, so that a top
1763- level list has < code > disc</ code > -shaped markers, but nested lists use
1764- < code > circle</ code > , then < code > square</ code > , then < code > box</ code > , and
1765- then repeat through the list of marker shapes, starting again (for the
1766- 5th list deep) with < code > disc</ code > .
1767-
1768- < pre >
1769- ul { list-style-type: disc; }
1770- ul ul { list-style-type: toggle(disc, circle, square, box); }</ pre >
1771- </ div >
1772-
17731779 < p class =note > Note that ‘< a href ="#toggle "> < code
17741780 class =css > toggle()</ code > </ a > ’ explicitly looks at the computed value of
17751781 the parent, so it works even on non-inherited properties. This is similar
0 commit comments