Fluid spacing and sizing system that adapts seamlessly to any viewport.
The spacing system uses a carefully crafted scale that works harmoniously across all viewport sizes. Each value is designed to create balanced proportions in your layouts.
4px, 8px, 12px
For fine adjustments and tight layouts
20px, 32px, 52px
For component padding and margins
84px, 136px, 220px
For section gaps and major spacing
356px, 576px, 712px
For container widths and large layouts
_ (underscore) - Stronger responsive scaling for mobile/tablet
- (dash) - Minimal responsive scaling
px/rem - Traditional unit suffixes for clarity
Design-based naming makes it easy to match your Figma specifications directly!
px-20 py-12
Standard button padding
px-32 py-16
Large button padding
p-32
Card padding
g-20
Card content gap
py-136
Section vertical padding
px-220
Section horizontal padding
w-356
Medium container
w-576
Large container
px-220
220px horizontal padding
px-220_
~120px horizontal padding
px-220__
~40px horizontal padding
EVA CSS uses intuitive Emmet-style suffixes for consistent and efficient styling.
w == width
h == height
p == padding
px == padding-inline
py == padding-block
pr == padding-right
br == border-radius
mb == margin-bottom
g == gap
$properties: (
w: width,
h: height,
p: padding,
px: padding-inline,
pr: padding-right,
py: padding-block,
br: border-radius,
mb: margin-bottom,
g: gap
);
Optimize CSS bundle size by generating only needed classes:
$custom-class: true;
$class-config: (
w: (50), // Only width:50 classes
h: (), // No height classes
px: (24), // Only padding-inline:24
// Empty arrays = no classes generated
);
EVA CSS transforms pixel values from Figma into fluid CSS variables using advanced mathematical calculations. Every variable is generated using the clamp() function with carefully calculated minimum, fluid, and maximum values.
$screen: 1440px; // Figma design width $min: 0.5rem; // Minimum scaling limit $max: 1rem; // Maximum scaling limit $Φ: 1.61803398875; // Golden ratio $ez: 142.4; // Extreme scaling factor
clamp(min, fluid, max)
CSS clamp() function with calculated values
How a Figma pixel value becomes a fluid CSS variable.
getPercent($size) = ($size / $screen) * 100 Example for 20px: getPercent(20) = (20 / 1440) * 100 = 1.39%
Converts pixel value to percentage of screen width
toRem($size) = $size / 16 * 1rem getMinRem($percent) = $percent * $min getMaxRem($percent) = $percent * $max Note: The actual mathematical formula in EVA CSS is more complex than these simplified examples. See the CSS output for real values.
getVW($percent) = $percent * 1vw vw-light: (getVW(percent) / 4) + (toRem(size) / 1.33) vw-medium: (getVW(percent) / 2) + (toRem(size) / 2) vw-strong: (getVW(percent) / 1.33) + (toRem(size) / 4) vw-extrem: getVW(percent * $ez) - $rem-min
Different fluid calculations for each modifier
How each modifier affects the final clamp() values.
min: $rem-min fluid: vw-medium max: $rem-max
Standard responsive scaling
min: $rem-min / $Φ fluid: vw-strong max: $rem-max
Stronger responsive scaling
min: $min (0.5rem) fluid: vw-extrem max: $rem-max
Maximum responsive scaling
min: $rem-min * $Φ fluid: vw-light max: $rem-max
Minimal responsive scaling
Complete calculation breakdown for a 20px value from Figma.
getPercent(20) = (20 / 1440) * 100 = 1.39%
toRem(20) = 20 / 16 = 1.25rem
min: 0.7rem fluid: 0.7vw + 0.63rem max: 1.39rem Result: clamp(0.7rem, 0.7vw + 0.63rem, 1.39rem) Note: The actual mathematical formula is more complex than the simplified examples shown above.
min: 0.43rem fluid: 1.05vw + 0.31rem max: 1.39rem Result: clamp(0.43rem, 1.05vw + 0.31rem, 1.39rem)
min: 0.5rem fluid: 1.98vw - 0.7rem max: 1.39rem Result: clamp(0.5rem, 1.98vw - 0.7rem, 1.39rem)
min: 1.13rem fluid: 0.35vw + 0.94rem max: 1.39rem Result: clamp(1.13rem, 0.35vw + 0.94rem, 1.39rem)
Different mathematical approaches for spacing calculations.
$min: 0.5rem $max: 1rem $Φ: 1.61803398875 $ez: 142.4
Optimized for layout and spacing