Skip to content

Commit 57ad9d4

Browse files
committed
Rearrangements of prose in 'flex' definition, to use <dl> and put everything interesting all in one place for authors.
1 parent 6f9911c commit 57ad9d4

2 files changed

Lines changed: 191 additions & 125 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 118 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@
206206

207207
<h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1>
208208

209-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 6 August 2012</h2>
209+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 7 August 2012</h2>
210210

211211
<dl>
212212
<dt>This version:
213-
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120806/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120806/</a>-->
213+
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120807/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120807/</a>-->
214214

215215

216216
<dd><a
@@ -1974,40 +1974,87 @@ <h3 id=flex-property><span class=secno>7.1. </span> The ‘<a
19741974
not a <a href="#flex-item"><i>flex item</i></a>, ‘<a href="#flex"><code
19751975
class=property>flex</code></a>’ has no effect.
19761976

1977-
<p> The <var>&lt;<a href="#flex-basis-property"><code
1978-
class=property>flex-basis</code></a>></var> component sets the <dfn
1979-
id=flex-basis>flex basis</dfn>, which is the initial <a
1980-
href="#main-size"><i>main size</i></a> of the <a href="#flex-item"><i>flex
1981-
item</i></a>, before free space is distributed according to the flex
1982-
ratios. If omitted, the <a href="#flex-basis"><i>flex basis</i></a>
1983-
defaults to the length zero. <span class=note>Note that this is different
1984-
from the initial value of ‘<a href="#flex-basis0"><code
1985-
class=property>flex-basis</code></a>’, which is <a
1986-
href="#flex-basis-auto"><code class=css>auto</code></a>.</span> Zero
1987-
values for the <var>&lt;&apos;flex-basis&apos;></var> component must be
1988-
specified with a unit. Unitless zero will either be interpreted as one of
1989-
the flex ratios, or will make the declaration invalid.
1990-
1991-
<p> The <var>&lt;<a href="#flex-grow"><code
1992-
class=property>flex-grow</code></a>></var> and <var>&lt;<a
1993-
href="#flex-basis-property"><code
1994-
class=property>flex-shrink</code></a>></var> components set the <dfn
1995-
id=flex-grow-ratio>flex grow ratio</dfn> and <dfn
1996-
id=flex-shrink-ratio>flex shrink ratio</dfn>, which determine how much the
1997-
<a href="#flex-item"><i>flex item</i></a> will grow or shrink relative to
1998-
the rest of the <a href="#flex-item"><i>flex items</i></a> in the flex
1999-
container when free space is distributed. When omitted, they are set to
2000-
<code class=css>1</code>’. <span class=note>Note that this is
2001-
different from the initial value of ‘<a href="#flex-grow"><code
2002-
class=property>flex-grow</code></a>’, which is ‘<code
2003-
class=css>0</code>’.</span>
2004-
2005-
<p id=flex-none> The keyword ‘<code class=property>none</code>
2006-
computes to ‘<code class=css>0 0 auto</code>’. <figure> <img
2007-
height=240 src="images/rel-vs-abs-flex.svg" width=504> <figcaption> A
2008-
diagram showing the difference between "absolute" flex (starting from a
2009-
basis of zero) and "relative" flex (starting from a basis of the item's
2010-
content size). </figcaption> </figure>
1977+
<dl>
1978+
<dt><var>&lt;‘<a href="#flex-grow"><code
1979+
class=property>flex-grow</code></a>></var>
1980+
1981+
<dd>
1982+
<p> This <var>&lt;number></var> component sets ‘<a
1983+
href="#flex-grow"><code class=property>flex-grow</code></a><a
1984+
href="#flex-components">longhand</a> and specifies the <dfn
1985+
id=flex-grow-ratio>flex grow ratio</dfn>, which determines how much the
1986+
<a href="#flex-item"><i>flex item</i></a> will grow relative to the rest
1987+
of the <a href="#flex-item"><i>flex items</i></a> in the flex container
1988+
when positive free space is distributed. When omitted, it is set to
1989+
<code class=css>1</code>’.
1990+
1991+
<dt><var>&lt;‘<a href="#flex-shrink"><code
1992+
class=property>flex-shrink</code></a>></var>
1993+
1994+
<dd>
1995+
<p> This <var>&lt;number></var> component sets ‘<a
1996+
href="#flex-shrink"><code class=property>flex-shrink</code></a><a
1997+
href="#flex-components">longhand</a> and specifies the <dfn
1998+
id=flex-shrink-ratio>flex shrink ratio</dfn>, which determines how much
1999+
the <a href="#flex-item"><i>flex item</i></a> will shrink relative to
2000+
the rest of the <a href="#flex-item"><i>flex items</i></a> in the flex
2001+
container when negative free space is distributed. When omitted, it is
2002+
set to ‘<code class=css>1</code>’.
2003+
2004+
<dt><var>&lt;‘<a href="#flex-basis-propdef"><code
2005+
class=property>flex-basis</code></a>></var>
2006+
2007+
<dd>
2008+
<p> This component, which takes the same values as the ‘<code
2009+
class=property>width</code>’ property, sets the ‘<a
2010+
href="#flex-basis-propdef"><code class=property>flex-basis</code></a>
2011+
<a href="#flex-components">longhand</a> and specifies the <dfn
2012+
id=flex-basis>flex basis</dfn>: the initial <a href="#main-size"><i>main
2013+
size</i></a> of the <a href="#flex-item"><i>flex item</i></a>, before
2014+
free space is distributed according to the flex ratios. When omitted
2015+
from the ‘<a href="#flex"><code class=property>flex</code></a>
2016+
shorthand, its specified value is the length zero.
2017+
2018+
<p class=note> If not omitted, a zero
2019+
<var>&lt;&apos;flex-basis&apos;></var> component must be either
2020+
specified with a unit or preceded by both flex ratios. Otherwise it will
2021+
either be interpreted as one of the flex ratios, or will make the
2022+
declaration invalid.
2023+
2024+
<p> If the specified ‘<a href="#flex-basis-propdef"><code
2025+
class=property>flex-basis</code></a>’ is <a
2026+
href="#flex-basis-auto"><code class=css>auto</code></a>, the used
2027+
<a href="#flex-basis"><i>flex basis</i></a> is the value of the
2028+
element's <a href="#main-size-property"><i>main size property</i></a>.
2029+
(This can itself be the keyword ‘<code class=css>auto</code>’, which
2030+
sizes the element based on its contents.) <figure> <img height=240
2031+
src="images/rel-vs-abs-flex.svg" width=504> <figcaption> A diagram
2032+
showing the difference between "absolute" flex (starting from a basis of
2033+
zero) and "relative" flex (starting from a basis of the item's content
2034+
size). The three items have flex ratios of ‘<code
2035+
class=css>1</code>’, ‘<code class=css>1</code>’, and ‘<code
2036+
class=css>2</code>’, respectively. </figcaption> </figure>
2037+
2038+
<dt><dfn id=flex-none><code class=css>none</code></dfn>
2039+
2040+
<dd>
2041+
<p>The keyword ‘<a href="#flex-none"><code
2042+
class=property>none</code></a>’ computes to ‘<code class=css>0 0
2043+
auto</code>’.
2044+
</dl>
2045+
2046+
<p> The initial values of the ‘<a href="#flex"><code
2047+
class=property>flex</code></a>’ components are equivalent to <a
2048+
href="#flex-initial"><code class=css>flex: 0 1 auto</code></a>.
2049+
2050+
<p class=note> Note that the initial values of ‘<a
2051+
href="#flex-grow"><code class=property>flex-grow</code></a>’ and ‘<a
2052+
href="#flex-basis-propdef"><code class=property>flex-basis</code></a>
2053+
are different from their defaults when omitted in the ‘<a
2054+
href="#flex"><code class=property>flex</code></a>’ shorthand. This so
2055+
that the ‘<a href="#flex"><code class=property>flex</code></a>
2056+
shorthand can better accommodate the most <a href="#flex-common">common
2057+
cases</a>.
20112058

