Skip to content

Flex & Grid

Direction

ClassCSS
chai-flex-rowflex-direction: row
chai-flex-row-reverseflex-direction: row-reverse
chai-flex-colflex-direction: column
chai-flex-col-reverseflex-direction: column-reverse
chai-flex-wrapflex-wrap: wrap
chai-flex-nowrapflex-wrap: nowrap

Flex sizing

ClassCSS
chai-flex-1flex: 1 1 0%
chai-flex-autoflex: 1 1 auto
chai-flex-noneflex: none
chai-growflex-grow: 1
chai-grow-0flex-grow: 0
chai-shrinkflex-shrink: 1
chai-shrink-0flex-shrink: 0

Justify content

ClassCSS
chai-justify-startjustify-content: flex-start
chai-justify-endjustify-content: flex-end
chai-justify-centerjustify-content: center
chai-justify-betweenjustify-content: space-between
chai-justify-aroundjustify-content: space-around
chai-justify-evenlyjustify-content: space-evenly

Align items

ClassCSS
chai-items-startalign-items: flex-start
chai-items-endalign-items: flex-end
chai-items-centeralign-items: center
chai-items-stretchalign-items: stretch
chai-items-baselinealign-items: baseline

Align content & self

chai-content-{start|end|center|between|around|evenly}align-content. chai-self-{auto|start|end|center|stretch|baseline}align-self.

Gap

ClassCSS
chai-gap-2gap: 2px
chai-gap-x-4column-gap: 4px
chai-gap-y-8row-gap: 8px
chai-gap-[1rem]gap: 1rem

Grid templates

ClassCSS
chai-grid-cols-3grid-template-columns: repeat(3, minmax(0, 1fr))
chai-grid-rows-2grid-template-rows: repeat(2, minmax(0, 1fr))
chai-col-span-2grid-column: span 2 / span 2
chai-row-span-3grid-row: span 3 / span 3

Example: a centered card row

<div class="chai-flex chai-justify-center chai-items-center chai-gap-4 chai-p-8">
<div class="chai-p-4 chai-bg-cream-200 chai-rounded-lg">A</div>
<div class="chai-p-4 chai-bg-cream-200 chai-rounded-lg">B</div>
<div class="chai-p-4 chai-bg-cream-200 chai-rounded-lg">C</div>
</div>

Made by Saad · @developedbysaad on X