chaincss 2.0.6 → 2.1.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/CHANGELOG.md +30 -0
- package/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +28 -0
- package/README.md +454 -231
- package/demo/demo/node_modules/caniuse-db/fulldata-json/data-2.0.json +1 -0
- package/demo/index.html +16 -0
- package/demo/package.json +20 -0
- package/demo/src/App.tsx +117 -0
- package/demo/src/chaincss-barrel.ts +9 -0
- package/demo/src/main.tsx +8 -0
- package/demo/src/styles.chain.ts +300 -0
- package/demo/vite.config.ts +46 -0
- package/dist/cli/commands/build.d.ts +0 -1
- package/dist/cli/commands/cache.d.ts +1 -0
- package/dist/cli/commands/init.d.ts +6 -3
- package/dist/cli/commands/timeline.d.ts +0 -1
- package/dist/cli/commands/watch.d.ts +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +3213 -5296
- package/dist/cli/types.d.ts +51 -20
- package/dist/cli/utils/config-loader.d.ts +0 -1
- package/dist/cli/utils/file-utils.d.ts +27 -3
- package/dist/cli/utils/logger.d.ts +0 -1
- package/dist/compiler/Chain.d.ts +215 -0
- package/dist/compiler/animations.d.ts +76 -0
- package/dist/compiler/atomic-optimizer.d.ts +47 -12
- package/dist/compiler/breakpoints.d.ts +46 -0
- package/dist/compiler/btt.d.ts +36 -60
- package/dist/compiler/cache-manager.d.ts +58 -4
- package/dist/compiler/commonProps.d.ts +0 -1
- package/dist/compiler/content-addressable-cache.d.ts +78 -0
- package/dist/compiler/helpers.d.ts +54 -0
- package/dist/compiler/index.d.ts +16 -9
- package/dist/compiler/index.js +4450 -4316
- package/dist/compiler/prefixer.d.ts +17 -1
- package/dist/compiler/shorthands.d.ts +28 -0
- package/dist/compiler/suggestions.d.ts +43 -0
- package/dist/compiler/theme-contract.d.ts +16 -27
- package/dist/compiler/token-resolver.d.ts +69 -0
- package/dist/compiler/tokens.d.ts +33 -8
- package/dist/core/auto-detector.d.ts +34 -0
- package/dist/core/common-utils.d.ts +97 -0
- package/dist/core/compiler.d.ts +63 -23
- package/dist/core/constants.d.ts +137 -36
- package/dist/core/smart-chain.d.ts +3 -0
- package/dist/core/types.d.ts +122 -15
- package/dist/core/utils.d.ts +134 -17
- package/dist/index.d.ts +52 -8
- package/dist/index.js +7090 -5578
- package/dist/plugins/vite.d.ts +7 -5
- package/dist/plugins/vite.js +2964 -25641
- package/dist/plugins/webpack.d.ts +24 -1
- package/dist/plugins/webpack.js +209 -72
- package/dist/runtime/Chain.d.ts +32 -0
- package/dist/runtime/auto-hooks.d.ts +11 -0
- package/dist/runtime/hmr.d.ts +22 -2
- package/dist/runtime/index.d.ts +3 -2
- package/dist/runtime/index.js +3649 -301
- package/dist/runtime/injector.d.ts +39 -71
- package/dist/runtime/react.d.ts +17 -12
- package/dist/runtime/svelte.d.ts +15 -0
- package/dist/runtime/types.d.ts +126 -4
- package/dist/runtime/utils.d.ts +0 -1
- package/dist/runtime/vue.d.ts +34 -14
- package/package.json +59 -66
- package/src/cli/commands/build.ts +133 -0
- package/src/cli/commands/cache.ts +371 -0
- package/src/cli/commands/init.ts +230 -0
- package/src/cli/commands/timeline.ts +435 -0
- package/src/cli/commands/watch.ts +211 -0
- package/src/cli/index.ts +226 -0
- package/src/cli/types.ts +100 -0
- package/src/cli/utils/config-loader.ts +174 -0
- package/src/cli/utils/file-utils.ts +139 -0
- package/src/cli/utils/logger.ts +74 -0
- package/src/compiler/Chain.ts +831 -0
- package/src/compiler/animations.ts +517 -0
- package/src/compiler/atomic-optimizer.ts +786 -0
- package/src/compiler/breakpoints.ts +347 -0
- package/src/compiler/btt.ts +1147 -0
- package/src/compiler/cache-manager.ts +446 -0
- package/src/compiler/commonProps.ts +18 -0
- package/src/compiler/content-addressable-cache.ts +478 -0
- package/src/compiler/helpers.ts +407 -0
- package/src/compiler/index.ts +72 -0
- package/src/compiler/prefixer.ts +724 -0
- package/src/compiler/shorthands.ts +558 -0
- package/src/compiler/suggestions.ts +436 -0
- package/src/compiler/theme-contract.ts +197 -0
- package/src/compiler/token-resolver.ts +241 -0
- package/src/compiler/tokens.ts +612 -0
- package/src/core/auto-detector.ts +187 -0
- package/src/core/common-utils.ts +423 -0
- package/src/core/compiler.ts +835 -0
- package/src/core/constants.ts +424 -0
- package/src/core/index.ts +107 -0
- package/src/core/smart-chain.ts +163 -0
- package/src/core/types.ts +257 -0
- package/src/core/utils.ts +598 -0
- package/src/index.ts +208 -0
- package/src/plugins/vite.d.ts +316 -0
- package/src/plugins/vite.ts +424 -0
- package/src/plugins/webpack.d.ts +289 -0
- package/src/plugins/webpack.ts +416 -0
- package/src/runtime/Chain.ts +242 -0
- package/src/runtime/auto-hooks.tsx +127 -0
- package/src/runtime/auto-vue.ts +72 -0
- package/src/runtime/hmr.ts +212 -0
- package/src/runtime/index.ts +82 -0
- package/src/runtime/injector.ts +273 -0
- package/src/runtime/react.tsx +269 -0
- package/src/runtime/svelte.ts +15 -0
- package/src/runtime/types.ts +256 -0
- package/src/runtime/utils.ts +128 -0
- package/src/runtime/vite-env.d.ts +120 -0
- package/src/runtime/vue.ts +231 -0
- package/tsconfig.build.json +41 -0
- package/tsconfig.json +25 -0
- package/tsconfig.runtimes.json +18 -0
- package/dist/cli/cli.cjs +0 -7
- package/dist/cli/commands/build.d.ts.map +0 -1
- package/dist/cli/commands/compile.d.ts +0 -3
- package/dist/cli/commands/compile.d.ts.map +0 -1
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/timeline.d.ts.map +0 -1
- package/dist/cli/commands/watch.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/utils/config-loader.d.ts.map +0 -1
- package/dist/cli/utils/file-utils.d.ts.map +0 -1
- package/dist/cli/utils/logger.d.ts.map +0 -1
- package/dist/compiler/atomic-optimizer.d.ts.map +0 -1
- package/dist/compiler/btt.d.ts.map +0 -1
- package/dist/compiler/cache-manager.d.ts.map +0 -1
- package/dist/compiler/commonProps.d.ts.map +0 -1
- package/dist/compiler/index.d.ts.map +0 -1
- package/dist/compiler/prefixer.d.ts.map +0 -1
- package/dist/compiler/theme-contract.d.ts.map +0 -1
- package/dist/compiler/tokens.d.ts.map +0 -1
- package/dist/compiler/types.d.ts +0 -57
- package/dist/compiler/types.d.ts.map +0 -1
- package/dist/core/compiler.d.ts.map +0 -1
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/vite.d.ts.map +0 -1
- package/dist/plugins/webpack.d.ts.map +0 -1
- package/dist/runtime/hmr.d.ts.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/injector.d.ts.map +0 -1
- package/dist/runtime/react.d.ts.map +0 -1
- package/dist/runtime/react.js +0 -270
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/utils.d.ts.map +0 -1
- package/dist/runtime/vue.d.ts.map +0 -1
- package/dist/runtime/vue.js +0 -232
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"data":{}}
|
package/demo/index.html
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>ChainCSS Demo | Zero-Runtime CSS-in-JS</title>
|
|
7
|
+
<style>
|
|
8
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
9
|
+
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chaincss-demo",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite",
|
|
7
|
+
"build": "vite build"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"autoprefixer": "^10.5.0",
|
|
11
|
+
"browserslist": "^4.28.2",
|
|
12
|
+
"caniuse-lite": "^1.0.30001791",
|
|
13
|
+
"react": "^18.2.0",
|
|
14
|
+
"react-dom": "^18.2.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
18
|
+
"vite": "^5.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/demo/src/App.tsx
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './styles.chain';
|
|
3
|
+
|
|
4
|
+
const features = [
|
|
5
|
+
{ icon: '⚡', title: 'Zero Runtime', desc: 'Static styles compile to plain CSS. No JavaScript shipped for styling.' },
|
|
6
|
+
{ icon: '🎯', title: 'Auto Detection', desc: 'smartChain() detects static vs dynamic automatically.' },
|
|
7
|
+
{ icon: '🧩', title: '57 Macros', desc: 'flex(), center(), glass(), pill() — complex CSS as single method calls.' },
|
|
8
|
+
{ icon: '🎨', title: 'Design Tokens', desc: 'Themeable with full token resolution system.' },
|
|
9
|
+
{ icon: '🔄', title: 'Variant System', desc: 'Type-safe component variants with compound conditions.' },
|
|
10
|
+
{ icon: '📱', title: 'Responsive', desc: '20 breakpoints. Mobile-first to feature queries.' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const plans = [
|
|
14
|
+
{ name: 'Starter', price: 'Free', features: ['5 components', 'Basic macros', 'Community support'], featured: false },
|
|
15
|
+
{ name: 'Pro', price: '$29/mo', features: ['Unlimited components', 'All 57 macros', 'Priority support', 'Atomic CSS', 'Design tokens'], featured: true },
|
|
16
|
+
{ name: 'Enterprise', price: '$99/mo', features: ['Everything in Pro', 'Theme contracts', 'SSR support', 'Custom plugins', 'Dedicated support'], featured: false },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export function App() {
|
|
20
|
+
return (
|
|
21
|
+
<div style={{ background: '#0f172a', minHeight: '100vh' }}>
|
|
22
|
+
{/* NAV */}
|
|
23
|
+
<nav className={S.nav.selectors?.[0]}>
|
|
24
|
+
<div className={S.navInner.selectors?.[0]}>
|
|
25
|
+
<span className={S.navLogo.selectors?.[0]}>ChainCSS</span>
|
|
26
|
+
<div className={S.navLinks.selectors?.[0]}>
|
|
27
|
+
{['Features', 'Pricing', 'Docs', 'GitHub'].map(item => (
|
|
28
|
+
<a key={item} href="#" className={S.navLink.selectors?.[0]}>{item}</a>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</nav>
|
|
33
|
+
|
|
34
|
+
{/* HERO */}
|
|
35
|
+
<section className={S.hero.selectors?.[0]}>
|
|
36
|
+
<h1 className={S.heroTitle.selectors?.[0]}>
|
|
37
|
+
Write Styles Like JavaScript.<br />Ship Zero Runtime.
|
|
38
|
+
</h1>
|
|
39
|
+
<p className={S.heroSubtitle.selectors?.[0]}>
|
|
40
|
+
ChainCSS auto-detects static vs dynamic styles. CSS where possible, JS where needed.
|
|
41
|
+
</p>
|
|
42
|
+
<div style={{ display: 'flex', gap: 16 }}>
|
|
43
|
+
<button className={S.buttonPrimary.selectors?.[0]}>Get Started →</button>
|
|
44
|
+
<button className={S.buttonSecondary.selectors?.[0]}>View on GitHub</button>
|
|
45
|
+
</div>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
{/* FEATURES */}
|
|
49
|
+
<section className={S.section.selectors?.[0]}>
|
|
50
|
+
<div className={S.sectionHeader.selectors?.[0]}>
|
|
51
|
+
<h2 className={S.sectionTitle.selectors?.[0]}>Everything You Need</h2>
|
|
52
|
+
<p className={S.sectionDesc.selectors?.[0]}>550+ features. One JavaScript API. Zero runtime CSS.</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div className={S.featureGrid.selectors?.[0]}>
|
|
55
|
+
{features.map(f => (
|
|
56
|
+
<div key={f.title} className={S.featureCard.selectors?.[0]}>
|
|
57
|
+
<div className={S.featureIcon.selectors?.[0]}>{f.icon}</div>
|
|
58
|
+
<h3 className={S.featureTitle.selectors?.[0]}>{f.title}</h3>
|
|
59
|
+
<p className={S.featureDesc.selectors?.[0]}>{f.desc}</p>
|
|
60
|
+
</div>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
{/* PRICING */}
|
|
66
|
+
<section className={S.section.selectors?.[0]}>
|
|
67
|
+
<div className={S.sectionHeader.selectors?.[0]}>
|
|
68
|
+
<h2 className={S.sectionTitle.selectors?.[0]}>Simple Pricing</h2>
|
|
69
|
+
<p className={S.sectionDesc.selectors?.[0]}>Start free, scale as you grow.</p>
|
|
70
|
+
</div>
|
|
71
|
+
<div className={S.pricingGrid.selectors?.[0]}>
|
|
72
|
+
{plans.map(p => (
|
|
73
|
+
<div key={p.name} className={(p.featured ? S.pricingCardFeatured : S.pricingCard).selectors?.[0]}>
|
|
74
|
+
{p.featured && <span className={S.pricingBadge.selectors?.[0]}>POPULAR</span>}
|
|
75
|
+
<h3 className={S.pricingPlanName.selectors?.[0]}>{p.name}</h3>
|
|
76
|
+
<div className={S.pricingPrice.selectors?.[0]}>{p.price}</div>
|
|
77
|
+
<div style={{ flex: 1, marginBottom: 24 }}>
|
|
78
|
+
{p.features.map(f => (
|
|
79
|
+
<div key={f} className={S.pricingFeature.selectors?.[0]}>✓ {f}</div>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
<button className={(p.featured ? S.buttonPrimary : S.buttonSecondary).selectors?.[0]}>
|
|
83
|
+
Get Started
|
|
84
|
+
</button>
|
|
85
|
+
</div>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
</section>
|
|
89
|
+
|
|
90
|
+
{/* FOOTER */}
|
|
91
|
+
<footer className={S.footer.selectors?.[0]}>
|
|
92
|
+
<div className={S.footerGrid.selectors?.[0]}>
|
|
93
|
+
<div>
|
|
94
|
+
<h4 className={S.footerHeading.selectors?.[0]}>ChainCSS</h4>
|
|
95
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>About</a>
|
|
96
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Blog</a>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h4 className={S.footerHeading.selectors?.[0]}>Product</h4>
|
|
100
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Features</a>
|
|
101
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Pricing</a>
|
|
102
|
+
</div>
|
|
103
|
+
<div>
|
|
104
|
+
<h4 className={S.footerHeading.selectors?.[0]}>Resources</h4>
|
|
105
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Docs</a>
|
|
106
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Examples</a>
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
<h4 className={S.footerHeading.selectors?.[0]}>Legal</h4>
|
|
110
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Privacy</a>
|
|
111
|
+
<a href="#" className={S.footerLink.selectors?.[0]}>Terms</a>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</footer>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Lightweight barrel for demo - excludes compiler/prefixer
|
|
2
|
+
export { chain, enableDebug, setTokenContext, getTokenContext } from '../../src/compiler/Chain.js';
|
|
3
|
+
export { recipe } from '../../src/compiler/btt.js';
|
|
4
|
+
export { createTokens, DesignTokens } from '../../src/compiler/tokens.js';
|
|
5
|
+
export { smartChain, buildChain, runtimeChain } from '../../src/core/smart-chain.js';
|
|
6
|
+
export { createThemeContract, createTheme, validateTheme, Theme } from '../../src/compiler/theme-contract.js';
|
|
7
|
+
export { helpers } from '../../src/compiler/helpers.js';
|
|
8
|
+
export { animationPresets, createAnimation, getAnimationPreset } from '../../src/compiler/animations.js';
|
|
9
|
+
export { shorthandMap, macros } from '../../src/compiler/shorthands.js';
|
|
@@ -0,0 +1,300 @@
|
|
|
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');
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cacheCommand(action: string, options: any): Promise<void>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface InitOptions {
|
|
2
2
|
force?: boolean;
|
|
3
3
|
verbose?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
template?: 'full' | 'minimal';
|
|
5
|
+
typescript?: boolean;
|
|
6
|
+
framework?: 'react' | 'vue' | 'svelte' | 'solid';
|
|
7
|
+
}
|
|
8
|
+
export declare function initCommand(options: InitOptions): Promise<void>;
|
package/dist/cli/index.d.ts
CHANGED