Skip to content

Commit 26ea51b

Browse files
authored
Merge pull request #4024 from lahmatiy/patch-5
[css-values-4] Fix toggle() example
2 parents 5d679eb + 1d1c046 commit 26ea51b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

css-values-4/Overview.bs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,27 +2053,27 @@ Toggling Between Values: ''toggle()''</h3>
20532053
<div class="example">
20542054
For example, the following shorthand declaration:
20552055

2056-
<pre>margin: toggle(1px 2px, 4px, 1px 5px 3px);</pre>
2056+
<pre>margin: toggle(1px 2px, 4px, 1px 5px 4px);</pre>
20572057

20582058
is equivalent to the following longhand declarations:
20592059

20602060
<pre>
20612061
margin-top: toggle(1px, 4px, 1px);
20622062
margin-right: toggle(2px, 4px, 5px);
2063-
margin-bottom: toggle(1px, 4px, 3px);
2063+
margin-bottom: toggle(1px, 4px, 4px);
20642064
margin-left: toggle(2px, 4px, 5px);
20652065
</pre>
20662066

2067-
Note that, since ''1px'' appears twice in the top and bottom margins,
2067+
Note that, since ''1px'' appears twice in the top margin and ''4px'' appears twice in bottom margin,
20682068
they will cycle between only two values
20692069
while the left and right margins cycle through three.
20702070
In other words, the declarations above will yield the same computed values
20712071
as the longhand declarations below:
20722072

20732073
<pre>
2074-
margin-top: toggle(1px, 3px);
2074+
margin-top: toggle(1px, 4px);
20752075
margin-right: toggle(2px, 4px, 5px);
2076-
margin-bottom: toggle(1px, 3px);
2076+
margin-bottom: toggle(1px, 4px);
20772077
margin-left: toggle(2px, 4px, 5px);
20782078
</pre>
20792079

0 commit comments

Comments
 (0)