flexboxes
flexboxes is a functional flexbox utility library and pure flexbox grid system. It offers a hybrid between other frameworks. It is designed for both prototyping and production.
setup
- For prototyping or codepen you can get any version from https://unpkg.com/flexboxes
- For production you can
npm install flexboxesand import into your CSS bundle.
@import 'node_modules/flexboxes/main';classes
display
.flex.inline-flex
flex-direction
.flex-row.flex-row-reverse.flex-column.flex-column-reverse
flex-wrap
.flex-wrap.flex-nowrap.flex-wrap-reverse
distribute free space
.free-top.free-left.free-right.free-bottom
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
.justify-start.justify-end.justify-center.justify-between.justify-around
align-content
.content-start.content-end.content-center.content-between.content-around.content-stretch
size control
.flex-minre: nesting.flex-max
flex presets
.flex-golden.flex-initial.flex-auto.flex-none
flex shorthand
.flex-0.flex-1.flex-2.flex-3.flex-4.flex-5.flex-6.flex-7.flex-8.flex-9.flex-10.flex-11.flex-12
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
@media
These are breakpoint classes for responsive design.
portrait orientation only
flex@portraitinline-flex@portraitflex-wrap@portraitflex-nowrap@portraitflex-wrap-reverse@portrait
landscape orientation only
flex@landscapeinline-flex@landscapeflex-wrap@landscapeflex-nowrap@landscapeflex-wrap-reverse@landscape
examples
balanced grid
<div class="flex">
<div class="flex-auto">item</div>
<div class="flex-auto">item</div>
<div class="flex-auto">item</div>
</div>wrapping grid
<div class="flex flex-wrap">
<div class="basis-4">grid item</div>
<div class="basis-4">grid item</div>
<div class="basis-4">grid item</div>
<div class="basis-4">grid item</div>
<div class="basis-4">grid item</div>
</div>responsive wrapping
<div class="flex flex-wrap@portrait">
<div class="flex-auto basis-6">1</div>
<div class="flex-auto basis-6">2</div>
<div class="flex-auto basis-6">3</div>
<div class="flex-auto basis-6">4</div>
</div>development
npm install
npm start
inspirations
flexpress yo' self