flexboxes
flexboxes copied to clipboard
CSS flexbox framework with pure flexbox grid ability
flexboxes
flexboxes is a functional flexbox library and pure flexbox grid system designed for prototyping and production.
setup
Download flexboxes.css and load stylesheet
<link rel="stylesheet" href="flexboxes.css">
- Browse releases or the latest release
- Codepens can link unpkg
- Dependers can npm install flexboxes and
@importvianode_modules - Deprecated classes are in deprecated.css
classes
display
.flex-inlineforinline-flex.flex-blockforflex
flex-flow
- Compose
flex-directionflex-wrap - Default is
row nowrap
flex-direction
.flow-eastforrow.flow-westforrow-reverse.flow-southforcolumn.flow-northforcolumn-reverse
flex-wrap
.flow-overfornowrap.flow-wrapforwrap.flow-warpforwrap-reverse
margin
Distribute free space via auto margins
.free-allfrees all.free-topfrees top.free-bottomfrees bottom.free-leftfrees left.free-rightfrees right.free-northfrees block-start.free-southfrees block-end.free-westfrees inline-start.free-eastfrees inline-end
order
.order-before.order-after
align-items
.items-start.items-end.items-center.items-baseline.items-stretch
align-self
.self-center.self-baseline.self-stretch.self-start.self-end
justify-content
.just-start.just-end.just-center.just-between.just-around
align-content
.pack-start.pack-end.pack-center.pack-between.pack-around.pack-stretch
flex
Shorthand classes supply common presets
.flex-fadefor0 1 autoaka shrinkable.flex-famefor1 0 autoaka growable.flex-autofor1 1 autoaka flexible.flex-nonefornoneaka inflexible
Compose with grow shrink basis
flex-grow
.grow-0.grow-1.grow-2.grow-3.grow-4.grow-5.grow-6.grow-8.grow-7.grow-9.grow-10.grow-11.grow-12
flex-shrink
.shrink-0.shrink-1.shrink-2.shrink-3.shrink-4.shrink-5.shrink-6.shrink-7.shrink-8.shrink-9.shrink-10.shrink-11.shrink-12
flex-basis
.basis-00/12 grid.basis-11/12 grid.basis-22/12 grid.basis-33/12 grid.basis-44/12 grid.basis-55/12 grid.basis-66/12 grid.basis-77/12 grid.basis-88/12 grid.basis-99/12 grid.basis-1010/12 grid.basis-1111/12 grid.basis-1212/12 grid.basis-100vw.basis-100vh.basis-100vmax.basis-100vmin.basis-golden.basis-content.basis-auto
area
Some flexbugs are solvable via min or max width or height
.area-minsets both mins to0re: nesting.area-maxsets both maxes to100%
Consider area.css for more
@media
Responsive orientation classes are available for flex-flow and display classes. Append @portrait or @landscape to these classes to limit them to that orientation. This affords layouts that flow or wrap differently based on viewport orientation or layouts that only flex in one orientation. Try the #fitting example in both portrait and landscape to see how it adapts. You can do this on a phone by rotating the phone or on a computer by resizing the browser window.
class="flex-block flow-west@portrait flow-north@landscape"
portrait
flow-east@portraitflow-west@portraitflow-south@portraitflow-north@portraitflow-over@portraitflow-wrap@portraitflow-warp@portraitflex-inline@portraitflex-block@portrait
landscape
flow-east@landscapeflow-west@landscapeflow-south@landscapeflow-north@landscapeflow-over@landscapeflow-wrap@landscapeflow-warp@landscapeflex-inline@landscapeflex-block@landscape