@unocss/preset-uno 0.13.1 → 0.14.3

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.
Files changed (40) hide show
  1. package/dist/{chunk-P5HELYQA.mjs → chunks/colors.cjs} +4 -5
  2. package/dist/{chunk-7O4GGKN3.js → chunks/colors.mjs} +2 -5
  3. package/dist/{chunk-GBKIE2NK.js → chunks/default.cjs} +567 -591
  4. package/dist/{chunk-RDUXYWRV.mjs → chunks/default.mjs} +404 -541
  5. package/dist/{chunk-BOWXQI3B.js → chunks/default2.cjs} +41 -48
  6. package/dist/{chunk-BLAKJWHG.mjs → chunks/default2.mjs} +21 -48
  7. package/dist/chunks/default3.cjs +128 -0
  8. package/dist/chunks/default3.mjs +119 -0
  9. package/dist/{chunk-O7YRGPXQ.mjs → chunks/index.cjs} +38 -59
  10. package/dist/{chunk-LPZDYB4J.js → chunks/index.mjs} +23 -60
  11. package/dist/chunks/pseudo.cjs +106 -0
  12. package/dist/chunks/pseudo.mjs +101 -0
  13. package/dist/chunks/variants.cjs +14 -0
  14. package/dist/chunks/variants.mjs +12 -0
  15. package/dist/colors.cjs +9 -0
  16. package/dist/colors.mjs +1 -7
  17. package/dist/index.cjs +31 -0
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.mjs +12 -26
  20. package/dist/rules.cjs +123 -0
  21. package/dist/rules.d.ts +3 -1
  22. package/dist/rules.mjs +4 -226
  23. package/dist/theme.cjs +29 -0
  24. package/dist/theme.mjs +2 -47
  25. package/dist/utils.cjs +25 -0
  26. package/dist/utils.mjs +2 -37
  27. package/dist/variants.cjs +23 -0
  28. package/dist/variants.d.ts +2 -1
  29. package/dist/variants.mjs +4 -28
  30. package/package.json +11 -11
  31. package/dist/chunk-5SH5BFJ4.mjs +0 -11
  32. package/dist/chunk-64RIF3V4.js +0 -232
  33. package/dist/chunk-IFOGL3S7.mjs +0 -232
  34. package/dist/chunk-Y6EUTGDC.js +0 -11
  35. package/dist/colors.js +0 -7
  36. package/dist/index.js +0 -39
  37. package/dist/rules.js +0 -226
  38. package/dist/theme.js +0 -47
  39. package/dist/utils.js +0 -37
  40. package/dist/variants.js +0 -28
@@ -1,9 +1,8 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ 'use strict';
2
2
 
3
- var _chunk7O4GGKN3js = require('./chunk-7O4GGKN3.js');
3
+ const colors = require('./colors.cjs');
4
4
 
