Skip to content

Commit 83bd211

Browse files
committed
[css-flexbox] Move definitions of flex-basis keywords into shorthand section, to keep the whole definition together.
1 parent 219a955 commit 83bd211

2 files changed

Lines changed: 189 additions & 186 deletions

File tree

css-flexbox/Overview.bs

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,16 +1448,33 @@ The 'flex' Shorthand</h3>
14481448
and specifies the <dfn dfn>flex basis</dfn>:
14491449
the initial <a>main size</a> of the <a>flex item</a>,
14501450
before free space is distributed according to the flex factors.
1451-
It takes the same values as the 'width' property
1452-
(except ''flex-basis/auto'' is treated differently)
1453-
and an additional ''content'' keyword.
1454-
When omitted from the 'flex' shorthand, its specified value is ''0''.
1451+
It accepts the same values as the 'width' and 'height' properties
1452+
(except that ''flex-basis/auto'' is treated differently)
1453+
plus the ''content'' keyword:
1454+
1455+
<dl dfn-type=value dfn-for=flex-basis>
1456+
<dt><dfn>auto</dfn>
1457+
<dd>
1458+
When specified on a <a>flex item</a>, the ''flex-basis/auto'' keyword
1459+
retrieves the value of the <a>main size property</a> as the used 'flex-basis'.
1460+
If that value is itself ''auto'', then the used value is ''flex-basis/content''.
14551461

1456-
If the specified 'flex-basis' is ''flex-basis/auto'',
1457-
the used <a>flex basis</a> is the computed value of the flex item’s <a>main size property</a>.
1458-
If that value is itself ''width/auto'',
1459-
then the used <a>flex basis</a> is automatically-determined based on its content
1460-
(i.e. sized as for ''content'').
1462+
<dt><dfn>content</dfn>
1463+
<dd>
1464+
Indicates automatic sizing, based on the <a>flex item</a>’s content.
1465+
1466+
Note: Note that this value was not present in the initial release of Flexible Box Layout,
1467+
and thus some older implementations will not support it.
1468+
The equivalent effect can be had by using ''flex/auto''
1469+
together with a main size ('width' or 'height') of ''width/auto''.
1470+
1471+
<dt><<'width'>>
1472+
<dd>
1473+
For all other values,
1474+
'flex-basis' is resolved the same way as for 'width' and 'height'.
1475+
</dl>
1476+
1477+
When omitted from the 'flex' shorthand, its specified value is ''0''.
14611478

14621479
<dt><dfn>none</dfn>
14631480
<dd>
@@ -1489,11 +1506,12 @@ The 'flex' Shorthand</h3>
14891506
with a unit or precede it by two flex factors.
14901507

14911508
<h4 id='flex-common'>
1492-
Common Values of 'flex'</h4>
1509+
Basic Values of 'flex'</h4>
14931510

14941511
<em>This section is informative.</em>
14951512

1496-
The list below summarizes the effects of the most common 'flex' values:
1513+
The list below summarizes the effects of the four 'flex' values
1514+
that respresent most commonly-desired effects:
14971515

14981516
<dl>
14991517
<dt id="flex-initial">''flex: initial''
@@ -1617,31 +1635,18 @@ The 'flex-basis' property</h4>
16171635
The 'flex-basis' property sets the <a>flex basis</a>.
16181636
It accepts the same values as the 'width' and 'height' property, plus ''content''.
16191637

1620-
<dl dfn-type=value dfn-for=flex-basis>
1621-
<dt><dfn>auto</dfn>
1622-
<dd>When specified on a <a>flex item</a>, the ''flex-basis/auto'' keyword
1623-
retrieves the value of the <a>main size property</a> as the used 'flex-basis'.
1624-
If that value is also ''auto'', then the used value is ''flex-basis/content''.
1625-
1626-
<dt><dfn>content</dfn>
1627-
<dd>Indicates automatic sizing, based on the <a>flex item</a>’s content.
1628-
1629-
Note: Note that this value was not present in the initial release of Flexible Box Layout,
1630-
and thus some older implementations will not support it.
1631-
The equivalent effect can be had by using ''flex/auto''
1632-
together with a main size ('width' or 'height') of ''width/auto''.
1633-
1634-
<dt><<'width'>>
1635-
<dd>For all other values,
1636-
'flex-basis' is resolved the same way as 'width' in horizontal writing modes [[!CSS21]]:
1637-
percentage values of 'flex-basis' are resolved against
1638-
the flex item's containing block, i.e. its flex container,
1639-
and if that containing block's size is <a>indefinite</a>,
1640-
the result is the same as a <a>main size</a> of <a value for=width>auto</a>.
1641-
Similarly, 'flex-basis' determines the size of the content box,
1642-
unless otherwise specified
1643-
such as by 'box-sizing' [[CSS3UI]].
1644-
</dl>
1638+
1639+
For all values other than ''flex-basis/auto'' and ''content'' (defined above),
1640+
'flex-basis' is resolved the same way as 'width' in horizontal writing modes [[!CSS21]].
1641+
For example, percentage values of 'flex-basis' are resolved against
1642+
the flex item's containing block (i.e. its flex container)
1643+
and if that containing block's size is <a>indefinite</a>,
1644+
the result is the same as a <a>main size</a> of <a value for=width>auto</a>
1645+
(which in this case is treated as ''content'').
1646+
As another corollary,
1647+
'flex-basis' determines the size of the content box,
1648+
unless otherwise specified
1649+
such as by 'box-sizing' [[CSS3UI]].
16451650

16461651
<h2 id='alignment'>
16471652
Alignment</h2>

0 commit comments

Comments
 (0)