====== CSS Flexible Box Layout - Use Cases ====== This section is for documenting several flexbox usecases, and their solutions. ==== 1. toolbar, where items (images + labels) are evenly spaced ====
=== current draft === === 2009 spec === //requires a spacer element//
... ...
==== 2. toolbar, where items are split into groups, and groups are evenly spaced ==== ... ... ... Or: ... ==== 3. Vertical and horizontal toolbars ==== Same as before, except change 'flex-direction' appropriately, and adjust which margins are flexible. ==== 4. Multiline toolbar (example: tool menus in GIMP), with items in different lines aligned ==== Explicitly not handled; will wait for some later flexgrid or improvements to table or something. ==== 5. Horizontal navbar with all items equal width, filling the width of the page. ==== ==== 6. Horizontal navbar with all items equally spaced (widths can be different) ==== In here, the flex() function is for creating flexible lengths with a preferred length other than 0. The first argument specifies the preferred length, the second specifies the growing flexibility and optionally the maximum length, the third (optional) argument specifies the shrinking flexibility and optionally the minimum length. ==== 5b/6b. Horizontal navbar, with the active item indicated by positioning it differently (most items on bottom but active item is high, for example) ==== Same as above, but with: ==== 7. "Accordion"-style list - normally, only headers are visible. When you expand a section, previous headers are pushed up, later headers are pushed down. ====

foo

foo foo

bar

bar bar

baz

baz baz
==== 8. Tab stack, for cardstack-style displays like many OS options screen have. Tabs should be baseline aligned, should fill the width available. The current active tab may be shifted to the start of the list. Tabs may occupy multiple lines. ==== foo bar baz qux Again, I am explicitly not addressing multiple lines right now. ==== 9. The HTML
element (its effects are extremely useful and still unduplicable in CSS). ====

foo foo foo foo

bar bar
bar bar

baz baz baz baz baz baz baz baz baz baz

==== 10. Gmail message display, with small indicators pressed against the left/right and the message title as wide as possible in the middle. ==== you, me, them Is your foo not bar enough for your lady? ==== 11. Chatroom input line, with a submit button on one side, and an or