Documentation

Reference

Every option, token and class in one flat list.

Everything EVA emits, in one place. Version 2.4.0.

Configuration#

scss
@use 'eva-css-fluid' with (
  $sizes: (4, 8, 12, 16, 24, 32, 48, 64, 96, 128),
  $font-sizes: (12, 14, 16, 18, 20, 24, 32),
  $build-class: true,
  $px-rem-suffix: false,
  $name-by-size: true,
  $custom-class: false,
  $class-config: (),
  $debug: false,
  $unit-fluid: 1vw,
  $reference-width: 1440,
  $fluid-runtime: true,
  $min-font-size: 0
);
OptionDefault
$sizes4, 8, 12, 16, 24, 32, 48, 64, 96, 128
$font-sizes12, 14, 16, 18, 20, 24, 32, 48
$build-classtrue
$px-rem-suffixfalse
$name-by-sizetrue
$custom-classfalse
$class-config()
$debugfalse
$unit-fluid1vw
$reference-width1440
$fluid-runtimetrue
$min-font-size0

Entry points#

EntryVariablesColorsGradientsReset + typeUtility classes
eva-css-fluidyesyesyesyesyes
eva-css-fluid/coreyesyesyesyesno
eva-css-fluid/variablesyesyesnonono
eva-css-fluid/colorsnoyesnonono

Size tokens#

For each N in $sizes:

TokenBehaviour
var(--N__)Most aggressive collapse on small screens
var(--N_)Strong collapse
var(--N)Standard scaling
var(--N-)Conservative — high mobile floor
var(--N-px)Static px, only with $px-rem-suffix: true
var(--N-rem)Static rem, only with $px-rem-suffix: true

For each N in $font-sizes:

TokenBehaviour
var(--fs-N__)Most aggressive
var(--fs-N_)Strong
var(--fs-N)Standard — use for body copy
var(--fs-N-px) / var(--fs-N-rem)Static, with $px-rem-suffix: true

Runtime unit: --eva-fluid-unit, default 1vw, override to 1cqi per subtree. Classes .eva-cqi and .eva-root.

Color tokens#

Roles: brand, accent, extra, dark, light.

TokenMeaning
var(--<role>)The role
var(--<role>_)65% opacity
var(--<role>__)35% opacity
var(--<role>___)15% opacity
var(--<role>-d)One step more contrast
var(--<role>-b)One step less contrast
var(--<role>-d_)Two steps more contrast
var(--<role>-b_)Two steps less contrast
var(--root-<role>)The raw L C H triplet

Theme inputs, per role: --<role>-lightness, --<role>-chroma, --<role>-hue.

Mode pivots: --current-lightness (96.4% light / 5% dark), --current-darkness (6.4% / 95%).

Brightness formula:

text
lightness = base + absolute offset + (bound − base) × ratio
StepTokenLightDarkBound (light)Bound (dark)
-d--darker-5%10%0%100%
-b--brighter10%-5%100%0%
-d_--darker_-15%30%0%100%
-b_--brighter_30%-15%100%0%

Per-role overrides, with <token> in darker, brighter, darker_, brighter_:

FormScopeDefault
--<role>-<token>one roleunset
--<role>-<token>-ratioone role0
--<token>-ratioglobal0
--<role>-<token>-boundone roleunset
--<token>-boundglobalsee table

Body classes: current-theme (required), theme-<name>, toggle-theme (dark), all-grads (gradients).

Utility classes#

Sizingw mw h p px py pt pb pr mt mb ml mr g gap br, each × every size × __ _ (none) -.

Font sizefs-N, fs-N_, fs-N__.

Color_c- _bg- _bc- _f- _s- × 5 roles × 8 variants. Plus _shadow, _shadow_.

Flexflex, x, y, reverse, wrap, nowrap, wrap-reverse; start center end space around evenly; compound justify-align forms; justify-*, items-*, content-*; flex-1 flex-2 flex-3 flex-auto flex-initial flex-none stretch; self-*; order-1order-12, order-first, order-last, order-none; flex-card, flex-sidebar.

Gridgrid, auto-fit-<size><variant> (sizes ≥ 100 only), flex-grid, container:flex-grid, col-1col-12, col-1/1col-1/12, max-col-1max-col-12, xs:max-col-Nxxl:max-col-N.

Gradientsgrad-linear, grad-radial, grad-linear-text, grad-radial-text, grad-linear-border, grad-radial-border; from-*, to-*, from-transparent, to-transparent; d-t d-b d-l d-r d-tl d-tr d-bl d-br; a-0a-360 in 5° steps; bg-size, bg-size_, bg-size__; bg-center bg-top bg-bottom bg-left bg-right; animated, animated-slow, animated-fast.

Typographyfwg-1fwg-8, fwd-1fwd-13, f-scale, f-scale offset, bold, ttu, tac, lh-0, lh-1.

Layoutpor poa pof pos, poa center, w-full, h-full, oh, ar-1, circle, border, border thin, blur blur_ blur__, pointer, hide, lt, mt-auto mb-auto ml-auto mr-auto.

CLI#

bash
npx eva-color convert "#ff0000"
npx eva-color to-hex 62.8 0.258 29.23
npx eva-color palette "#ff0000" 7
npx eva-color theme theme.json
npx eva-color contrast "#ffffff" "#000000"

npx eva-purge --css styles/main.css --content "**/*.html" \
  --output styles/main-compressed.css --safelist "current-theme,toggle-theme,all-grads"

Rules#

  1. No fixed values. var(--64), not 64px. var(--brand), not #ff5733.
  2. Only list the sizes the design actually uses.
  3. 16 is mandatory in $sizes.
  4. Font tokens are --fs-N. $sizes and $font-sizes are independent namespaces.
  5. Pick one build mode per project and hold it.
  6. current-theme on the root element, always.
  7. all-grads on the container if you use gradients.
  8. Media queries for layout topology only — never for spacing or type.

Known limits#

  • The two color axes do not cross. No opacity variant of a brightness step; no --brand-d__.
  • Fades are inlined at build time. $fade-values (65 / 35 / 15%) is a SCSS variable, not a runtime one — no per-theme control.
  • dark and light inherit --brand-hue with a non-zero chroma, so neutrals are brand-tinted unless you pin them.
  • Dark mode overrides configured lightness. .toggle-theme sets --dark-lightness and --light-lightness with !important; only hue and chroma survive the switch.
  • auto-fit-* exists only for sizes ≥ 100.