Skip to content

Commit 6dbcca5

Browse files
committed
[css-flexbox] Add missing notes from min-size auto stuff.
1 parent 3a21311 commit 6dbcca5

2 files changed

Lines changed: 75 additions & 19 deletions

File tree

css-flexbox/Overview.bs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,27 @@ Implied Minimum Size of Flex Items</h3>
815815
this keyword computes to ''0''
816816
(unless otherwise defined by a future specification).
817817
</dl>
818+
819+
<div class="note" id="min-size-opt">
820+
<p>
821+
Note that while a content-based minimum size is often appropriate,
822+
and helps prevent content from overlapping or spilling outside its container,
823+
in some cases it is not:
824+
825+
<p>
826+
In particular, if flex sizing is being used for a major content area of a document,
827+
it is better to set an explicit font-relative minimum width such as ''min-width: 12em''.
828+
A content-based minimum width could result in a large table or large image
829+
stretching the size of the entire content area into an overflow zone,
830+
and thereby making lines of text gratuitously long and hard to read.
831+
832+
<p>
833+
Note also, when content-based sizing is used on an item with large amounts of content,
834+
the layout engine must traverse all of this content before finding its minimum size,
835+
whereas if the author sets an explicit minimum, this is not necessary.
836+
(For items with small amounts of content, however,
837+
this traversal is trivial and therefore not a performance concern.)
838+
</div>
818839
</div>
819840

820841

@@ -1394,15 +1415,11 @@ Common Values of 'flex'</h3>
13941415
their sizes will be proportional to the specified flex factor.
13951416
</dl>
13961417

1397-
<div class='note'>
1398-
Note that, because flex items typically can shrink,
1399-
it is often recommended that a minimum main size be set
1400-
(with 'min-width' or 'min-height')
1401-
to prevent them from shrinking too small to fit their contents.
1402-
This problem is especially common with horizontal navigation or toolbars.
1403-
1404-
<pre>nav li { flex: 1; min-width: min-content; /* Don't overflow */}</pre>
1405-
</div>
1418+
<p>
1419+
By default, flex items won't shrink below their minimum content size
1420+
(the length of the longest word or fixed-size element).
1421+
To change this, set the 'min-width' or 'min-height' property.
1422+
(See <a href="#min-size-auto">Implied Minimum Size of Flex Items</a>.)
14061423

14071424
<h3 id='flex-components'>
14081425
Components of Flexibility</h3>

css-flexbox/Overview.html

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ <h3 class="heading settled heading" data-level=4.4 id=visibility-collapse><span
928928
<h3 class="heading settled heading" data-level=4.5 id=min-size-auto><span class=secno>4.5 </span><span class=content>
929929
Implied Minimum Size of Flex Items</span><a class=self-link href=#min-size-auto></a></h3>
930930

931-
<div class=issue id=issue-7f3b7c8c><a class=self-link href=#issue-7f3b7c8c></a>
931+
<div class=issue id=issue-840085c1><a class=self-link href=#issue-840085c1></a>
932932
This section is under discussion. See <a href=issues-cr-2012#issue-19>Issue </a>.
933933

934934
<p> To provide a more reasonable default minimum size for <a data-link-type=dfn href=#flex-item title="flex items">flex items</a>,
@@ -951,6 +951,27 @@ <h3 class="heading settled heading" data-level=4.5 id=min-size-auto><span class=
951951
this keyword computes to <span class=css data-link-type=maybe title=0>0</span>
952952
(unless otherwise defined by a future specification).
953953
</dl>
954+
955+
<div class=note id=min-size-opt><a class=self-link href=#min-size-opt></a>
956+
<p>
957+
Note that while a content-based minimum size is often appropriate,
958+
and helps prevent content from overlapping or spilling outside its container,
959+
in some cases it is not:
960+
961+
<p>
962+
In particular, if flex sizing is being used for a major content area of a document,
963+
it is better to set an explicit font-relative minimum width such as <a class=css data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-width title=min-width>min-width: 12em</a>.
964+
A content-based minimum width could result in a large table or large image
965+
stretching the size of the entire content area into an overflow zone,
966+
and thereby making lines of text gratuitously long and hard to read.
967+
968+
<p>
969+
Note also, when content-based sizing is used on an item with large amounts of content,
970+
the layout engine must traverse all of this content before finding its minimum size,
971+
whereas if the author sets an explicit minimum, this is not necessary.
972+
(For items with small amounts of content, however,
973+
this traversal is trivial and therefore not a performance concern.)
974+
</div>
954975
</div>
955976

956977

@@ -1475,14 +1496,11 @@ <h3 class="heading settled heading" data-level=7.2 id=flex-common><span class=se
14751496
their sizes will be proportional to the specified flex factor.
14761497
</dl>
14771498

1478-
<div class=note>
1479-
Note that, because flex items typically can shrink,
1480-
it is often recommended that a minimum main size be set
1481-
(with <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-width title=min-width>min-width</a> or <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-height title=min-height>min-height</a>)
1482-
to prevent them from shrinking too small to fit their contents.
1483-
This problem is especially common with horizontal navigation or toolbars.
1484-
1485-
<pre>nav li { flex: 1; min-width: min-content; /* Don’t overflow */}</pre> </div>
1499+
<p>
1500+
By default, flex items won’t shrink below their minimum content size
1501+
(the length of the longest word or fixed-size element).
1502+
To change this, set the <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-width title=min-width>min-width</a> or <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-height title=min-height>min-height</a> property.
1503+
(See <a href=#min-size-auto>Implied Minimum Size of Flex Items</a>.)
14861504

14871505
<h3 class="heading settled heading" data-level=7.3 id=flex-components><span class=secno>7.3 </span><span class=content>
14881506
Components of Flexibility</span><a class=self-link href=#flex-components></a></h3>
@@ -3430,7 +3448,28 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
34303448
this keyword computes to <span class=css data-link-type=maybe title=0>0</span>
34313449
(unless otherwise defined by a future specification).
34323450
</dl>
3433-
<a href=#issue-7f3b7c8c></a></div>
3451+
3452+
<div class=note>
3453+
<p>
3454+
Note that while a content-based minimum size is often appropriate,
3455+
and helps prevent content from overlapping or spilling outside its container,
3456+
in some cases it is not:
3457+
3458+
<p>
3459+
In particular, if flex sizing is being used for a major content area of a document,
3460+
it is better to set an explicit font-relative minimum width such as <a class=css data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-min-width title=min-width>min-width: 12em</a>.
3461+
A content-based minimum width could result in a large table or large image
3462+
stretching the size of the entire content area into an overflow zone,
3463+
and thereby making lines of text gratuitously long and hard to read.
3464+
3465+
<p>
3466+
Note also, when content-based sizing is used on an item with large amounts of content,
3467+
the layout engine must traverse all of this content before finding its minimum size,
3468+
whereas if the author sets an explicit minimum, this is not necessary.
3469+
(For items with small amounts of content, however,
3470+
this traversal is trivial and therefore not a performance concern.)
3471+
</div>
3472+
<a href=#issue-840085c1></a></div>
34343473

34353474

34363475
<div class=issue>

0 commit comments

Comments
 (0)