@@ -1720,6 +1720,17 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
1720
1720
< pre > em { font-style: toggle(italic, normal); }</ pre >
1721
1721
</ div >
1722
1722
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
+
1723
1734
< p > The syntax of the ‘< a href ="#toggle "> < code
1724
1735
class =css > toggle()</ code > </ a > ’ expression is:
1725
1736
@@ -1730,18 +1741,25 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
1730
1741
any of the values inside are not valid, then the entire ‘< a
1731
1742
href ="#toggle "> < code class =css > toggle()</ code > </ a > ’ expression is
1732
1743
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.
1738
1746
1739
1747
< p > The ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’
1740
1748
notation is not allowed to be nested; nor may it contain ‘< a
1741
1749
href ="#attr "> < code class =css > attr()</ code > </ a > ’ or ‘< a
1742
1750
href ="#calc "> < code class =css > calc()</ code > </ a > ’ notations. Declarations
1743
1751
containing such constructs are invalid.
1744
1752
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
+
1745
1763
< p > To determine the computed value of ‘< a href ="#toggle "> < code
1746
1764
class =css > toggle()</ code > </ a > ’, first evaluate each argument as if it
1747
1765
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
1758
1776
class =css > toggle()</ code > </ a > ’ is the computed value that the first
1759
1777
argument represents.
1760
1778
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
-
1773
1779
< p class =note > Note that ‘< a href ="#toggle "> < code
1774
1780
class =css > toggle()</ code > </ a > ’ explicitly looks at the computed value of
1775
1781
the parent, so it works even on non-inherited properties. This is similar
0 commit comments