Documentation

Utility classes

Every class emitted when $build-class is true — sizing, color, flex, grid, typography and layout.

Everything on this page exists only when $build-class: true. With eva-css-fluid/variables or eva-css-fluid/core you get the same values as custom properties and write your own selectors.

Sizing#

Sixteen property prefixes, each combined with every entry in $sizes and each of the four scaling variants.

PrefixProperty
w-width
mw-max-width
h-height
p-padding
px-padding-inline
py-padding-block
pt- pb- pr-padding-top / -bottom / -right
mt- mb- ml- mr-margin-top / -bottom / -left / -right
g- gap-gap
br-border-radius

The variant suffix comes last, exactly as on the variable:

html
<div class="p-32 g-16">      <!-- var(--32), var(--16)  -->
<div class="p-32- g-16-">    <!-- var(--32-), var(--16-) — conservative -->
<div class="p-32_ g-16__">   <!-- var(--32_), var(--16__) — aggressive -->

With $px-rem-suffix: true you also get the static pair — p-32-px, w-64-rem.

Font size#

fs-N for every entry in $font-sizes, with the two shrink variants:

html
<h1 class="fs-52">…</h1>
<h2 class="fs-36_">…</h2>
<p class="fs-16">…</p>

Remember these read the --fs- namespace, which is separate from $sizes. See Font sizes are a separate namespace.

Colors#

Five properties × five roles × eight variants — 200 classes.

PrefixProperty
_c-color
_bg-background
_bc-border-color
_f-fill, including descendant path elements
_s-stroke
html
<div class="_bg-light _c-dark_ _bc-dark___">
  <svg class="_f-brand">…</svg>
</div>

The leading underscore is deliberate: it keeps EVA's color classes from colliding with anything already in your codebase.

Two shadow helpers ship alongside: _shadow and _shadow_.

Flexbox#

.flex is the container. .x and .y set the axis; without either, the direction is row.

html
<div class="flex y g-16 center">…</div>
ClassEffect
flexdisplay: flex
x / yrow / column
reversecombined with x or y, reverses the axis
wrap / nowrap / wrap-reverseflex-wrap

Alignment shorthands, valid on their own or combined with x / y:

Classjustify-contentalign-items
startflex-startflex-start
centercentercenter
endflex-endflex-end
spacespace-betweencenter
aroundspace-aroundcenter
evenlyspace-evenlycenter

Inside .x or .y the two axes can be set independently with a compound name — justify-align:

html
<div class="flex y space-center">…</div>   <!-- space-between / center -->
<div class="flex x end-baseline">…</div>   <!-- flex-end / baseline -->

Both halves accept start, center, end, space, around, evenly on the main axis, and start, center, end, stretch, baseline on the cross axis. The explicit form works too: justify-center, items-end, content-space.

Item-level classes:

ClassEffect
flex-1 / flex-2 / flex-3flex: N 1 0%
flex-auto / flex-initial / flex-noneflex: 1 1 auto / 0 1 auto / none
stretchflex: 1
self-startself-baselinealign-self
order-1order-12order
order-first / order-last / order-none-9999 / 9999 / 0

Two composed patterns are included: .flex-card (header / body / footer, body grows) and .flex-sidebar (.flex-sidebar-nav fixed, .flex-sidebar-main grows with min-width: 0).

Grid#

Two independent systems.

Auto-fit grid#

html
<div class="grid auto-fit-356- gap-32">…</div>

auto-fit-<size><variant> sets the minmax() floor of a repeat(auto-fit, …) template. The column count follows the available width by itself — no breakpoints.

Twelve-column flex grid#

html
<div class="flex-grid max-col-12">
  <div class="col-6">half</div>
  <div class="col-3">quarter</div>
  <div class="col-1/4">quarter</div>
</div>
ClassEffect
flex-gridWrapping flex container using --current-gap
container:flex-gridThe same, plus container queries that pick the column count from the container width
col-1col-12Span N of --grid-columns
col-1/1col-1/12Fraction notation
max-col-1max-col-12Set --grid-columns locally
xs:max-col-Nxxl:max-col-NThe same under a max-width media query

Breakpoints for the responsive form: xs 200px, sm 500px, md 700px, lg 1000px, xl 1200px, xxl 1400px.

Typography#

Variable-font axis classes, driven by two custom properties:

ClassSets
fwg-1fwg-8Weight axis step
fwd-1fwd-13Width axis step
f-scaleScales the glyph to the box; f-scale offset shifts it
ClassEffect
boldfont-weight: bold
ttutext-transform: uppercase
tactext-align: center
lh-0 / lh-1line-height: 0 / 1

Layout#

ClassEffect
por / poa / pof / posposition: relative / absolute / fixed / sticky
poa centerabsolute, centred on both axes
w-full / h-fullwidth: 100% / height: 100%
ohoverflow: hidden
ar-1aspect-ratio: 1
circleborder-radius: 50%
border / border thin1px border in the current color
blur / blur_ / blur__Three backdrop blur strengths
pointercursor: pointer
hidedisplay: none
ltLetter-spacing helper
mt-auto / mb-auto / ml-auto / mr-autoAuto margin on one side

Runtime containers#

ClassEffect
eva-cqicontainer-type: inline-size + --eva-fluid-unit: 1cqi
eva-rootThe same, for a top-level wrapper

See Fluid unit.

Trimming the output#

All of this compiles to a large stylesheet. Two ways to cut it down:

  • $custom-class: true with $class-config restricts generation up front — see Configuration.
  • eva-purge removes what your markup never uses, after the fact. Typically 40–70%.

Next: Adopting EVA.