Skip to content

Commit 15713c8

Browse files
committed
[css-flexbox] Clarifications to visibility: collapse
1 parent b5135d9 commit 15713c8

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

css-flexbox/Overview.bs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ Collapsed Items</h3>
704704
but leaves behind a "strut" that keeps the flex line's cross-size stable.
705705
Thus, if a flex container has only one flex line,
706706
dynamically collapsing or uncollapsing items
707-
is guaranteed to have no effect on the flex container's <a>cross size</a>
707+
may change the <a>flex container</a>'s <a>main size</a>, but
708+
is guaranteed to have no effect on its <a>cross size</a>
708709
and won't cause the rest of the page's layout to "wobble".
709710
Flex line wrapping <em>is</em> re-done after collapsing, however,
710711
so the cross-size of a flex container with multiple lines might or might not change.
@@ -724,7 +725,7 @@ Collapsed Items</h3>
724725
is in a collapsed section.
725726

726727
<figure>
727-
<figcaption>Sample rendering for example code below</figcaption>
728+
<figcaption>Sample live rendering for example code below</figcaption>
728729
<div id="visibility-collapse-example">
729730
<!-- No, don't look at this source code, look at the other source code. -->
730731
<nav>
@@ -750,7 +751,12 @@ Collapsed Items</h3>
750751
</ul>
751752
</nav>
752753
<article>
753-
Interesting Stuff to Read
754+
Hover over the menu to the left:
755+
each section expands to show its sub-items.
756+
In order to keep the sidebar width (and this main area width) stable,
757+
''visibility: collapse'' is used instead of ''display: none''.
758+
This results in a sidebar that is always wide enough for the word “Architecture”,
759+
even though it is not always visible.
754760
</article>
755761
</div>
756762
</figure>

css-flexbox/Overview.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,8 @@ <h3 class="heading settled" data-level="4.4" id="visibility-collapse"><span clas
13081308
but leaves behind a "strut" that keeps the flex line’s cross-size stable.
13091309
Thus, if a flex container has only one flex line,
13101310
dynamically collapsing or uncollapsing items
1311-
is guaranteed to have no effect on the flex container’s <a data-link-type="dfn" href="#cross-size">cross size</a>
1311+
may change the <a data-link-type="dfn" href="#flex-container">flex container</a>’s <a data-link-type="dfn" href="#main-size">main size</a>, but
1312+
is guaranteed to have no effect on its <a data-link-type="dfn" href="#cross-size">cross size</a>
13121313
and won’t cause the rest of the page’s layout to "wobble".
13131314
Flex line wrapping <em>is</em> re-done after collapsing, however,
13141315
so the cross-size of a flex container with multiple lines might or might not change.</p>
@@ -1322,7 +1323,7 @@ <h3 class="heading settled" data-level="4.4" id="visibility-collapse"><span clas
13221323
still operate on collapsed items.</p>
13231324

13241325

1325-
<div class="example" id="example-ab124732"><a class="self-link" href="#example-ab124732"></a>
1326+
<div class="example" id="example-20ddca23"><a class="self-link" href="#example-20ddca23"></a>
13261327
In the following example,
13271328
a sidebar is sized to fit its content.
13281329
<a class="css" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visufx.html#propdef-visibility">visibility: collapse</a> is used to dynamically hide parts of a navigation sidebar
@@ -1332,7 +1333,7 @@ <h3 class="heading settled" data-level="4.4" id="visibility-collapse"><span clas
13321333

13331334
<figure>
13341335

1335-
<figcaption>Sample rendering for example code below</figcaption>
1336+
<figcaption>Sample live rendering for example code below</figcaption>
13361337

13371338

13381339
<div id="visibility-collapse-example">
@@ -1388,7 +1389,12 @@ <h3 class="heading settled" data-level="4.4" id="visibility-collapse"><span clas
13881389

13891390

13901391
<article>
1391-
Interesting Stuff to Read
1392+
Hover over the menu to the left:
1393+
each section expands to show its sub-items.
1394+
In order to keep the sidebar width (and this main area width) stable,
1395+
<a class="css" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visufx.html#propdef-visibility">visibility: collapse</a> is used instead of <a class="css" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display: none</a>.
1396+
This results in a sidebar that is always wide enough for the word “Architecture”,
1397+
even though it is not always visible.
13921398
</article>
13931399

13941400

0 commit comments

Comments
 (0)