@@ -214,7 +214,7 @@ <h2 class="no-num no-toc" id=table>Table of contents</h2>
214214 </ ul >
215215
216216 < li > < a href ="#flexibility "> < span class =secno > 4. </ span > Flexibility: the
217- ‘< code class =css > flex() </ code > ’ notation </ a >
217+ ‘< code class =property > flex</ code > ’ property </ a >
218218
219219 < li > < a href ="#alignment "> < span class =secno > 5. </ span > Alignment</ a >
220220 < ul class =toc >
@@ -341,10 +341,7 @@ <h2 id=intro><span class=secno>1. </span> Introduction</h2>
341341 < h3 id =placement > < span class =secno > 1.1. </ span > Module interactions</ h3 >
342342
343343 < p > This module extends the definition of the ‘< code
344- class =property > display</ code > ’ property. It also defines a new type
345- of primitive value, the < a href ="#flex-function "> flex() notation</ a > ,
346- which is accepted by the ‘< code class =property > width</ code > ’
347- and ‘< code class =property > height</ code > ’ properties.
344+ class =property > display</ code > ’ property.
348345
349346 < h3 id =values > < span class =secno > 1.2. </ span > Values</ h3 >
350347
@@ -418,19 +415,17 @@ <h2 id=box-model><span class=secno>2. </span> The Flexbox Box Model</h2>
418415 < p > The contents of a flexbox can be easily and powerfully manipulated with
419416 a handful of properties. Most significantly, < a
420417 href ="#flexbox-item "> < i > flexbox items</ i > </ a > can "flex" their < a
421- href ="#main-size "> < i > main size</ i > </ a > by using the ‘< code
422- class =css > flex()</ code > ’ function in the ‘< code
423- class =property > width</ code > ’ or ‘< code
424- class =property > height</ code > ’ property. This "flexing" allows the
425- items to get bigger or smaller based on the available space in the page.
426- If there is leftover space in the flexbox after all of the < a
427- href ="#flexbox-item "> < i > flexbox items</ i > </ a > have finished flexing, the
428- items can be aligned, centered, or distributed with the ‘< a
429- href ="#flex-pack0 "> < code class =property > flex-pack</ code > </ a > ’
430- property. < a href ="#flexbox-item "> < i > Flexbox items</ i > </ a > can also be
431- completely rearranged within the flexbox with the ‘< a
432- href ="#flex-order0 "> < code class =property > flex-order</ code > </ a > ’
433- property.
418+ href ="#main-size "> < i > main size</ i > </ a > by using the ‘< a
419+ href ="#flex "> < code class =property > flex</ code > </ a > ’ property. This
420+ "flexing" allows the items to get bigger or smaller based on the available
421+ space in the page. If there is leftover space in the flexbox after all of
422+ the < a href ="#flexbox-item "> < i > flexbox items</ i > </ a > have finished
423+ flexing, the items can be aligned, centered, or distributed with the
424+ ‘< a href ="#flex-pack0 "> < code
425+ class =property > flex-pack</ code > </ a > ’ property. < a
426+ href ="#flexbox-item "> < i > Flexbox items</ i > </ a > can also be completely
427+ rearranged within the flexbox with the ‘< a href ="#flex-order0 "> < code
428+ class =property > flex-order</ code > </ a > ’ property.
434429
435430 < p > In the < a href ="#cross-axis "> < i > cross axis</ i > </ a > , < a
436431 href ="#flexbox-item "> < i > flexbox items</ i > </ a > can either "flex" to fill
@@ -509,6 +504,13 @@ <h3 id=display-flexbox><span class=secno>2.1. </span> New values for
509504 Additionally, each of the < a href ="#flexbox-item "> < i > flexbox items</ i > </ a >
510505 establish a new formatting context for its contents.
511506
507+ < p class =issue > Although the term "flexbox formatting context" is defined
508+ here, it is not used anywhere else. BFC is the commonly used term for what
509+ it means here. Perhaps this could say that flexbox formatting context *is*
510+ a block formatting context, with different rules for how blocks are
511+ formatted but same protection from external floats etc. Then the terms can
512+ be used interchangeably, as they will be anyway...
513+
512514 < h3 id =flex-items > < span class =secno > 2.2. </ span > Flexbox Items</ h3 >
513515
514516 < p class =issue > Add a ‘< code
@@ -1001,10 +1003,6 @@ <h3 id=flex-order><span class=secno>3.4. </span> Display Order: the
10011003.tabs > .current {
10021004 flex-order: -1; /* Lower than the default of 0 */
10031005}</ pre >
1004-
1005- < p > You can also see a < a href =flex-order-example.html > working example</ a >
1006- in some modern browsers (modern WebKit, Firefox, or any browser that
1007- supports the Flexbox spec).</ p >
10081006 </ div >
10091007
10101008 < div class =example >
@@ -1040,7 +1038,7 @@ <h3 id=flex-order><span class=secno>3.4. </span> Display Order: the
10401038
10411039 < pre >
10421040#main { display: flexbox; }
1043- #main > article { width: flex(1); flex-order: 2; }
1041+ #main > article { flex:1; flex-order: 2; }
10441042#main > nav { width: 200px; flex-order: 1; }
10451043#main > aside { width: 200px; flex-order: 3; }</ pre >
10461044
@@ -1063,73 +1061,128 @@ <h3 id=flex-order><span class=secno>3.4. </span> Display Order: the
10631061 intelligent wrapping left as an exercise for the reader.)</ small > </ p >
10641062 </ div >
10651063
1066- < h2 id =flexibility > < span class =secno > 4. </ span > Flexibility: the
1067- ‘ < code class =css > flex() </ code > ’ notation </ h2 >
1064+ < h2 id =flexibility > < span class =secno > 4. </ span > Flexibility: the ‘ < a
1065+ href =" #flex " > < code class =property > flex</ code > </ a > ’ property </ h2 >
10681066
10691067 < p > The defining aspect of flexbox layout is the ability to make the < a
10701068 href ="#flexbox-item "> < i > flexbox items</ i > </ a > "flex", altering their width
10711069 or height to fill the available space. This is done by using a ‘< a
1072- href ="#ltflex "> < code class =css > <flex> </ code > </ a > ’ value in the
1073- element's ‘< code class =property > width</ code > ’ or ‘< code
1074- class =property > height</ code > ’ property. A flexbox distributes free
1075- space to its items proportional to their positive flexibility, or shrinks
1076- them to prevent overflow proportional to their negative flexibility.
1077-
1078- < p > The ‘< code class =css > flex()</ code > ’ notation is used to
1079- specify the parameters of a < dfn id =flexible-length
1070+ href ="#flex "> < code class =property > flex</ code > </ a > ’ property. A
1071+ flexbox distributes free space to its items proportional to their positive
1072+ flexibility, or shrinks them to prevent overflow proportional to their
1073+ negative flexibility.
1074+
1075+ < table class =propdef >
1076+ < tbody >
1077+ < tr >
1078+ < th > Name:
1079+
1080+ < td > < dfn id =flex > flex</ dfn >
1081+
1082+ < tr >
1083+ < th > < a href ="http://dev.w3.org/csswg/css-module/#values "> Value</ a > :
1084+
1085+ < td > [[ <pos-flex> <neg-flex> ? ]? &&
1086+ [<preferred-size> ]?] | none
1087+
1088+ < tr >
1089+ < th > Initial:
1090+
1091+ < td > none
1092+
1093+ < tr >
1094+ < th > Applies to:
1095+
1096+ < td > flexbox items
1097+
1098+ < tr >
1099+ < th > Inherited:
1100+
1101+ < td > no
1102+
1103+ < tr >
1104+ < th > Computed Value:
1105+
1106+ < td > specified value
1107+
1108+ < tr >
1109+ < th > Media:
1110+
1111+ < td > visual
1112+
1113+ < tr >
1114+ < th > Animatable:
1115+
1116+ < td > yes
1117+ </ table >
1118+
1119+ < p class =note > < b > Editorial note:</ b > in a property, default preferred size
1120+ of zero is problematic. If flex property is not specified, ‘< code
1121+ class =property > width</ code > ’ or ‘< code
1122+ class =property > height</ code > ’ must be used, which corresponds to
1123+ preferred size of ‘< code class =property > auto</ code > ’. But if
1124+ flex is specified, we want default preferred size of 0px. The new keyword
1125+ ‘< a href ="#flex-flow-none "> < code
1126+ class =property > none</ code > </ a > ’ is the way around it.
1127+
1128+ < p > The ‘< a href ="#flex "> < code class =property > flex</ code > </ a > ’
1129+ property specifiex the parameters of a < dfn id =flexible-length
10801130 title ="flexible length|flexible lengths|flexible length's "> flexible
10811131 length</ dfn > : the < dfn id =positive-flexibility
10821132 title ="positive flexibility "> positive</ dfn > and < dfn
10831133 id =negative-flexibility > negative flexibility</ dfn > , and the < dfn
1084- id =preferred-size > preferred size</ dfn > . The syntax of the ‘< code
1085- class =css > flex()</ code > ’ notation is:
1086-
1087- < pre class =prod > < dfn
1088- id =ltflex > <flex> </ dfn > = flex( [ <pos-flex> <neg-flex> ? ]? && <preferred-size> ? )</ pre >
1134+ id =preferred-size > preferred size</ dfn > .
10891135
10901136 < p > < code > <pos-flex> </ code > and < code > <neg-flex> </ code > are
10911137 non-negative < code > <numbers> s</ code > , while
1092- < code > <preferred-size> </ code > is any value (other than another
1093- ‘< a href ="#ltflex "> < code class =css > <flex> </ code > </ a > ’) that
1094- would be valid in the ‘< code class =property > width</ code > ’ or
1095- ‘< code class =property > height</ code > ’ property in which the
1096- notation is used. If the < code > <preferred-size> </ code > is ‘< code
1138+ < code > <preferred-size> </ code > is any value that would be valid in the
1139+ ‘< code class =property > width</ code > ’ or ‘< code
1140+ class =property > height</ code > ’ property. If the
1141+ < code > <preferred-size> </ code > is ‘< code
10971142 class =css > 0</ code > ’, it < strong > must</ strong > be specified with a
10981143 unit (like ‘< code class =css > 0px</ code > ’) to avoid ambiguity;
10991144 unitless zero will either be interpreted as as one of the flexibilities,
11001145 or is a syntax error.
11011146
1102- < p > The < code > <pos-flex> </ code > component sets the length's < a
1147+ < p > The < code > <pos-flex> </ code > component sets the < a
11031148 href ="#positive-flexibility "> < i > positive flexibility</ i > </ a > ; if omitted,
11041149 the < a href ="#positive-flexibility "> < i > positive flexibility</ i > </ a >
11051150 defaults to ‘< code class =css > 1</ code > ’. The
1106- < code > <neg-flex> </ code > component sets the length's < a
1151+ < code > <neg-flex> </ code > component sets the < a
11071152 href ="#negative-flexibility "> < i > negative flexibility</ i > </ a > ; if omitted,
1108- it defaults to ‘< code class =css > 0</ code > ’. The
1109- < code > <preferred-size> </ code > component sets the length's < a
1153+ it defaults to ‘< code class =css > 0</ code > ’.
1154+
1155+ < p > The < code > <preferred-size> </ code > component sets the < a
11101156 href ="#preferred-size "> < i > preferred size</ i > </ a > ; if omitted, it defaults
1111- to ‘< code class =css > 0px</ code > ’.
1112-
1113- < p > If the ‘< code class =css > flex()</ code > ’ notation is specified
1114- on an element that is not a < a href ="#flexbox-item "> < i > flexbox
1115- item</ i > </ a > , it computes to the < a href ="#preferred-size "> < i > preferred
1116- size</ i > </ a > . If the ‘< code class =css > flex()</ code > ’ notation
1117- is used on a < a href ="#flexbox-item "> < i > flexbox item's</ i > </ a > < a
1118- href ="#cross-size-property "> < i > cross size property</ i > </ a > , it computes to
1119- the < a href ="#preferred-size "> < i > preferred size</ i > </ a > . Otherwise, it
1120- computes to itself, and is resolved to a length at used-value time by the
1121- flexbox layout algorithm.
1122-
1123- < p > A ‘< a href ="#ltflex "> < code class =css > <flex> </ code > </ a > ’
1124- value is transitionable, by transitioning the < a
1157+ to ‘< code class =css > 0px</ code > ’. If set to ‘< code
1158+ class =property > auto</ code > ’, the value of ‘< code
1159+ class =property > width</ code > ’ or ‘< code
1160+ class =property > height</ code > ’ (whichever is in parallel to main
1161+ axis) is used as preferred size.
1162+
1163+ < p > The keyword ‘< a href ="#flex-flow-none "> < code
1164+ class =property > none</ code > </ a > ’ is equivalent to "0 0 auto".
1165+
1166+ < p class =note > < b > Reviewers:</ b > editors differ in preference for default
1167+ value of the preferred size. The current choice is default flexibility of
1168+ "1" and default preferred size of "0px". Earlier spec and two partial
1169+ implementations use defaults of "0" and "auto". These still have to be
1170+ defaults when ‘< a href ="#flex "> < code
1171+ class =property > flex</ code > </ a > ’ property is not specified. < br >
1172+ The current defaults are chosen by consensus, but there has not been much
1173+ external input in support of either option. If you can share an opinion,
1174+ and/or use cases in support of either set of defaults, the editors would
1175+ appreciate it.
1176+
1177+ < p > A ‘< code class =css > <flex> </ code > ’ value is
1178+ transitionable, by transitioning the < a
11251179 href ="#preferred-size "> < i > preferred size</ i > </ a > , < a
11261180 href ="#positive-flexibility "> < i > positive flexibility</ i > </ a > , and < a
11271181 href ="#negative-flexibility "> < i > negative flexibility</ i > </ a >
1128- independently. ‘< a href ="#ltflex "> < code
1129- class =css > <flex> </ code > </ a > ’ can also transition to and from a
1130- <length> , by treating the length as if it were a flexible length with a
1131- positive and negative flexibility of zero and a preferred size of the
1132- length.
1182+ independently. ‘< code class =css > <flex> </ code > ’ can also
1183+ transition to and from a <length> , by treating the length as if it were
1184+ a flexible length with a positive and negative flexibility of zero and a
1185+ preferred size of the length.
11331186
11341187 < p class =issue > Transitioning to/from a <length> (or to/from a <flex>
11351188 with 0 flexibility) doesn't work well if it's the only flexible item in
@@ -1138,11 +1191,11 @@ <h2 id=flexibility><span class=secno>4. </span> Flexibility: the
11381191 value that represents a percentage of the free space or something?
11391192
11401193 < div class =example >
1141- < p > The ‘ < code class = css > flex() </ code > ’ notation allows
1142- elements to respond directly to the available space, in ways that are
1143- difficult or impossible in normal CSS. One common example is a page with
1144- one segment intended to stay on screen, and another section which may be
1145- long but which shouldn't scroll the page, like a chat room:</ p >
1194+ < p > Flexibility allows elements to respond directly to the available space,
1195+ in ways that are difficult or impossible in normal CSS. One common
1196+ example is a page with one segment intended to stay on screen, and
1197+ another section which may be long but which shouldn't scroll the page,
1198+ like a chat room:</ p >
11461199
11471200 < pre >
11481201<!DOCTYPE html>
@@ -1162,12 +1215,18 @@ <h2 id=flexibility><span class=secno>4. </span> Flexibility: the
11621215 </body>
11631216 <style>
11641217 body { display:flexbox; flex-flow: column; }
1165- #messages { height: flex(1) ; }
1218+ #messages { flex:1 ; }
11661219 </style> </ pre >
11671220
11681221 < p class =issue > Illustrate this example.</ p >
11691222 </ div >
11701223
1224+ < p class =issue > Currently there are no separate properties for pos-flex,
1225+ neg-flex or preferred size. If it doesn't change, there needs to be at
1226+ least CSS OM access to the separate values. Parsing space-separated list
1227+ is easier than functional notation, but figuring out the used value for
1228+ preferred size is still far from trivial.
1229+
11711230 < h2 id =alignment > < span class =secno > 5. </ span > Alignment</ h2 >
11721231
11731232 < p > After a flexbox's contents have finished their flexing, they can be
@@ -1484,6 +1543,33 @@ <h3 id=flex-align><span class=secno>5.2. </span> Cross Axis Alignment: the
14841543 < a href ="#cross-start "> < i > cross-start</ i > </ a > edge of the line.</ p >
14851544 </ dl >
14861545
1546+ < div class =issue >
1547+ < p > Finalize and define what happens to auto margin.
1548+
1549+ < p > Proposals:
1550+
1551+ < ul >
1552+ < li > cross-axis margins (align):
1553+ < ol >
1554+ < li > ‘< code class =property > auto</ code > ’ is zero
1555+
1556+ < li > auto margins applied before alignment, map directly to alignment
1557+ values (start/end/center)
1558+
1559+ < li > auto margins applied before alignment, do safe align (flex-align
1560+ does ‘< code class =css > true center</ code > ’ etc.)
1561+ </ ol >
1562+
1563+ < li > main-axis margins (pack):
1564+ < ol >
1565+ < li > ‘< code class =property > auto</ code > ’ is zero
1566+
1567+ < li > if there is positive extra space after flexing (and before pack),
1568+ distribute it equally to auto margins.
1569+ </ ol >
1570+ </ ul >
1571+ </ div >
1572+
14871573 < div class =figure > < img height =377 src ="images/flex-align.svg " width =508 >
14881574 < p class =caption > An illustration of the five ‘< a
14891575 href ="#flex-align0 "> < code class =property > flex-align</ code > </ a > ’
@@ -1566,7 +1652,7 @@ <h2 id=multi-line><span class=secno>6. </span> Multi-line Flexbox</h2>
15661652 width: 300px;
15671653}
15681654button {
1569- width: flex( 80px 1) ;
1655+ flex: 80px 1;
15701656}
15711657<style>
15721658
@@ -1612,7 +1698,7 @@ <h2 id=multi-line><span class=secno>6. </span> Multi-line Flexbox</h2>
16121698 width: 300px;
16131699}
16141700button {
1615- width: flex( 80px 1) ;
1701+ flex: 80px 1;
16161702 max-width: 90px;
16171703}</ pre >
16181704
@@ -2584,6 +2670,22 @@ <h2 class=no-num id=property>Property index</h2>
25842670
25852671 < td > flexbox | inline-flexbox
25862672
2673+ < tr >
2674+ < th > < a class =property href ="#flex "> flex</ a >
2675+
2676+ < td > [[ <pos-flex> <neg-flex> ? ]? &&
2677+ [<preferred-size> ]?] | none
2678+
2679+ < td > none
2680+
2681+ < td > flexbox items
2682+
2683+ < td > no
2684+
2685+ < td > specified value
2686+
2687+ < td > visual
2688+
25872689 < tr >
25882690 < th > < a class =property href ="#flex-align0 "> flex-align</ a >
25892691
@@ -2774,8 +2876,7 @@ <h2 class=no-num id=index>Index</h2>
27742876 < li > fix min size violations, < a href ="#fix-size-constraint-violations "
27752877 title ="fix min size violations "> < strong > 7.</ strong > </ a >
27762878
2777- < li > <flex> , < a href ="#ltflex " title ="<flex> "> < strong > 4.</ strong > </ a >
2778-
2879+ < li > flex, < a href ="#flex " title =flex > < strong > 4.</ strong > </ a >
27792880
27802881 < li > flex-align, < a href ="#flex-align0 "
27812882 title =flex-align > < strong > 5.2.</ strong > </ a >
0 commit comments