20122059
<h3 id=flex-common><span class=secno>7.2. </span> Common Values of ‘<a
20132060
href="#flex"><code class=property>flex</code></a></h3>
@@ -2018,9 +2065,9 @@ <h3 id=flex-common><span class=secno>7.2. </span> Common Values of ‘<a
20182065
href="#flex"><code class=property>flex</code></a>’ values:
20192066

20202067
<dl>
2021-
<dt id=flex-initial><code class=css>flex: initial</code>
2068+
<dt id=flex-initial><code class=css>flex: 0 auto</code>
20222069

2023-
<dt><code class=css>flex: 0 auto</code>
2070+
<dt><code class=css>flex: initial</code>
20242071

20252072
<dd> Equivalent to ‘<code class=css>flex: 0 1 auto</code>’. (This is
20262073
the initial value.) Sizes the item based on the ‘<code
@@ -2075,13 +2122,14 @@ <h3 id=flex-common><span class=secno>7.2. </span> Common Values of ‘<a
20752122
<h3 id=flex-components><span class=secno>7.3. </span> Components of
20762123
Flexibility</h3>
20772124

2078-
<p> Individual components of flexibility can be controlled by separate
2079-
properties.
2125+
<p> Individual components of flexibility can be controlled by independent
2126+
longhand properties.
20802127

