@yummacss/nitro 0.2.2 → 0.3.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/LICENSE +19 -19
- package/README.md +29 -19
- package/dist/browser.d.mts +6 -0
- package/dist/browser.mjs +1 -0
- package/dist/{generator-nVaSRO2o.d.ts → generator-CuiEND7e.d.mts} +1 -1
- package/dist/generator-DwoOeML2.mjs +153 -0
- package/dist/{index.d.ts → index.d.mts} +1 -1
- package/dist/index.mjs +1 -0
- package/package.json +9 -8
- package/dist/browser.d.ts +0 -6
- package/dist/browser.js +0 -1
- package/dist/index.js +0 -1
- package/dist/tokenizer-DVMuV70z.js +0 -156
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
Copyright (c) 2025-present Yumma CSS Nitro maintained by Renildo Pereira.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
1
|
+
Copyright (c) 2025-present Yumma CSS Nitro maintained by Renildo Pereira.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
# [@yummacss
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[
|
|
2
|
+
|
|
3
|
+
A CLI-first CSS framework for the web with abbreviated styles.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/yummacss)
|
|
6
|
+
[](https://www.npmjs.com/package/yummacss)
|
|
7
|
+
|
|
8
|
+
## Installing
|
|
9
|
+
|
|
10
|
+
Install `yummacss` as a dev dependency and initialize configuration
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install yummacss -D
|
|
14
|
+
npx yummacss init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Build styles
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx yummacss build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
Learn more at [yummacss.com](https://yummacss.com)
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
This project is licensed under the [MIT License](LICENSE).
|
package/dist/browser.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./generator-DwoOeML2.mjs";export{t as baseStyles,n as generator,e as tokenizer};
|
|
@@ -18,4 +18,4 @@ type Config = z.infer<typeof ConfigSchema>;
|
|
|
18
18
|
//#region src/generator.d.ts
|
|
19
19
|
declare function generator(usedClasses: Set<string>, config: Config): string;
|
|
20
20
|
//#endregion
|
|
21
|
-
export {
|
|
21
|
+
export { baseStyles as a, configName as i, Config as n, ConfigSchema as r, generator as t };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import{coreUtils as e}from"@yummacss/api";const t=`*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
border: 0 solid;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
* {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
html {
|
|
14
|
+
font-family: system-ui, sans-serif;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
font-family: inherit;
|
|
20
|
+
line-height: 1.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
canvas,
|
|
24
|
+
img,
|
|
25
|
+
picture,
|
|
26
|
+
svg,
|
|
27
|
+
video {
|
|
28
|
+
display: block;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
button,
|
|
33
|
+
input,
|
|
34
|
+
optgroup,
|
|
35
|
+
select,
|
|
36
|
+
textarea {
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
padding: .5rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
button:not([class]),
|
|
43
|
+
input:not([class]),
|
|
44
|
+
optgroup:not([class]),
|
|
45
|
+
select:not([class]),
|
|
46
|
+
textarea:not([class]) {
|
|
47
|
+
border: 1px solid #bfc2c7;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
a,
|
|
51
|
+
button,
|
|
52
|
+
input,
|
|
53
|
+
select,
|
|
54
|
+
summary,
|
|
55
|
+
textarea {
|
|
56
|
+
&:focus {
|
|
57
|
+
outline: 2px solid transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
textarea:not([rows]) {
|
|
62
|
+
min-height: 10em;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
button {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
button:disabled,
|
|
70
|
+
input:disabled,
|
|
71
|
+
select:disabled,
|
|
72
|
+
textarea:disabled {
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
opacity: .5;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
h1,
|
|
78
|
+
h2,
|
|
79
|
+
h3,
|
|
80
|
+
h4,
|
|
81
|
+
h5,
|
|
82
|
+
h6,
|
|
83
|
+
p {
|
|
84
|
+
overflow-wrap: break-word;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
h1,
|
|
88
|
+
h2,
|
|
89
|
+
h3,
|
|
90
|
+
h4,
|
|
91
|
+
h5,
|
|
92
|
+
h6 {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
text-wrap: balance;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
p {
|
|
99
|
+
text-wrap: pretty;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
b,
|
|
103
|
+
strong {
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
small {
|
|
108
|
+
font-size: 80%;
|
|
109
|
+
line-height: 1.4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
pre,
|
|
113
|
+
code,
|
|
114
|
+
kbd,
|
|
115
|
+
samp {
|
|
116
|
+
font-family: monospace;
|
|
117
|
+
font-size: 1em;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
a {
|
|
121
|
+
color: inherit;
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
ol,
|
|
126
|
+
ul {
|
|
127
|
+
list-style: none;
|
|
128
|
+
padding: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
th {
|
|
132
|
+
font-size: 1rem;
|
|
133
|
+
font-weight: 600;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
hr {
|
|
137
|
+
border-top: 1px solid #bfc2c7;
|
|
138
|
+
height: 0;
|
|
139
|
+
margin: 1em 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
details {
|
|
143
|
+
display: block;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
summary {
|
|
147
|
+
display: list-item;
|
|
148
|
+
}`;function n(e){let t=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g],r=[/`([^`]+)`/g,/"([^"]+)"/g,/'([^']+)'/g],i=[/cva\s*\(\s*["'`]([^"'`]+)["'`]/g,/:\s*["'`]([^"'`]+)["'`]/g],a=[/\bcn\s*\(\s*["'`]([^"'`]+)["'`]/g,/\bcn\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],o=[/clsx\s*\(\s*["'`]([^"'`]+)["'`]/g,/classnames\s*\(\s*["'`]([^"'`]+)["'`]/g,/clsx\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g,/classnames\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],s=[...n,...r,...i,...a,...o];for(let n of s){let r;for(r=n.exec(e);r!==null;){let i=r[1];i&&i.split(/\s+/).filter(e=>e&&/^[a-z]/.test(e)&&e.includes(`-`)).forEach(e=>{t.add(e)}),r=n.exec(e)}}return Array.from(t)}function r(e,n){let r=[];n.buildOptions.reset&&r.push(t);let a=i(e);return a&&r.push(a),r.join(`
|
|
149
|
+
|
|
150
|
+
`)}function i(t){let n=e(),r=[],i=new Map,a=new Set,o=Array.from(t).sort();for(let e of o){if(a.has(e))continue;let t=s(e,n);if(t){if(t.mediaQuery){let e=i.get(t.mediaQuery)||[];e.push(t.rule),i.set(t.mediaQuery,e)}else r.push(t.rule);a.add(e)}}let c=Array.from(i.entries()).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of c)r.push(`${e} {\n${t.join(`
|
|
151
|
+
`)}\n}`);return r.join(`
|
|
152
|
+
`)}function a(e,t){let{properties:n,variants:r,prefix:i,values:a}=t,s=e,c,l=``,u=``,d=!0;for(;d;){if(d=!1,r?.mediaQueries){for(let e of r.mediaQueries)if(s.startsWith(`${e.prefix}:`)){c=e.value,s=s.slice(e.prefix.length+1),d=!0;break}}if(!d&&r?.pseudoClasses){for(let e of r.pseudoClasses)if(s.startsWith(`${e.prefix}:`)){l+=e.value,s=s.slice(e.prefix.length+1),d=!0;break}}}if(r?.opacity){for(let e of r.opacity)if(s.endsWith(`/${e.prefix}`)){u=e.value,s=s.slice(0,-(e.prefix.length+1));break}}if(!s.startsWith(`${i}-`)&&s!==i)return null;let f=s===i?``:s.slice(i.length+1),p=a[f===``?`base`:f]||a[f];if(!p)return null;let m=u&&p.startsWith(`#`)&&p.length===7?`${p}${u}`:p,h=n.map(e=>`${e}: ${m};`).join(`
|
|
153
|
+
`);return{rule:`.${o(e)}${l} {\n ${h}\n}`,mediaQuery:c}}function o(e){return e.replace(/:/g,`\\:`).replace(/\//g,`\\/`)}function s(e,t){for(let[n,r]of Object.entries(t)){let t=a(e,r);if(t)return t}return null}export{n,t as r,r as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as baseStyles, i as configName, n as Config, r as ConfigSchema, t as generator } from "./generator-CuiEND7e.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/extractor.d.ts
|
|
4
4
|
declare function extractor(patterns: string[]): Promise<Set<string>>;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./generator-DwoOeML2.mjs";import{z as r}from"zod";import{readFileSync as i}from"node:fs";import{globby as a}from"globby";const o=`yumma.config.mjs`,s=r.object({source:r.array(r.string()).default([``]),output:r.string().default(``),buildOptions:r.object({reset:r.boolean().default(!0),minify:r.boolean().default(!1)}).default({reset:!0,minify:!1})});async function c(t){let n=await a(t),r=new Set;for(let t of n)try{e(i(t,`utf-8`)).forEach(e=>{r.add(e)})}catch{}return r}export{s as ConfigSchema,t as baseStyles,o as configName,c as extractor,n as generator};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yummacss/nitro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The engine behind Yumma CSS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css-framework",
|
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@yummacss/api": "^1.7.2",
|
|
27
|
-
"globby": "^
|
|
28
|
-
"zod": "^4.
|
|
27
|
+
"globby": "^16.1.0",
|
|
28
|
+
"zod": "^4.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@biomejs/biome": "2.
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"tsdown": "^0.
|
|
34
|
-
"typescript": "^5.9.
|
|
31
|
+
"@biomejs/biome": "2.3.10",
|
|
32
|
+
"@types/node": "^25.0.3",
|
|
33
|
+
"tsdown": "^0.18.3",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
37
|
+
"access": "public",
|
|
38
|
+
"provenance": false
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "tsdown",
|
package/dist/browser.d.ts
DELETED
package/dist/browser.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{baseStyles as e,generator as t,tokenizer as n}from"./tokenizer-DVMuV70z.js";export{e as baseStyles,t as generator,n as tokenizer};
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{baseStyles as e,generator as t,tokenizer as n}from"./tokenizer-DVMuV70z.js";import{z as r}from"zod";import{readFileSync as i}from"node:fs";import{globby as a}from"globby";const o=`yumma.config.mjs`,s=r.object({source:r.array(r.string()).default([``]),output:r.string().default(``),buildOptions:r.object({reset:r.boolean().default(!0),minify:r.boolean().default(!1)}).default({reset:!0,minify:!1})});async function c(e){let t=await a(e),r=new Set;for(let e of t)try{n(i(e,`utf-8`)).forEach(e=>{r.add(e)})}catch{}return r}export{s as ConfigSchema,e as baseStyles,o as configName,c as extractor,t as generator};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import{coreUtils as e}from"@yummacss/api";const t=`*,
|
|
2
|
-
*::before,
|
|
3
|
-
*::after {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
border: 0 solid;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
* {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
html {
|
|
14
|
-
font-family: system-ui, sans-serif;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
body {
|
|
18
|
-
-webkit-font-smoothing: antialiased;
|
|
19
|
-
font-family: inherit;
|
|
20
|
-
line-height: 1.5;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
canvas,
|
|
24
|
-
img,
|
|
25
|
-
picture,
|
|
26
|
-
svg,
|
|
27
|
-
video {
|
|
28
|
-
display: block;
|
|
29
|
-
max-width: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
button,
|
|
33
|
-
input,
|
|
34
|
-
optgroup,
|
|
35
|
-
select,
|
|
36
|
-
textarea {
|
|
37
|
-
background-color: transparent;
|
|
38
|
-
font-family: inherit;
|
|
39
|
-
padding: .5rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
button:not([class]),
|
|
43
|
-
input:not([class]),
|
|
44
|
-
optgroup:not([class]),
|
|
45
|
-
select:not([class]),
|
|
46
|
-
textarea:not([class]) {
|
|
47
|
-
border: 1px solid #bfc2c7;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
a,
|
|
51
|
-
button,
|
|
52
|
-
input,
|
|
53
|
-
select,
|
|
54
|
-
summary,
|
|
55
|
-
textarea {
|
|
56
|
-
&:focus {
|
|
57
|
-
outline: 2px solid transparent;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
textarea:not([rows]) {
|
|
62
|
-
min-height: 10em;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
button {
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
button:disabled,
|
|
70
|
-
input:disabled,
|
|
71
|
-
select:disabled,
|
|
72
|
-
textarea:disabled {
|
|
73
|
-
cursor: not-allowed;
|
|
74
|
-
opacity: .5;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
h1,
|
|
78
|
-
h2,
|
|
79
|
-
h3,
|
|
80
|
-
h4,
|
|
81
|
-
h5,
|
|
82
|
-
h6,
|
|
83
|
-
p {
|
|
84
|
-
overflow-wrap: break-word;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
h1,
|
|
88
|
-
h2,
|
|
89
|
-
h3,
|
|
90
|
-
h4,
|
|
91
|
-
h5,
|
|
92
|
-
h6 {
|
|
93
|
-
font-size: 1rem;
|
|
94
|
-
font-weight: 600;
|
|
95
|
-
text-wrap: balance;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
p {
|
|
99
|
-
text-wrap: pretty;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
b,
|
|
103
|
-
strong {
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
small {
|
|
108
|
-
font-size: 80%;
|
|
109
|
-
line-height: 1.4;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
pre,
|
|
113
|
-
code,
|
|
114
|
-
kbd,
|
|
115
|
-
samp {
|
|
116
|
-
font-family: monospace;
|
|
117
|
-
font-size: 1em;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
a {
|
|
121
|
-
color: inherit;
|
|
122
|
-
text-decoration: none;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
ol,
|
|
126
|
-
ul {
|
|
127
|
-
list-style: none;
|
|
128
|
-
padding: 0;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
th {
|
|
132
|
-
font-size: 1rem;
|
|
133
|
-
font-weight: 600;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
hr {
|
|
137
|
-
border-top: 1px solid #bfc2c7;
|
|
138
|
-
height: 0;
|
|
139
|
-
margin: 1em 0;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
details {
|
|
143
|
-
display: block;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
summary {
|
|
147
|
-
display: list-item;
|
|
148
|
-
}`;function n(e,n){let i=[];n.buildOptions.reset&&i.push(t);let a=r(e);return a&&i.push(a),i.join(`
|
|
149
|
-
|
|
150
|
-
`)}function r(t){let n=e(),r=[],i=new Map,a=new Set,o=Array.from(t).sort();for(let e of o){if(a.has(e))continue;let t=s(e,n);if(t){if(t.mediaQuery){let e=i.get(t.mediaQuery)||[];e.push(t.rule),i.set(t.mediaQuery,e)}else r.push(t.rule);a.add(e)}}let c=Array.from(i.entries()).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of c)r.push(`${e} {\n${t.join(`
|
|
151
|
-
`)}\n}`);return r.join(`
|
|
152
|
-
`)}function i(e,t){let{properties:n,variants:r}=t;if(r?.mediaQueries){for(let i of r.mediaQueries)if(e.startsWith(`${i.prefix}:`)){let r=a(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
|
|
153
|
-
`);return{rule:`.${o(e)} {\n ${t}\n }`,mediaQuery:i.value}}}}if(r?.pseudoClasses){for(let i of r.pseudoClasses)if(e.startsWith(`${i.prefix}:`)){let r=a(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
|
|
154
|
-
`);return{rule:`.${o(e)}${i.value} {\n${t}\n}`}}}}if(r?.opacity){for(let i of r.opacity)if(e.endsWith(`/${i.prefix}`)){let r=a(e.slice(0,-(i.prefix.length+1)),t);if(r){let t=r.propertyValue.startsWith(`#`)&&r.propertyValue.length===7?`${r.propertyValue}${i.value}`:r.propertyValue,a=n.map(e=>`${e}: ${t};`).join(`
|
|
155
|
-
`);return{rule:`.${o(e)} {\n${a}\n}`}}}}let i=a(e,t);if(i){let t=n.map(e=>`${e}: ${i.propertyValue};`).join(`
|
|
156
|
-
`);return{rule:`.${o(e)} {\n${t}\n}`}}return null}function a(e,t){let{prefix:n,values:r}=t;if(!e.startsWith(`${n}-`))return null;let i=r[e.slice(n.length+1)];return i?{propertyValue:i}:null}function o(e){return e.replace(/:/g,`\\:`).replace(/\//g,`\\/`)}function s(e,t){for(let[n,r]of Object.entries(t)){let t=i(e,r);if(t)return t}return null}function c(e){let t=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g],r=[/`[^`]*\b([a-z]+-[a-z0-9-]+)\b[^`]*`/g,/"[^"]*\b([a-z]+-[a-z0-9-]+)\b[^"]*"/g,/'[^']*\b([a-z]+-[a-z0-9-]+)\b[^']*'/g],i=[/cva\s*\(\s*["'`]([^"'`]+)["'`]/g,/:\s*["'`]([^"'`]*\b[a-z]+-[a-z0-9-]+[^"'`]*)["'`]/g],a=[/\bcn\s*\(\s*["'`]([^"'`]+)["'`]/g,/\bcn\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],o=[/clsx\s*\(\s*["'`]([^"'`]+)["'`]/g,/classnames\s*\(\s*["'`]([^"'`]+)["'`]/g,/clsx\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g,/classnames\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],s=[...n,...r,...i,...a,...o];for(let n of s){let r;for(r=n.exec(e);r!==null;){let i=r[1];i&&i.split(/\s+/).filter(e=>e&&/^[a-z]/.test(e)&&e.includes(`-`)).forEach(e=>{t.add(e)}),r=n.exec(e)}}return Array.from(t)}export{t as baseStyles,n as generator,c as tokenizer};
|