Documentation
Reference
Every option, token and class in one flat list.
Everything EVA emits, in one place. Version 2.4.0.
Configuration#
@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
);| Option | Default |
|---|---|
$sizes | 4, 8, 12, 16, 24, 32, 48, 64, 96, 128 |
$font-sizes | 12, 14, 16, 18, 20, 24, 32, 48 |
$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 |
Entry points#
| Entry | Variables | Colors | Gradients | Reset + type | Utility classes |
|---|---|---|---|---|---|
eva-css-fluid | yes | yes | yes | yes | yes |
eva-css-fluid/core | yes | yes | yes | yes | no |
eva-css-fluid/variables | yes | yes | no | no | no |
eva-css-fluid/colors | no | yes | no | no | no |
Size tokens#
For each N in $sizes:
| Token | Behaviour |
|---|---|
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:
| Token | Behaviour |
|---|---|
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.
| Token | Meaning |
|---|---|
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:
lightness = base + absolute offset + (bound − base) × ratio| Step | Token | Light | Dark | Bound (light) | Bound (dark) |
|---|---|---|---|---|---|
-d | --darker | -5% | 10% | 0% | 100% |
-b | --brighter | 10% | -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_:
| Form | Scope | Default |
|---|---|---|
--<role>-<token> | one role | unset |
--<role>-<token>-ratio | one role | 0 |
--<token>-ratio | global | 0 |
--<role>-<token>-bound | one role | unset |
--<token>-bound | global | see table |
Body classes: current-theme (required), theme-<name>, toggle-theme (dark), all-grads (gradients).
Utility classes#
Sizing — w mw h p px py pt pb pr mt mb ml mr g gap br, each × every size × __ _ (none) -.
Font size — fs-N, fs-N_, fs-N__.
Color — _c- _bg- _bc- _f- _s- × 5 roles × 8 variants. Plus _shadow, _shadow_.
Flex — flex, 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-1…order-12, order-first, order-last, order-none; flex-card, flex-sidebar.
Grid — grid, auto-fit-<size><variant> (sizes ≥ 100 only), flex-grid, container:flex-grid, col-1…col-12, col-1/1…col-1/12, max-col-1…max-col-12, xs:max-col-N…xxl:max-col-N.
Gradients — grad-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-0…a-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.
Typography — fwg-1…fwg-8, fwd-1…fwd-13, f-scale, f-scale offset, bold, ttu, tac, lh-0, lh-1.
Layout — por 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#
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#
- No fixed values.
var(--64), not64px.var(--brand), not#ff5733. - Only list the sizes the design actually uses.
16is mandatory in$sizes.- Font tokens are
--fs-N.$sizesand$font-sizesare independent namespaces. - Pick one build mode per project and hold it.
current-themeon the root element, always.all-gradson the container if you use gradients.- 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. darkandlightinherit--brand-huewith a non-zero chroma, so neutrals are brand-tinted unless you pin them.- Dark mode overrides configured lightness.
.toggle-themesets--dark-lightnessand--light-lightnesswith!important; only hue and chroma survive the switch. auto-fit-*exists only for sizes ≥ 100.