20812128
<p class=note> Authors are encouraged to control flexibility using the
20822129
<a href="#flex"><code class=property>flex</code></a>’ shorthand
20832130
rather than with component properties, as the shorthand correctly resets
2084-
any unspecified components to accommodate common uses.
2131+
any unspecified components to accommodate <a href="#flex-common">common
2132+
uses</a>.
20852133

20862134
<h4 id=flex-grow-property><span class=secno>7.3.1. </span> The ‘<a
20872135
href="#flex-grow"><code class=property>flex-grow</code></a>’ property</h4>
@@ -2199,14 +2247,15 @@ <h4 id=flex-shrink-property><span class=secno>7.3.2. </span> The ‘<a
21992247
are invalid.
22002248

22012249
<h4 id=flex-basis-property><span class=secno>7.3.3. </span> The ‘<a
2202-
href="#flex-basis0"><code class=property>flex-basis</code></a>’ property</h4>
2250+
href="#flex-basis-propdef"><code class=property>flex-basis</code></a>
2251+
property</h4>
22032252

22042253
<table class=propdef>
22052254
<tbody>
22062255
<tr>
22072256
<th>Name:
22082257

2209-
<td><dfn id=flex-basis0>flex-basis</dfn>
2258+
<td><dfn id=flex-basis-propdef>flex-basis</dfn>
22102259

22112260
<tr>
22122261
<th><a href="#values">Value</a>:
@@ -2257,32 +2306,23 @@ <h4 id=flex-basis-property><span class=secno>7.3.3. </span> The ‘<a
22572306
grammar</abbr>
22582307
</table>
22592308

2260-
<p> The ‘<a href="#flex-basis0"><code
2309+
<p> The ‘<a href="#flex-basis-propdef"><code
22612310
class=property>flex-basis</code></a>’ property sets the <a
22622311
href="#flex-basis"><i>flex basis</i></a>. Negative lengths are invalid.
22632312

