chaincss 2.1.38 → 2.2.0
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/ROADMAP.md +31 -0
- package/dist/cli/index.js +458 -3
- package/dist/compiler/analyzer.d.ts +12 -0
- package/dist/compiler/css-if-transpiler.d.ts +33 -0
- package/dist/compiler/design-orchestrator.d.ts +119 -0
- package/dist/compiler/intent-engine.d.ts +49 -0
- package/dist/compiler/math-engine.d.ts +89 -0
- package/dist/compiler/scroll-timeline.d.ts +91 -0
- package/dist/compiler/style-graph.d.ts +30 -0
- package/dist/core/compiler.d.ts +12 -0
- package/dist/core/types.d.ts +145 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1765 -9
- package/dist/plugins/vite.js +451 -3
- package/package.json +1 -1
- package/src/compiler/analyzer.ts +62 -0
- package/src/compiler/css-if-transpiler.ts +117 -0
- package/src/compiler/design-orchestrator.ts +322 -0
- package/src/compiler/intent-engine.ts +402 -0
- package/src/compiler/math-engine.ts +511 -0
- package/src/compiler/scroll-timeline.ts +284 -0
- package/src/compiler/style-graph.ts +660 -0
- package/src/core/compiler.ts +40 -0
- package/src/core/types.ts +206 -0
- package/src/index.ts +103 -1
- package/demo/demo/node_modules/caniuse-db/fulldata-json/data-2.0.json +0 -1
- package/demo/index.html +0 -16
- package/demo/package.json +0 -20
- package/demo/src/App.tsx +0 -117
- package/demo/src/chaincss-barrel.ts +0 -9
- package/demo/src/main.tsx +0 -8
- package/demo/src/styles.chain.ts +0 -300
- package/demo/vite.config.ts +0 -46
package/demo/src/styles.chain.ts
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import { chain } from 'chaincss';
|
|
2
|
-
|
|
3
|
-
// ═══════════════════════════════════════
|
|
4
|
-
// NAVIGATION
|
|
5
|
-
// ═══════════════════════════════════════
|
|
6
|
-
export const nav = chain()
|
|
7
|
-
.fixed({ top: 0, left: 0, right: 0 })
|
|
8
|
-
.zIndex(1000)
|
|
9
|
-
.backdropFilter('blur(20px)')
|
|
10
|
-
.bg('rgba(15,23,42,0.9)')
|
|
11
|
-
.borderBottom('1px solid rgba(255,255,255,0.08)')
|
|
12
|
-
.$el('nav');
|
|
13
|
-
|
|
14
|
-
export const navInner = chain()
|
|
15
|
-
.display('flex')
|
|
16
|
-
.items('center')
|
|
17
|
-
.justify('space-between')
|
|
18
|
-
.maxW(1200)
|
|
19
|
-
.mx('auto')
|
|
20
|
-
.px(24)
|
|
21
|
-
.py(16)
|
|
22
|
-
.$el('nav-inner');
|
|
23
|
-
|
|
24
|
-
export const navLogo = chain()
|
|
25
|
-
.fs(22)
|
|
26
|
-
.fw(800)
|
|
27
|
-
.textGradient(['#6366f1', '#06b6d4'])
|
|
28
|
-
.$el('nav-logo');
|
|
29
|
-
|
|
30
|
-
export const navLinks = chain()
|
|
31
|
-
.display('flex')
|
|
32
|
-
.items('center')
|
|
33
|
-
.gap(32)
|
|
34
|
-
.$el('nav-links');
|
|
35
|
-
|
|
36
|
-
export const navLink = chain()
|
|
37
|
-
.fs(14)
|
|
38
|
-
.fw(500)
|
|
39
|
-
.color('#cbd5e1')
|
|
40
|
-
.transition('color 0.2s ease')
|
|
41
|
-
.hover().color('#ffffff').end()
|
|
42
|
-
.$el('nav-link');
|
|
43
|
-
|
|
44
|
-
// ═══════════════════════════════════════
|
|
45
|
-
// HERO
|
|
46
|
-
// ═══════════════════════════════════════
|
|
47
|
-
export const hero = chain()
|
|
48
|
-
.display('flex')
|
|
49
|
-
.flexDir('column')
|
|
50
|
-
.items('center')
|
|
51
|
-
.justify('center')
|
|
52
|
-
.minH('100vh')
|
|
53
|
-
.pt(80)
|
|
54
|
-
.pb(64)
|
|
55
|
-
.px(24)
|
|
56
|
-
.bg('#0f172a')
|
|
57
|
-
.pos('relative')
|
|
58
|
-
.ov('hidden')
|
|
59
|
-
.$el('hero');
|
|
60
|
-
|
|
61
|
-
export const heroTitle = chain()
|
|
62
|
-
.fs('clamp(2.5rem, 6vw, 4.5rem)')
|
|
63
|
-
.fw(800)
|
|
64
|
-
.color('#ffffff')
|
|
65
|
-
.align('center')
|
|
66
|
-
.maxW(800)
|
|
67
|
-
.lh(1.1)
|
|
68
|
-
.mb(16)
|
|
69
|
-
.$el('hero-title');
|
|
70
|
-
|
|
71
|
-
export const heroSubtitle = chain()
|
|
72
|
-
.fs(18)
|
|
73
|
-
.color('#94a3b8')
|
|
74
|
-
.align('center')
|
|
75
|
-
.maxW(600)
|
|
76
|
-
.lh(1.7)
|
|
77
|
-
.mb(32)
|
|
78
|
-
.$el('hero-subtitle');
|
|
79
|
-
|
|
80
|
-
// ═══════════════════════════════════════
|
|
81
|
-
// BUTTONS
|
|
82
|
-
// ═══════════════════════════════════════
|
|
83
|
-
export const buttonPrimary = chain()
|
|
84
|
-
.display('inline-flex')
|
|
85
|
-
.items('center')
|
|
86
|
-
.gap(8)
|
|
87
|
-
.px(28)
|
|
88
|
-
.py(14)
|
|
89
|
-
.bg('#6366f1')
|
|
90
|
-
.color('#ffffff')
|
|
91
|
-
.fs(16)
|
|
92
|
-
.fw(600)
|
|
93
|
-
.rounded(12)
|
|
94
|
-
.border('none')
|
|
95
|
-
.cursor('pointer')
|
|
96
|
-
.transition('all 0.2s ease')
|
|
97
|
-
.hover()
|
|
98
|
-
.bg('#4f46e5')
|
|
99
|
-
.transform('translateY(-2px)')
|
|
100
|
-
.shadow('0 10px 25px rgba(99,102,241,0.4)')
|
|
101
|
-
.end()
|
|
102
|
-
.$el('btn-primary');
|
|
103
|
-
|
|
104
|
-
export const buttonSecondary = chain()
|
|
105
|
-
.display('inline-flex')
|
|
106
|
-
.items('center')
|
|
107
|
-
.gap(8)
|
|
108
|
-
.px(28)
|
|
109
|
-
.py(14)
|
|
110
|
-
.bg('rgba(255,255,255,0.08)')
|
|
111
|
-
.color('#ffffff')
|
|
112
|
-
.fs(16)
|
|
113
|
-
.fw(600)
|
|
114
|
-
.rounded(12)
|
|
115
|
-
.border('1px solid rgba(255,255,255,0.15)')
|
|
116
|
-
.cursor('pointer')
|
|
117
|
-
.transition('all 0.2s ease')
|
|
118
|
-
.hover()
|
|
119
|
-
.bg('rgba(255,255,255,0.15)')
|
|
120
|
-
.transform('translateY(-2px)')
|
|
121
|
-
.end()
|
|
122
|
-
.$el('btn-secondary');
|
|
123
|
-
|
|
124
|
-
// ═══════════════════════════════════════
|
|
125
|
-
// FEATURES SECTION
|
|
126
|
-
// ═══════════════════════════════════════
|
|
127
|
-
export const section = chain()
|
|
128
|
-
.py(80)
|
|
129
|
-
.px(24)
|
|
130
|
-
.bg('#0f172a')
|
|
131
|
-
.$el('section');
|
|
132
|
-
|
|
133
|
-
export const sectionHeader = chain()
|
|
134
|
-
.align('center')
|
|
135
|
-
.maxW(600)
|
|
136
|
-
.mx('auto')
|
|
137
|
-
.mb(48)
|
|
138
|
-
.$el('section-header');
|
|
139
|
-
|
|
140
|
-
export const sectionTitle = chain()
|
|
141
|
-
.fs(36)
|
|
142
|
-
.fw(800)
|
|
143
|
-
.color('#ffffff')
|
|
144
|
-
.mb(16)
|
|
145
|
-
.$el('section-title');
|
|
146
|
-
|
|
147
|
-
export const sectionDesc = chain()
|
|
148
|
-
.fs(18)
|
|
149
|
-
.color('#94a3b8')
|
|
150
|
-
.lh(1.6)
|
|
151
|
-
.$el('section-desc');
|
|
152
|
-
|
|
153
|
-
export const featureGrid = chain()
|
|
154
|
-
.display('grid')
|
|
155
|
-
.gridTemplateColumns('repeat(3, 1fr)')
|
|
156
|
-
.gap(24)
|
|
157
|
-
.maxW(1200)
|
|
158
|
-
.mx('auto')
|
|
159
|
-
.$el('feature-grid');
|
|
160
|
-
|
|
161
|
-
export const featureCard = chain()
|
|
162
|
-
.bg('rgba(255,255,255,0.04)')
|
|
163
|
-
.rounded(16)
|
|
164
|
-
.p(32)
|
|
165
|
-
.border('1px solid rgba(255,255,255,0.08)')
|
|
166
|
-
.transition('all 0.3s ease')
|
|
167
|
-
.hover()
|
|
168
|
-
.transform('translateY(-4px)')
|
|
169
|
-
.border('1px solid rgba(99,102,241,0.4)')
|
|
170
|
-
.shadow('0 20px 40px rgba(0,0,0,0.3)')
|
|
171
|
-
.end()
|
|
172
|
-
.$el('feature-card');
|
|
173
|
-
|
|
174
|
-
export const featureIcon = chain()
|
|
175
|
-
.circle(48)
|
|
176
|
-
.bg('rgba(99,102,241,0.2)')
|
|
177
|
-
.display('flex')
|
|
178
|
-
.items('center')
|
|
179
|
-
.justify('center')
|
|
180
|
-
.fs(22)
|
|
181
|
-
.mb(16)
|
|
182
|
-
.$el('feature-icon');
|
|
183
|
-
|
|
184
|
-
export const featureTitle = chain()
|
|
185
|
-
.fs(18)
|
|
186
|
-
.fw(600)
|
|
187
|
-
.color('#ffffff')
|
|
188
|
-
.mb(8)
|
|
189
|
-
.$el('feature-title');
|
|
190
|
-
|
|
191
|
-
export const featureDesc = chain()
|
|
192
|
-
.fs(14)
|
|
193
|
-
.color('#94a3b8')
|
|
194
|
-
.lh(1.6)
|
|
195
|
-
.$el('feature-desc');
|
|
196
|
-
|
|
197
|
-
// ═══════════════════════════════════════
|
|
198
|
-
// PRICING
|
|
199
|
-
// ═══════════════════════════════════════
|
|
200
|
-
export const pricingGrid = chain()
|
|
201
|
-
.display('grid')
|
|
202
|
-
.gridTemplateColumns('repeat(3, 1fr)')
|
|
203
|
-
.gap(24)
|
|
204
|
-
.maxW(1000)
|
|
205
|
-
.mx('auto')
|
|
206
|
-
.$el('pricing-grid');
|
|
207
|
-
|
|
208
|
-
export const pricingCard = chain()
|
|
209
|
-
.bg('rgba(255,255,255,0.04)')
|
|
210
|
-
.rounded(16)
|
|
211
|
-
.p(32)
|
|
212
|
-
.border('1px solid rgba(255,255,255,0.08)')
|
|
213
|
-
.display('flex')
|
|
214
|
-
.flexDir('column')
|
|
215
|
-
.transition('all 0.3s ease')
|
|
216
|
-
.hover()
|
|
217
|
-
.transform('translateY(-8px)')
|
|
218
|
-
.border('1px solid rgba(99,102,241,0.4)')
|
|
219
|
-
.end()
|
|
220
|
-
.$el('pricing-card');
|
|
221
|
-
|
|
222
|
-
export const pricingCardFeatured = chain()
|
|
223
|
-
.bg('rgba(99,102,241,0.1)')
|
|
224
|
-
.rounded(16)
|
|
225
|
-
.p(32)
|
|
226
|
-
.border('1px solid rgba(99,102,241,0.4)')
|
|
227
|
-
.display('flex')
|
|
228
|
-
.flexDir('column')
|
|
229
|
-
.pos('relative')
|
|
230
|
-
.transition('all 0.3s ease')
|
|
231
|
-
.hover()
|
|
232
|
-
.transform('translateY(-8px)')
|
|
233
|
-
.end()
|
|
234
|
-
.$el('pricing-card-featured');
|
|
235
|
-
|
|
236
|
-
export const pricingBadge = chain()
|
|
237
|
-
.pill()
|
|
238
|
-
.fs(11)
|
|
239
|
-
.fw(700)
|
|
240
|
-
.bg('rgba(99,102,241,0.3)')
|
|
241
|
-
.color('#c7d2fe')
|
|
242
|
-
.mb(16)
|
|
243
|
-
.$el('pricing-badge');
|
|
244
|
-
|
|
245
|
-
export const pricingPlanName = chain()
|
|
246
|
-
.fs(18)
|
|
247
|
-
.fw(600)
|
|
248
|
-
.color('#ffffff')
|
|
249
|
-
.mb(8)
|
|
250
|
-
.$el('pricing-plan-name');
|
|
251
|
-
|
|
252
|
-
export const pricingPrice = chain()
|
|
253
|
-
.fs(42)
|
|
254
|
-
.fw(800)
|
|
255
|
-
.color('#ffffff')
|
|
256
|
-
.mb(16)
|
|
257
|
-
.$el('pricing-price');
|
|
258
|
-
|
|
259
|
-
export const pricingFeature = chain()
|
|
260
|
-
.fs(14)
|
|
261
|
-
.color('#cbd5e1')
|
|
262
|
-
.py(6)
|
|
263
|
-
.display('flex')
|
|
264
|
-
.items('center')
|
|
265
|
-
.gap(8)
|
|
266
|
-
.$el('pricing-feature');
|
|
267
|
-
|
|
268
|
-
// ═══════════════════════════════════════
|
|
269
|
-
// FOOTER
|
|
270
|
-
// ═══════════════════════════════════════
|
|
271
|
-
export const footer = chain()
|
|
272
|
-
.bg('#0a0f1a')
|
|
273
|
-
.borderT('1px solid rgba(255,255,255,0.06)')
|
|
274
|
-
.py(48)
|
|
275
|
-
.px(24)
|
|
276
|
-
.$el('footer');
|
|
277
|
-
|
|
278
|
-
export const footerGrid = chain()
|
|
279
|
-
.display('grid')
|
|
280
|
-
.gridTemplateColumns('repeat(4, 1fr)')
|
|
281
|
-
.gap(32)
|
|
282
|
-
.maxW(1200)
|
|
283
|
-
.mx('auto')
|
|
284
|
-
.$el('footer-grid');
|
|
285
|
-
|
|
286
|
-
export const footerHeading = chain()
|
|
287
|
-
.fs(14)
|
|
288
|
-
.fw(600)
|
|
289
|
-
.color('#ffffff')
|
|
290
|
-
.mb(16)
|
|
291
|
-
.$el('footer-heading');
|
|
292
|
-
|
|
293
|
-
export const footerLink = chain()
|
|
294
|
-
.fs(14)
|
|
295
|
-
.color('#64748b')
|
|
296
|
-
.transition('color 0.2s')
|
|
297
|
-
.display('block')
|
|
298
|
-
.py(4)
|
|
299
|
-
.hover().color('#ffffff').end()
|
|
300
|
-
.$el('footer-link');
|
package/demo/vite.config.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import chaincss from '../src/plugins/vite.js';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const chaincssRoot = path.resolve(__dirname, '..');
|
|
9
|
-
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
plugins: [
|
|
12
|
-
// ChainCSS plugin with proper build-time extraction
|
|
13
|
-
chaincss({
|
|
14
|
-
atomic: true,
|
|
15
|
-
verbose: true, // Show what's happening
|
|
16
|
-
injectGlobal: true, // Auto-inject CSS
|
|
17
|
-
sourceComments: true, // Show source in generated CSS
|
|
18
|
-
prefix: false,
|
|
19
|
-
breakpoints: {
|
|
20
|
-
sm: '(max-width: 640px)',
|
|
21
|
-
md: '(max-width: 768px)',
|
|
22
|
-
lg: '(max-width: 1024px)',
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
react(),
|
|
26
|
-
],
|
|
27
|
-
root: __dirname,
|
|
28
|
-
resolve: {
|
|
29
|
-
alias: [
|
|
30
|
-
{ find: 'chaincss/runtime', replacement: path.resolve(chaincssRoot, 'src/runtime/index.ts') },
|
|
31
|
-
{ find: 'chaincss/plugin/vite', replacement: path.resolve(chaincssRoot, 'src/plugins/vite.ts') },
|
|
32
|
-
{ find: 'chaincss', replacement: path.resolve(__dirname, 'src/chaincss-barrel.ts') },
|
|
33
|
-
{ find: 'caniuse-db/fulldata-json/data-2.0.json', replacement: path.resolve(__dirname, 'node_modules/caniuse-db/fulldata-json/data-2.0.json') },
|
|
34
|
-
{ find: 'autoprefixer', replacement: path.resolve(__dirname, 'node_modules/autoprefixer/index.js') },
|
|
35
|
-
{ find: 'vue', replacement: path.resolve(__dirname, 'node_modules/vue/index.js') },
|
|
36
|
-
{ find: 'svelte/store', replacement: path.resolve(__dirname, 'node_modules/svelte/store/index.js') },
|
|
37
|
-
{ find: 'svelte', replacement: path.resolve(__dirname, 'node_modules/svelte/index.js') },
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
define: { 'process.env': JSON.stringify({ NODE_ENV: 'development' }) },
|
|
41
|
-
optimizeDeps: { exclude: ['vue', 'svelte', 'svelte/store'] },
|
|
42
|
-
server: {
|
|
43
|
-
fs: { allow: [__dirname, chaincssRoot] },
|
|
44
|
-
hmr: { overlay: false },
|
|
45
|
-
},
|
|
46
|
-
});
|