You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the section describing how to resolve flexible lengths, as its superfluous with the layout algorithm. Start replacing it with some examples of using flex().
Copy file name to clipboardExpand all lines: css3-flexbox/Overview.src.html
+25-27Lines changed: 25 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -516,36 +516,34 @@ <h3 id='flex-notation'>
516
516
517
517
<p>A ''<flex>'' value is transitionable, by transitioning the <i>preferred size</i>, <i>positive flexibility</i>, and <i>negative flexibility</i> independently. ''<flex>'' can also transition to and from a <length>, by treating the length as if it were a flexible length with a positive and negative flexibility of zero and a preferred size of the length.</p>
518
518
519
-
<pclass='issue'>Examples!</p>
520
-
521
519
<pclass='issue'>Transitioning to/from a <length> (or to/from a <flex> with 0 flexibility) doesn't work well if it's the only flexible item in the flexbox. Rather than smoothly transitioning, it suddenly jumps in size when the flexibility becomes non-zero. Can we fix this, perhaps with a value that represents a percentage of the free space or something?</p>
522
520
521
+
<divclass='example'>
522
+
<p>The ''flex()'' notation allows elements to respond directly to the available space, in ways that are difficult or impossible in normal CSS. One common example is a page with one segment intended to stay on screen, and another section which may be long but which shouldn't scroll the page, like a chat room:</p>
523
523
524
-
<h3id='resolving-flexible-lengths'>
525
-
Resolving Flexible Lengths</h3>
526
-
527
-
<pclass='note'>Note: This section is non-normative.</p>
528
-
529
-
<p><i>Flexible lengths</i> are resolved into normal, inflexible lengths by figuring out how large all of the <i>flexible lengths</i> in the flexbox <em>want</em> to be, then either growing or shrinking that <i>preferred size</i> so that the <i>flexbox items</i> exactly fill the flexbox, neither overflowing nor leaving extra unfilled space.</p>
530
-
531
-
<p><i>Flexible lengths</i> are resolved into normal inflexible lengths based on their <i>preferred size</i>, their flexibility, and the amount of free space in the flexbox. The exact algorithm is described in <ahref="#layout-algorithm">a later section of this spec</a>, but in general, it works like this:</p>
532
-
533
-
<ol>
534
-
<li>First, set all the <i>flexible lengths</i> to their <i>preferred size</i>.</li>
535
-
536
-
<li>Then, lay out the flexbox, and see if there is free space left, or if the flexbox is overflowing.</li>
537
-
538
-
<li>If there's free space, distribute it among the <i>flexible lengths</i> in proportion to their <i>positive flexibility</i>. If the flexbox is overflowing, shrink the <i>flexible lengths</i> in proportion to their <i>negative flexibility</i>.</li>
539
-
540
-
<li>If there's free space and any <i>flexible lengths</i> are violating a max width or height constraint, change them into the largest inflexible length that doesn't violate their constraint and return to step 2. If the flexbox is overflowing and any <i>flexible lengths</i> are violating a min width or height constraint, change them into the smallest inflexible length that doesn't violate their constraint and return to step 2.</li>
541
-
542
-
<li>If there's free space and any <i>flexible lengths</i> are violating a min width or height constraint, change them into the smallest inflexible length that doesn't violate their constraint and return to step 2. If the flexbox is overflowing and any <i>flexible lengths</i> are violating a max width or height constraint, change them into the largest inflexible length that doesn't violate their constraint and return to step 2.</li>
543
-
</ol>
544
-
545
-
<pclass='issue'>This is too much detail for a non-normative section. This is living here only until I flesh out the layout algorithm section. Then this can return to being a fairly simple explanation of what goes on.</p>
546
-
547
-
<pclass='issue'>Examples!</p>
548
-
524
+
<pre>
525
+
<!DOCTYPE html>
526
+
<body>
527
+
<header>Channel: #csswg Topic: CSS IS AWE SOME</header>
0 commit comments