2264-
<p> If the computed value is <dfn id=flex-basis-auto
2265-
title="flex-basis: auto"><code class=css>auto</code></dfn> on a <a
2266-
href="#flex-item"><i>flex item</i></a>, the used value of ‘<a
2267-
href="#flex-basis0"><code class=property>flex-basis</code></a>’ is the
2268-
used value of the element's <a href="#main-size-property"><i>main size
2269-
property</i></a>. Otherwise, the used value of ‘<a
2270-
href="#flex-basis0"><code class=property>flex-basis</code></a>’ is
2271-
resolved the same way as the <a href="#main-size-property"><i>main size
2272-
property</i></a>.
2273-
2274-
<p> As with ‘<code class=property>width</code>’, percentage values of
2275-
<a href="#flex-basis0"><code class=property>flex-basis</code></a>
2276-
are resolved against the flex item's containing block, i.e. its flex
2277-
container. And <a
2278-
href="http://www.w3.org/TR/CSS21/visudet.html#propdef-width">as with
2279-
<code class=property>width</code></a> in <a href="#CSS21"
2280-
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>, if that containing block's
2281-
size is indefinite, the result is undefined.
2282-
2283-
<p> Like the ‘<code class=property>width</code>’ and ‘<code
2284-
class=property>height</code>’ properties, ‘<a
2285-
href="#flex-basis0"><code class=property>flex-basis</code></a>
2313+
<p> Except for <dfn id=flex-basis-auto title="flex-basis: auto"><code
2314+
class=css>auto</code></dfn>, which retrieves the value of the <a
2315+
href="#main-size-property"><i>main size property</i></a>, ‘<a
2316+
href="#flex-basis-propdef"><code class=property>flex-basis</code></a>
2317+
is resolved the same way as <a
2318+
href="http://www.w3.org/TR/CSS21/visudet.html#propdef-width"><code
2319+
class=property>width</code></a> in horizontal writing modes <a
2320+
href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>: percentage
2321+
values of ‘<a href="#flex-basis-propdef"><code
2322+
class=property>flex-basis</code></a>’ are resolved against the flex
2323+
item's containing block, i.e. its flex container, and if that containing
2324+
block's size is indefinite, the result is undefined. Similarly, ‘<a
2325+
href="#flex-basis-propdef"><code class=property>flex-basis</code></a>
22862326
determines the size of the content box, unless otherwise specified such as
22872327
by ‘<code class=property>box-sizing</code><a href="#CSS3UI"
22882328
rel=biblioentry>[CSS3UI]<!--{{CSS3UI}}--></a>.
@@ -3899,11 +3939,13 @@ <h2 class=no-num id=changes>Changes</h2>
38993939
<li>Defined <a href="#painting">painting behavior of flex items</a>.
39003940

39013941
<li>Made ‘<code class=property>z-index</code>’ automatically apply to
3902-
flex items. <!--
3903-
<li>Defined which properties affect placeholders.
3904-
<li>Defined which properties apply to the table wrapper box vs. the table box of a table element.
3905-
-->
3906-
3942+
flex items.
3943+
3944+
<li>Changed how absolutely-positioned flex container children are handled
3945+
so that they don't impact layout.
3946+
3947+
<li>Defined which properties apply to the table wrapper box vs. the table
3948+
box of a table element.
39073949

39083950
<li>Defined interaction of ‘<a href="#order"><code
39093951
class=property>order</code></a>’ and <a
@@ -4015,7 +4057,7 @@ <h2 class=no-num id=property>Property index</h2>
40154057
<td>visual
40164058

40174059
<tr>
4018-
<th><a class=property href="#flex-basis0">flex-basis</a>
4060+
<th><a class=property href="#flex-basis-propdef">flex-basis</a>
40194061

40204062
<td>&lt;&apos;width&apos;>
40214063

@@ -4228,7 +4270,7 @@ <h2 class=no-num id=index>Index</h2>
42284270
<li>flex basis, <a href="#flex-basis"
42294271
title="flex basis"><strong>7.1.</strong></a>
42304272

4231-
<li>flex-basis, <a href="#flex-basis0"
4273+
<li>flex-basis, <a href="#flex-basis-propdef"
42324274
title=flex-basis><strong>7.3.3.</strong></a>
42334275

42344276
<li>flex-basis: auto, <a href="#flex-basis-auto"
@@ -4335,6 +4377,9 @@ <h2 class=no-num id=index>Index</h2>
43354377
<li>multi-line, <a href="#multi-line"
43364378
title=multi-line><strong>6.</strong></a>
43374379

4380+
<li><a href="#flex-none"><code class=css>none</code></a>’, <a
4381+
href="#flex-none" title="''none''"><strong>7.1.</strong></a>
4382+
43384383
<li><a href="#flex-flow-nowrap"><code class=css>nowrap</code></a>’,
43394384
<a href="#flex-flow-nowrap" title="''nowrap''"><strong>5.2.</strong></a>
43404385

0 commit comments

Comments
 (0)