eva-css-fluid 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +248 -0
- package/dist/eva.css +5689 -0
- package/dist/eva.css.map +1 -0
- package/dist/eva.min.css +1 -0
- package/dist/eva.min.css.map +1 -0
- package/package.json +54 -0
- package/src/_colors.scss +198 -0
- package/src/_components.scss +434 -0
- package/src/_config.scss +70 -0
- package/src/_eva.scss +334 -0
- package/src/_flex.scss +296 -0
- package/src/_font.scss +63 -0
- package/src/_gradients.scss +128 -0
- package/src/_grid.scss +137 -0
- package/src/_reset.scss +83 -0
- package/src/_theme.scss +99 -0
- package/src/_utils.scss +114 -0
- package/src/index.scss +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# @eva/css
|
|
2
|
+
|
|
3
|
+
> Fluid design framework with OKLCH colors - Transform static designs into responsive fluid systems
|
|
4
|
+
|
|
5
|
+
## π― Features
|
|
6
|
+
|
|
7
|
+
- **Fluid Scaling System**: Modern clamp() functions for truly responsive designs
|
|
8
|
+
- **OKLCH Colors**: Perceptually uniform color system with opacity/brightness modifiers
|
|
9
|
+
- **Modern Gradients**: Emmet-style syntax for ultra-compact gradient creation
|
|
10
|
+
- **Theme System**: Built-in dark/light mode with seamless switching
|
|
11
|
+
- **Two Modes**: Utility classes or CSS variables only
|
|
12
|
+
- **Zero JavaScript**: Pure CSS/SCSS solution
|
|
13
|
+
|
|
14
|
+
## π¦ Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @eva/css
|
|
18
|
+
# or
|
|
19
|
+
pnpm add @eva/css
|
|
20
|
+
# or
|
|
21
|
+
yarn add @eva/css
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## π Quick Start
|
|
25
|
+
|
|
26
|
+
### Using Pre-built CSS
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<link rel="stylesheet" href="node_modules/@eva/css/dist/eva.css">
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Using SCSS with Default Configuration
|
|
33
|
+
|
|
34
|
+
```scss
|
|
35
|
+
@use '@eva/css';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Using SCSS with Custom Configuration
|
|
39
|
+
|
|
40
|
+
**This is the main feature of EVA CSS!** Simply change the `$sizes` to match your Figma design:
|
|
41
|
+
|
|
42
|
+
```scss
|
|
43
|
+
// Example: Sizes extracted from Figma design
|
|
44
|
+
@use '@eva/css' with (
|
|
45
|
+
$sizes: 4, 8, 16, 32, 64, 128, // π Change these to YOUR design sizes!
|
|
46
|
+
$font-sizes: 14, 16, 20, 24, 32, // π Change these to YOUR font sizes!
|
|
47
|
+
$build-class: true,
|
|
48
|
+
$px-rem-suffix: false
|
|
49
|
+
);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Real example from a Figma project:**
|
|
53
|
+
|
|
54
|
+
```scss
|
|
55
|
+
// Extracted from Figma: gaps, paddings, widths, heights
|
|
56
|
+
@use '@eva/css' with (
|
|
57
|
+
$sizes: 4, 8, 16, 32, 64, 120, 141, // 4=content-gap, 8=color-gap, 16=padding,
|
|
58
|
+
// 32=section-gap, 64=hero-gap,
|
|
59
|
+
// 120=H1, 141=circles
|
|
60
|
+
$font-sizes: 16, 120, // 16=body, 120=heading
|
|
61
|
+
$build-class: true
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Now all these sizes are available as fluid variables!
|
|
65
|
+
// var(--4), var(--8), var(--16), var(--32), var(--64), var(--120), var(--141)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## π¨ Configuration Options
|
|
69
|
+
|
|
70
|
+
| Variable | Default | Description |
|
|
71
|
+
|----------|---------|-------------|
|
|
72
|
+
| `$sizes` | `4, 8, 12, 16, 24, 32, 48, 64, 96, 128` | Available fluid size values |
|
|
73
|
+
| `$font-sizes` | `12, 14, 16, 18, 20, 24, 32, 48` | Available font sizes |
|
|
74
|
+
| `$build-class` | `true` | Generate utility classes (`true`) or variables only (`false`) |
|
|
75
|
+
| `$px-rem-suffix` | `false` | Add px/rem static values for debugging |
|
|
76
|
+
| `$name-by-size` | `true` | Use size values in variable names |
|
|
77
|
+
| `$custom-class` | `false` | Enable custom class generation |
|
|
78
|
+
|
|
79
|
+
## π‘ Usage Examples
|
|
80
|
+
|
|
81
|
+
### Utility Classes Mode (`$build-class: true`)
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<div class="w-64 h-64 p-16 _bg-brand _c-light">
|
|
85
|
+
<h1 class="fs-32 _c-accent">Hello EVA</h1>
|
|
86
|
+
<p class="fs-16 _c-light_">Fluid design framework</p>
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Variables Mode (`$build-class: false`)
|
|
91
|
+
|
|
92
|
+
```scss
|
|
93
|
+
.hero {
|
|
94
|
+
width: var(--64);
|
|
95
|
+
padding: var(--16);
|
|
96
|
+
background: var(--brand);
|
|
97
|
+
color: var(--light);
|
|
98
|
+
|
|
99
|
+
h1 {
|
|
100
|
+
font-size: var(--32);
|
|
101
|
+
color: var(--accent);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## π¨ Fluid Scaling
|
|
107
|
+
|
|
108
|
+
EVA CSS uses modern CSS `clamp()` for fluid scaling:
|
|
109
|
+
|
|
110
|
+
```scss
|
|
111
|
+
// Size variables
|
|
112
|
+
var(--16) // Standard fluid scaling
|
|
113
|
+
var(--16_) // Reduced scaling
|
|
114
|
+
var(--16__) // Extreme reduced
|
|
115
|
+
var(--16-) // Extended scaling
|
|
116
|
+
|
|
117
|
+
// Font size variables
|
|
118
|
+
var(--24) // Standard fluid font
|
|
119
|
+
var(--24_) // Reduced scaling
|
|
120
|
+
var(--24__) // Extreme reduced
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## π OKLCH Color System
|
|
124
|
+
|
|
125
|
+
```scss
|
|
126
|
+
// Base colors
|
|
127
|
+
var(--brand) // Base brand color
|
|
128
|
+
var(--accent) // Accent color
|
|
129
|
+
var(--extra) // Extra color
|
|
130
|
+
var(--light) // Light color
|
|
131
|
+
var(--dark) // Dark color
|
|
132
|
+
|
|
133
|
+
// Opacity modifiers
|
|
134
|
+
var(--brand_) // 65% opacity
|
|
135
|
+
var(--brand__) // 35% opacity
|
|
136
|
+
var(--brand___) // 5% opacity
|
|
137
|
+
|
|
138
|
+
// Brightness modifiers
|
|
139
|
+
var(--brand-d) // Darker
|
|
140
|
+
var(--brand-b) // Brighter
|
|
141
|
+
var(--brand-d_) // More darker
|
|
142
|
+
var(--brand-b_) // More brighter
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## π¨ Gradient System
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<!-- Linear gradient -->
|
|
149
|
+
<div class="grad-linear from-brand to-accent d-r">Content</div>
|
|
150
|
+
|
|
151
|
+
<!-- Radial gradient -->
|
|
152
|
+
<div class="grad-radial from-extra to-transparent bg-size_">Content</div>
|
|
153
|
+
|
|
154
|
+
<!-- Gradient text -->
|
|
155
|
+
<h1 class="grad-linear-text from-brand to-accent d-br">Gradient Text</h1>
|
|
156
|
+
|
|
157
|
+
<!-- Animated gradient -->
|
|
158
|
+
<div class="grad-linear from-brand to-accent a-45 animated">Content</div>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## π Theme System
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<body class="current-theme theme-myproject">
|
|
165
|
+
<!-- Content -->
|
|
166
|
+
<button onclick="document.body.classList.toggle('toggle-theme')">
|
|
167
|
+
Toggle Theme
|
|
168
|
+
</button>
|
|
169
|
+
</body>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```scss
|
|
173
|
+
// Define your theme
|
|
174
|
+
.theme-myproject {
|
|
175
|
+
--brand-lightness: 62.8%;
|
|
176
|
+
--brand-chroma: 0.258;
|
|
177
|
+
--brand-hue: 29.23;
|
|
178
|
+
|
|
179
|
+
--accent-lightness: 51.7%;
|
|
180
|
+
--accent-chroma: 0.293;
|
|
181
|
+
--accent-hue: 289.66;
|
|
182
|
+
|
|
183
|
+
--current-lightness: 96.4%; // Light mode
|
|
184
|
+
--current-darkness: 26.4%; // Dark mode
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## π Documentation
|
|
189
|
+
|
|
190
|
+
- [Full Documentation](https://eva-css.xyz/)
|
|
191
|
+
- [GitHub Repository](https://github.com/nkdeus/eva)
|
|
192
|
+
- [Examples & Demo](https://eva-css.xyz/demo/)
|
|
193
|
+
|
|
194
|
+
## π― Quick Workflow: Figma β EVA CSS
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# 1. Analyze your Figma design and extract ALL sizes used
|
|
198
|
+
# Look for: gaps, paddings, margins, widths, heights, font-sizes
|
|
199
|
+
|
|
200
|
+
# 2. Create your project SCSS file
|
|
201
|
+
# my-project.scss
|
|
202
|
+
@use '@eva/css' with (
|
|
203
|
+
$sizes: 4, 8, 16, 32, 64, 120, 141, # ALL sizes from Figma
|
|
204
|
+
$font-sizes: 16, 120, # ALL font sizes from Figma
|
|
205
|
+
$build-class: true
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
# 3. Compile
|
|
209
|
+
npx sass my-project.scss:my-project.css
|
|
210
|
+
|
|
211
|
+
# 4. Use in HTML with generated utility classes
|
|
212
|
+
<div class="w-141 h-141 p-16 g-8">...</div>
|
|
213
|
+
|
|
214
|
+
# 5. Or use CSS variables in custom CSS
|
|
215
|
+
.my-component {
|
|
216
|
+
width: var(--141);
|
|
217
|
+
padding: var(--16);
|
|
218
|
+
gap: var(--8);
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**The magic:** All sizes scale fluidly across viewport sizes using `clamp()` - no media queries needed!
|
|
223
|
+
|
|
224
|
+
## π οΈ Build from Source
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
cd packages/eva-css
|
|
228
|
+
npm run build # Build expanded CSS
|
|
229
|
+
npm run build:min # Build minified CSS
|
|
230
|
+
npm run watch # Watch mode for development
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## π License
|
|
234
|
+
|
|
235
|
+
MIT Β© [MichaΓ«l Tati](https://ulysse-2029.com/)
|
|
236
|
+
|
|
237
|
+
## π¨βπ» Author
|
|
238
|
+
|
|
239
|
+
**MichaΓ«l Tati**
|
|
240
|
+
- Portfolio: [ulysse-2029.com](https://ulysse-2029.com/)
|
|
241
|
+
- LinkedIn: [linkedin.com/in/mtati](https://www.linkedin.com/in/mtati/)
|
|
242
|
+
- Website: [eva-css.xyz](https://eva-css.xyz/)
|
|
243
|
+
|
|
244
|
+
## π Related Packages
|
|
245
|
+
|
|
246
|
+
- [@eva/colors](https://www.npmjs.com/package/@eva/colors) - OKLCH color utilities
|
|
247
|
+
- [@eva/purge](https://www.npmjs.com/package/@eva/purge) - CSS optimization tool
|
|
248
|
+
- [@eva/mcp-server](https://www.npmjs.com/package/@eva/mcp-server) - Figma to HTML MCP server
|