5
- // src/theme/font.ts
6
- var fontFamily = {
5
+ const fontFamily = {
7
6
  sans: [
8
7
  "ui-sans-serif",
9
8
  "system-ui",
@@ -39,7 +38,7 @@ var fontFamily = {
39
38
  "monospace"
40
39
  ].join(",")
41
40
  };
42
- var fontSize = {
41
+ const fontSize = {
43
42
  "xs": ["0.75rem", "1rem"],
44
43
  "sm": ["0.875rem", "1.25rem"],
45
44
  "base": ["1rem", "1.5rem"],
@@ -54,7 +53,7 @@ var fontSize = {
54
53
  "8xl": ["6rem", "1"],
55
54
  "9xl": ["8rem", "1"]
56
55
  };
57
- var textIndent = {
56
+ const textIndent = {
58
57
  "DEFAULT": "1.5rem",
59
58
  "xs": "0.5rem",
60
59
  "sm": "1rem",
@@ -64,14 +63,14 @@ var textIndent = {
64
63
  "2xl": "3rem",
65
64
  "3xl": "4rem"
66
65
  };
67
- var textStrokeWidth = {
66
+ const textStrokeWidth = {
68
67
  DEFAULT: "1.5rem",
69
68
  none: "0",
70
69
  sm: "thin",
71
70
  md: "medium",
72
71
  lg: "thick"
73
72
  };
74
- var textShadow = {
73
+ const textShadow = {
75
74
  DEFAULT: "0px 0px 1px rgb(0 0 0/20%), 0px 0px 1px rgb(1 0 5/10%)",
76
75
  sm: "1px 1px 3px rgb(36 37 47 / 25%)",
77
76
  md: "0px 1px 2px rgb(30 29 39 / 19%), 1px 2px 4px rgb(54 64 147 / 18%)",
@@ -79,7 +78,7 @@ var textShadow = {
79
78
  xl: "1px 1px 3px rgb(0 0 0 / 29%), 2px 4px 7px rgb(73 64 125 / 35%)",
80
79
  none: "none"
81
80
  };
82
- var lineHeight = {
81
+ const lineHeight = {
83
82
  none: "1",
84
83
  tight: "1.25",
85
84
  snug: "1.375",
@@ -87,7 +86,7 @@ var lineHeight = {
87
86
  relaxed: "1.625",
88
87
  loose: "2"
89
88
  };
90
- var letterSpacing = {
89
+ const letterSpacing = {
91
90
  tighter: "-0.05em",
92
91
  tight: "-0.025em",
93
92
  normal: "0em",
@@ -95,17 +94,16 @@ var letterSpacing = {
95
94
  wider: "0.05em",
96
95
  widest: "0.1em"
97
96
  };
98
- var wordSpacing = letterSpacing;
97
+ const wordSpacing = letterSpacing;
99
98
 
100
- // src/theme/misc.ts
101
- var breakpoints = {
99
+ const breakpoints = {
102
100
  "sm": "640px",
103
101
  "md": "768px",
104
102
  "lg": "1024px",
105
103
  "xl": "1280px",
106
104
  "2xl": "1536px"
107
105
  };
108
- var borderRadius = {
106
+ const borderRadius = {
109
107
  "DEFAULT": "0.25rem",
110
108
  "none": "0px",
111
109
  "sm": "0.125rem",
@@ -116,7 +114,7 @@ var borderRadius = {
116
114
  "3xl": "1.5rem",
117
115
  "full": "9999px"
118
116
  };
119
- var boxShadow = {
117
+ const boxShadow = {
120
118
  "DEFAULT": "0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
121
119
  "sm": "0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
122
120
  "md": "0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
@@ -127,8 +125,7 @@ var boxShadow = {
127
125
  "none": "none"
128
126
  };
129
127
 
130
- // src/theme/filters.ts
131
- var blur = {
128
+ const blur = {
132
129
  "DEFAULT": "8px",
133
130
  "0": "0",
134
131
  "sm": "4px",
@@ -138,7 +135,7 @@ var blur = {
138
135
  "2xl": "40px",
139
136
  "3xl": "64px"
140
137
  };
141
- var dropShadow = {
138
+ const dropShadow = {
142
139
  "DEFAULT": ["0 1px 2px rgba(0, 0, 0, 0.1)", "0 1px 1px rgba(0, 0, 0, 0.06)"],
143
140
  "sm": "0 1px 1px rgba(0,0,0,0.05)",
144
141
  "md": ["0 4px 3px rgba(0, 0, 0, 0.07)", "0 2px 2px rgba(0, 0, 0, 0.06)"],
@@ -148,8 +145,7 @@ var dropShadow = {
148
145
  "none": "0 0 #0000"
149
146
  };
150
147
 
151
- // src/theme/size.ts
152
- var baseSize = {
148
+ const baseSize = {
153
149
  "xs": "20rem",
154
150
  "sm": "24rem",
155
151
  "md": "28rem",
@@ -165,36 +161,35 @@ var baseSize = {
165
161
  "max": "max-content",
166
162
  "prose": "65ch"
167
163
  };
168
- var width = {
164
+ const width = {
169
165
  auto: "auto",
170
166
  ...baseSize,
171
167
  screen: "100vw"
172
168
  };
173
- var maxWidth = {
169
+ const maxWidth = {
174
170
  none: "none",
175
171
  ...baseSize,
176
172
  screen: "100vw"
177
173
  };
178
- var height = {
174
+ const height = {
179
175
  auto: "auto",
180
176
  ...baseSize,
181
177
  screen: "100vh"
182
178
  };
183
- var maxHeight = {
179
+ const maxHeight = {
184
180
  none: "none",
185
181
  ...baseSize,
186
182
  screen: "100vh"
187
183
  };
188
184
 
189
- // src/theme/default.ts
190
- var theme = {
185
+ const theme = {
191
186
  width,
192
187
  height,
193
188
  maxWidth,
194
189
  maxHeight,
195
190
  minWidth: maxWidth,
196
191
  minHeight: maxHeight,
197
- colors: _chunk7O4GGKN3js.colors,
192
+ colors: colors.colors,
198
193
  fontFamily,
199
194
  fontSize,
200
195
  breakpoints,
@@ -210,24 +205,22 @@ var theme = {
210
205
  dropShadow
211
206
  };
212
207
 
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
- exports.fontFamily = fontFamily; exports.fontSize = fontSize; exports.textIndent = textIndent; exports.textStrokeWidth = textStrokeWidth; exports.textShadow = textShadow; exports.lineHeight = lineHeight; exports.letterSpacing = letterSpacing; exports.wordSpacing = wordSpacing; exports.breakpoints = breakpoints; exports.borderRadius = borderRadius; exports.boxShadow = boxShadow; exports.blur = blur; exports.dropShadow = dropShadow; exports.baseSize = baseSize; exports.width = width; exports.maxWidth = maxWidth; exports.height = height; exports.maxHeight = maxHeight; exports.theme = theme;
208
+ exports.baseSize = baseSize;
209
+ exports.blur = blur;
210
+ exports.borderRadius = borderRadius;
211
+ exports.boxShadow = boxShadow;
212
+ exports.breakpoints = breakpoints;
213
+ exports.dropShadow = dropShadow;
214
+ exports.fontFamily = fontFamily;
215
+ exports.fontSize = fontSize;
216
+ exports.height = height;
217
+ exports.letterSpacing = letterSpacing;
218
+ exports.lineHeight = lineHeight;
219
+ exports.maxHeight = maxHeight;
220
+ exports.maxWidth = maxWidth;
221
+ exports.textIndent = textIndent;
222
+ exports.textShadow = textShadow;
223
+ exports.textStrokeWidth = textStrokeWidth;
224
+ exports.theme = theme;
225
+ exports.width = width;
226
+ exports.wordSpacing = wordSpacing;
@@ -1,9 +1,6 @@
1
- import {
2
- colors
3
- } from "./chunk-P5HELYQA.mjs";
1
+ import { c as colors } from './colors.mjs';
4
2
 
5
- // src/theme/font.ts
6
- var fontFamily = {
3
+ const fontFamily = {
7
4
  sans: [
8
5
  "ui-sans-serif",
9
6
  "system-ui",
@@ -39,7 +36,7 @@ var fontFamily = {
39
36
  "monospace"
40
37
  ].join(",")
41
38
  };
42
- var fontSize = {
39
+ const fontSize = {
43
40
  "xs": ["0.75rem", "1rem"],
44
41
  "sm": ["0.875rem", "1.25rem"],
45
42
  "base": ["1rem", "1.5rem"],
@@ -54,7 +51,7 @@ var fontSize = {
54
51
  "8xl": ["6rem", "1"],
55
52
  "9xl": ["8rem", "1"]
56
53
  };
57
- var textIndent = {
54
+ const textIndent = {
58
55
  "DEFAULT": "1.5rem",
59
56
  "xs": "0.5rem",
60
57
  "sm": "1rem",
@@ -64,14 +61,14 @@ var textIndent = {
64
61
  "2xl": "3rem",
65
62
  "3xl": "4rem"
66
63
  };
67
- var textStrokeWidth = {
64
+ const textStrokeWidth = {
68
65
  DEFAULT: "1.5rem",
69
66
  none: "0",
70
67
  sm: "thin",
71
68
  md: "medium",
72
69
  lg: "thick"
73
70
  };
74
- var textShadow = {
71
+ const textShadow = {
75
72
  DEFAULT: "0px 0px 1px rgb(0 0 0/20%), 0px 0px 1px rgb(1 0 5/10%)",
76
73
  sm: "1px 1px 3px rgb(36 37 47 / 25%)",
77
74
  md: "0px 1px 2px rgb(30 29 39 / 19%), 1px 2px 4px rgb(54 64 147 / 18%)",
@@ -79,7 +76,7 @@ var textShadow = {
79
76
  xl: "1px 1px 3px rgb(0 0 0 / 29%), 2px 4px 7px rgb(73 64 125 / 35%)",
80
77
  none: "none"
81
78
  };
82
- var lineHeight = {
79
+ const lineHeight = {
83
80
  none: "1",
84
81
  tight: "1.25",
85
82
  snug: "1.375",
@@ -87,7 +84,7 @@ var lineHeight = {
87
84
  relaxed: "1.625",
88
85
  loose: "2"
89
86
  };
90
- var letterSpacing = {
87
+ const letterSpacing = {
91
88
  tighter: "-0.05em",
92
89
  tight: "-0.025em",
93
90
  normal: "0em",
@@ -95,17 +92,16 @@ var letterSpacing = {
95
92
  wider: "0.05em",
96
93
  widest: "0.1em"
97
94
  };
98
- var wordSpacing = letterSpacing;
95
+ const wordSpacing = letterSpacing;
99
96
 
100
- // src/theme/misc.ts
101
- var breakpoints = {
97
+ const breakpoints = {
102
98
  "sm": "640px",
103
99
  "md": "768px",
104
100
  "lg": "1024px",
105
101
  "xl": "1280px",
106
102
  "2xl": "1536px"
107
103
  };
108
- var borderRadius = {
104
+ const borderRadius = {
109
105
  "DEFAULT": "0.25rem",
110
106
  "none": "0px",
111
107
  "sm": "0.125rem",
@@ -116,7 +112,7 @@ var borderRadius = {
116
112
  "3xl": "1.5rem",
117
113
  "full": "9999px"
118
114
  };
119
- var boxShadow = {
115
+ const boxShadow = {
120
116
  "DEFAULT": "0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
121
117
  "sm": "0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
122
118
  "md": "0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
@@ -127,8 +123,7 @@ var boxShadow = {
127
123
  "none": "none"
128
124
  };
129
125
 
130
- // src/theme/filters.ts
131
- var blur = {
126
+ const blur = {
132
127
  "DEFAULT": "8px",
133
128
  "0": "0",
134
129
  "sm": "4px",
@@ -138,7 +133,7 @@ var blur = {
138
133
  "2xl": "40px",
139
134
  "3xl": "64px"
140
135
  };
141
- var dropShadow = {
136
+ const dropShadow = {
142
137
  "DEFAULT": ["0 1px 2px rgba(0, 0, 0, 0.1)", "0 1px 1px rgba(0, 0, 0, 0.06)"],
143
138
  "sm": "0 1px 1px rgba(0,0,0,0.05)",
144
139
  "md": ["0 4px 3px rgba(0, 0, 0, 0.07)", "0 2px 2px rgba(0, 0, 0, 0.06)"],
@@ -148,8 +143,7 @@ var dropShadow = {
148
143
  "none": "0 0 #0000"
149
144
  };
150
145
 
151
- // src/theme/size.ts
152
- var baseSize = {
146
+ const baseSize = {
153
147
  "xs": "20rem",
154
148
  "sm": "24rem",
155
149
  "md": "28rem",
@@ -165,29 +159,28 @@ var baseSize = {
165
159
  "max": "max-content",
166
160
  "prose": "65ch"
167
161
  };
168
- var width = {
162
+ const width = {
169
163
  auto: "auto",
170
164
  ...baseSize,
171
165
  screen: "100vw"
172
166
  };
173
- var maxWidth = {
167
+ const maxWidth = {
174
168
  none: "none",
175
169
  ...baseSize,
176
170
  screen: "100vw"
177
171
  };
178
- var height = {
172
+ const height = {
179
173
  auto: "auto",
180
174
  ...baseSize,
181
175
  screen: "100vh"
182
176
  };
183
- var maxHeight = {
177
+ const maxHeight = {
184
178
  none: "none",
185
179
  ...baseSize,
186
180
  screen: "100vh"
187
181
  };
188
182
 
189
- // src/theme/default.ts
190
- var theme = {
183
+ const theme = {
191
184
  width,
192
185
  height,
193
186
  maxWidth,
@@ -210,24 +203,4 @@ var theme = {
210
203
  dropShadow
211
204
  };
212
205
 
213
- export {
214
- fontFamily,
215
- fontSize,
216
- textIndent,
217
- textStrokeWidth,
218
- textShadow,
219
- lineHeight,
220
- letterSpacing,
221
- wordSpacing,
222
- breakpoints,
223
- borderRadius,
224
- boxShadow,
225
- blur,
226
- dropShadow,
227
- baseSize,
228
- width,
229
- maxWidth,
230
- height,
231
- maxHeight,
232
- theme
233
- };
206
+ export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l, baseSize as m, width as n, maxWidth as o, height as p, maxHeight as q, theme as t, wordSpacing as w };
@@ -0,0 +1,128 @@
1
+ 'use strict';
2
+
3
+ const variants$1 = require('./variants.cjs');
4
+ const pseudo = require('./pseudo.cjs');
5
+
6
+ const regexCache = {};
7
+ const variantBreakpoints = (matcher, _, theme) => {
8
+ const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
9
+ for (const [point, size, idx] of variantEntries) {
10
+ if (!regexCache[point])
11
+ regexCache[point] = new RegExp(`^((?:[a|l]t-)?${point}[:-])`);
12
+ const match = matcher.match(regexCache[point]);
13
+ if (!match)
14
+ continue;
15
+ const [, pre] = match;
16
+ let direction = "min";
17
+ let order = parseInt(size);
18
+ if (pre.startsWith("lt-")) {
19
+ direction = "max";
20
+ order = -order;
21
+ }
22
+ const m = matcher.slice(pre.length);
23
+ if (m === "container")
24
+ continue;
25
+ if (pre.startsWith("at-") && idx < variantEntries.length - 1) {
26
+ return {
27
+ matcher: m,
28
+ parent: [`@media (min-width: ${size}) and (max-width: ${variantEntries[idx + 1][1]})`, order]
29
+ };
30
+ }
31
+ return {
32
+ matcher: m,
33
+ parent: [`@media (${direction}-width: ${size})`, order]
34
+ };
35
+ }
36
+ };
37
+
38
+ const variantChildren = [
39
+ variants$1.variantMatcher("children", (input) => `${input} > *`),
40
+ variants$1.variantMatcher("all", (input) => `${input} *`),
41
+ variants$1.variantMatcher("next", (input) => `${input}+*`)
42
+ ];
43
+
44
+ const variantColorsClass = [
45
+ variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`),
46
+ variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)
47
+ ];
48
+ const variantColorsMedia = [
49
+ (v) => {
50
+ const dark = variants$1.variantMatcher("dark")(v);
51
+ if (dark) {
52
+ return {
53
+ ...dark,
54
+ parent: "@media (prefers-color-scheme: dark)"
55
+ };
56
+ }
57
+ const light = variants$1.variantMatcher("light")(v);
58
+ if (light) {
59
+ return {
60
+ ...light,
61
+ parent: "@media (prefers-color-scheme: light)"
62
+ };
63
+ }
64
+ }
65
+ ];
66
+
67
+ const variantImportant = {
68
+ match(matcher) {
69
+ if (matcher.startsWith("!")) {
70
+ return {
71
+ matcher: matcher.slice(1),
72
+ body: (body) => {
73
+ body.forEach((v) => {
74
+ if (v[1])
75
+ v[1] += " !important";
76
+ });
77
+ return body;
78
+ }
79
+ };
80
+ }
81
+ }
82
+ };
83
+ const variantNegative = {
84
+ match(matcher) {
85
+ if (matcher.startsWith("-")) {
86
+ return {
87
+ matcher: matcher.slice(1),
88
+ body: (body) => {
89
+ body.forEach((v) => {
90
+ if (v[0].startsWith("--un-scale") || v[1]?.toString() === "0")
91
+ return;
92
+ v[1] = v[1]?.toString().replace(/[0-9.]+(?:[a-z]+|%)?/, (i) => `-${i}`);
93
+ });
94
+ return body;
95
+ }
96
+ };
97
+ }
98
+ }
99
+ };
100
+ const variantSpace = (matcher) => {
101
+ if (/^space-?([xy])-?(-?.+)$/.test(matcher) || /^divide-/.test(matcher)) {
102
+ return {
103
+ matcher,
104
+ selector: (input) => {
105
+ return `${input}>:not([hidden])~:not([hidden])`;
106
+ }
107
+ };
108
+ }
109
+ };
110
+
111
+ const variants = [
112
+ variantSpace,
113
+ variantNegative,
114
+ variantImportant,
115
+ variantBreakpoints,
116
+ ...variantChildren,
117
+ pseudo.variantPseudoClasses,
118
+ pseudo.variantPseudoElements
119
+ ];
120
+
121
+ exports.variantBreakpoints = variantBreakpoints;
122
+ exports.variantChildren = variantChildren;
123
+ exports.variantColorsClass = variantColorsClass;
124
+ exports.variantColorsMedia = variantColorsMedia;
125
+ exports.variantImportant = variantImportant;
126
+ exports.variantNegative = variantNegative;
127
+ exports.variantSpace = variantSpace;
128
+ exports.variants = variants;
@@ -0,0 +1,119 @@
1
+ import { v as variantMatcher } from './variants.mjs';
2
+ import { v as variantPseudoClasses, a as variantPseudoElements } from './pseudo.mjs';
3
+
4
+ const regexCache = {};
5
+ const variantBreakpoints = (matcher, _, theme) => {
6
+ const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
7
+ for (const [point, size, idx] of variantEntries) {
8
+ if (!regexCache[point])
9
+ regexCache[point] = new RegExp(`^((?:[a|l]t-)?${point}[:-])`);
10
+ const match = matcher.match(regexCache[point]);
11
+ if (!match)
12
+ continue;
13
+ const [, pre] = match;
14
+ let direction = "min";
15
+ let order = parseInt(size);
16
+ if (pre.startsWith("lt-")) {
17
+ direction = "max";
18
+ order = -order;
19
+ }
20
+ const m = matcher.slice(pre.length);
21
+ if (m === "container")
22
+ continue;
23
+ if (pre.startsWith("at-") && idx < variantEntries.length - 1) {
24
+ return {
25
+ matcher: m,
26
+ parent: [`@media (min-width: ${size}) and (max-width: ${variantEntries[idx + 1][1]})`, order]
27
+ };
28
+ }
29
+ return {
30
+ matcher: m,
31
+ parent: [`@media (${direction}-width: ${size})`, order]
32
+ };
33
+ }
34
+ };
35
+
36
+ const variantChildren = [
37
+ variantMatcher("children", (input) => `${input} > *`),
38
+ variantMatcher("all", (input) => `${input} *`),
39
+ variantMatcher("next", (input) => `${input}+*`)
40
+ ];
41
+
42
+ const variantColorsClass = [
43
+ variantMatcher("dark", (input) => `.dark $$ ${input}`),
44
+ variantMatcher("light", (input) => `.light $$ ${input}`)
45
+ ];
46
+ const variantColorsMedia = [
47
+ (v) => {
48
+ const dark = variantMatcher("dark")(v);
49
+ if (dark) {
50
+ return {
51
+ ...dark,
52
+ parent: "@media (prefers-color-scheme: dark)"
53
+ };
54
+ }
55
+ const light = variantMatcher("light")(v);
56
+ if (light) {
57
+ return {
58
+ ...light,
59
+ parent: "@media (prefers-color-scheme: light)"
60
+ };
61
+ }
62
+ }
63
+ ];
64
+
65
+ const variantImportant = {
66
+ match(matcher) {
67
+ if (matcher.startsWith("!")) {
68
+ return {
69
+ matcher: matcher.slice(1),
70
+ body: (body) => {
71
+ body.forEach((v) => {
72
+ if (v[1])
73
+ v[1] += " !important";
74
+ });
75
+ return body;
76
+ }
77
+ };
78
+ }
79
+ }
80
+ };
81
+ const variantNegative = {
82
+ match(matcher) {
83
+ if (matcher.startsWith("-")) {
84
+ return {
85
+ matcher: matcher.slice(1),
86
+ body: (body) => {
87
+ body.forEach((v) => {
88
+ if (v[0].startsWith("--un-scale") || v[1]?.toString() === "0")
89
+ return;
90
+ v[1] = v[1]?.toString().replace(/[0-9.]+(?:[a-z]+|%)?/, (i) => `-${i}`);
91
+ });
92
+ return body;
93
+ }
94
+ };
95
+ }
96
+ }
97
+ };
98
+ const variantSpace = (matcher) => {
99
+ if (/^space-?([xy])-?(-?.+)$/.test(matcher) || /^divide-/.test(matcher)) {
100
+ return {
101
+ matcher,
102
+ selector: (input) => {
103
+ return `${input}>:not([hidden])~:not([hidden])`;
104
+ }
105
+ };
106
+ }
107
+ };
108
+
109
+ const variants = [
110
+ variantSpace,
111
+ variantNegative,
112
+ variantImportant,
113
+ variantBreakpoints,
114
+ ...variantChildren,
115
+ variantPseudoClasses,
116
+ variantPseudoElements
117
+ ];
118
+
119
+ export { variantColorsMedia as a, variantColorsClass as b, variantBreakpoints as c, variantChildren as d, variantImportant as e, variantNegative as f, variantSpace as g, variants as v };