The fluid DOCS of EVA CSS
EVA CSS is built around a 1440px design system, perfect for Figma workflows.
The scaling system adapts seamlessly to any viewport while maintaining design consistency.
$screen: 1440; $sizes: 4, 8, 12, 20, 32, 52, 84, 136, 220, 356, 576, 712; $name-by-size: true; // Uses actual size values as variable names
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!
These variables control the fundamental behavior of EVA CSS framework.
_eva.scss - Main framework configuration
Development mode toggle
$dev-mode: true; // Development $dev-mode: false; // Production
Enables additional classes and debugging features
CSS class generation
$build-class: true; // Generate utility classes $build-class: false; // CSS variables only
Controls whether utility classes are generated
Selective class generation
$custom-class: true; // Filtered classes $custom-class: false; // All classes
Enables granular control over which classes are generated
Variable naming convention
$name-by-size: true; // --20, --32, --52 $name-by-size: false; // --1, --2, --3
Uses actual pixel values vs sequential numbers
Customize the spacing and typography scale to match your design system.
_grid.scss - Grid and spacing system
Base screen width for calculations
$screen: 1440; // Default Figma width
Used for percentage calculations in clamp() functions
Spacing scale values
$sizes: 4, 8, 12, 20, 32, 34, 52, 84, 136, 220, 356, 576, 712;
Pixel values from your design system
Typography scale values
$font-sizes: 12, 16, 18, 24, 36, 52, 72;
Font sizes from your design system
Fine-tune the responsive behavior and class generation.
_components.scss - Component generation
CSS properties to generate
$properties: ( w: width, h: height, p: padding, px: padding-inline, py: padding-block, br: border-radius, g: gap );
Granular class filtering
$class-config: ( w: (50), // Only width:50 h: (), // No height classes px: (24), // Only padding-inline:24 g: () // No gap classes );
Control which sizes are generated for each property
Typography class filtering
$font-class-config: ( fs: (14, 16, 18, 24, 32) );
Control which font sizes generate classes
Advanced mathematical values that control the responsive scaling behavior.
_eva.scss - Mathematical functions
$Φ: 1.61803398875;
Used for proportional scaling calculations
$min: 0.5rem; $max: 1rem;
Minimum and maximum scaling limits
$ez: 142.4; // Spacing $ez: varies; // Typography
Controls extreme responsive behavior (different for spacing vs typography)
Common configuration patterns for different use cases.
try.scss - Example project configuration
$dev-mode: true; $build-class: true; $custom-class: false; $name-by-size: true;
Full feature set with debugging
$dev-mode: false; $build-class: true; $custom-class: true; $name-by-size: true;
Optimized for production with filtered classes
$dev-mode: false; $build-class: false; $custom-class: false; $name-by-size: true;
Generate only CSS variables, no utility classes
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 prefixes 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 );
Typography scales fluidly based on your design system. Perfect for maintaining visual hierarchy across all devices.
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 (spacing) / Responsive scaling (typography)
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 typography and spacing.
$min: 0.5rem $max: 1rem $Φ: 1.61803398875 $ez: 142.4
Optimized for layout and spacing
$min: 0.6rem $max: 1rem $Φ: 1.3 $ez: 142.4
Optimized for readability and hierarchy
All the mathematical functions used in EVA CSS calculations.
round2($number) getPercent($size) toPx($size) toRem($size)
getMinRem($percent) getMaxRem($percent) getVW($percent)
getFinalMinDiv($size, $Φ) getFinalMinMulti($size, $Φ)
Get EVA CSS up and running in minutes with this simple setup process.
git clone https://github.com/nkdeus/eva.git cd eva
Clone the EVA CSS repository to your local machine
npm install
Install all required Node.js dependencies
# Use your IDE's local server # VS Code: Live Server extension # Or any other local development server
Start your local development server to serve the HTML files
npm run watch
Compile and watch SCSS files for changes
# Rename try.scss to your project name # Configure spacing and typography values # Customize colors and themes
Customize the framework to match your design system
Understanding the key files and directories in your EVA CSS project.
styles/framework/ - Core SCSS files
styles/projets/ - Project-specific files
Core SCSS files and configuration
Your project-specific SCSS files
Compiled CSS output
Essential configuration steps to get the most out of EVA CSS.
# Copy try.scss to your-project.scss # Configure your project settings
Create your own project file based on the example
$sizes: 4, 8, 12, 20, 32, 52, 84, 136, 220, 356, 576, 712;
Match your Figma design system spacing
Based on 1440px Figma design (configurable)
$font-sizes: 12, 16, 18, 24, 36, 52, 72;
Define your font size hierarchy
Best practices for working with EVA CSS in your development process.
$dev-mode: true; // Enable all features $build-class: true; // Generate utility classes
Use during development for full feature access
$dev-mode: false; // Disable debug features $custom-class: true; // Filter classes
Optimize for production with filtered output
$build-class: false; // No utility classes $name-by-size: true; // Design-based naming
Generate only CSS variables for custom CSS
Warning: Once you enter the world of fluid CSS, traditional responsive design and breakpoints will feel like something from the past!
Say goodbye to media queries and hello to truly adaptive layouts that scale naturally across every screen.