tailwindcss 0.0.0-insiders.4e21639 → 0.0.0-insiders.4e62334
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 +435 -3
- package/LICENSE +1 -2
- package/README.md +13 -6
- package/colors.d.ts +3 -0
- package/colors.js +2 -1
- package/defaultConfig.d.ts +3 -0
- package/defaultConfig.js +2 -1
- package/defaultTheme.d.ts +4 -0
- package/defaultTheme.js +2 -1
- package/lib/cli-peer-dependencies.js +20 -7
- package/lib/cli.js +460 -259
- package/lib/constants.js +27 -20
- package/lib/corePluginList.js +9 -3
- package/lib/corePlugins.js +1840 -1753
- package/lib/css/preflight.css +8 -9
- package/lib/featureFlags.js +29 -20
- package/lib/index.js +22 -11
- package/lib/lib/cacheInvalidation.js +90 -0
- package/lib/lib/collapseAdjacentRules.js +27 -9
- package/lib/lib/collapseDuplicateDeclarations.js +58 -4
- package/lib/lib/defaultExtractor.js +231 -0
- package/lib/lib/detectNesting.js +13 -10
- package/lib/lib/evaluateTailwindFunctions.js +119 -52
- package/lib/lib/expandApplyAtRules.js +440 -161
- package/lib/lib/expandTailwindAtRules.js +130 -128
- package/lib/lib/generateRules.js +410 -171
- package/lib/lib/getModuleDependencies.js +11 -8
- package/lib/lib/normalizeTailwindDirectives.js +43 -32
- package/lib/lib/offsets.js +199 -0
- package/lib/lib/partitionApplyAtRules.js +56 -0
- package/lib/lib/regex.js +60 -0
- package/lib/lib/resolveDefaultsAtRules.js +91 -55
- package/lib/lib/setupContextUtils.js +453 -347
- package/lib/lib/setupTrackingContext.js +52 -44
- package/lib/lib/sharedState.js +48 -9
- package/lib/lib/substituteScreenAtRules.js +13 -8
- package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
- package/lib/postcss-plugins/nesting/index.js +19 -0
- package/lib/postcss-plugins/nesting/plugin.js +87 -0
- package/lib/processTailwindFeatures.js +36 -25
- package/lib/public/colors.js +247 -245
- package/lib/public/create-plugin.js +6 -4
- package/lib/public/default-config.js +7 -5
- package/lib/public/default-theme.js +7 -5
- package/lib/public/resolve-config.js +8 -5
- package/lib/util/bigSign.js +4 -1
- package/lib/util/buildMediaQuery.js +16 -25
- package/lib/util/cloneDeep.js +7 -6
- package/lib/util/cloneNodes.js +21 -3
- package/lib/util/color.js +54 -40
- package/lib/util/configurePlugins.js +4 -1
- package/lib/util/createPlugin.js +6 -6
- package/lib/util/createUtilityPlugin.js +12 -14
- package/lib/util/dataTypes.js +119 -102
- package/lib/util/defaults.js +10 -1
- package/lib/util/escapeClassName.js +7 -4
- package/lib/util/escapeCommas.js +5 -2
- package/lib/util/flattenColorPalette.js +9 -12
- package/lib/util/formatVariantSelector.js +223 -40
- package/lib/util/getAllConfigs.js +27 -8
- package/lib/util/hashConfig.js +6 -3
- package/lib/util/isKeyframeRule.js +5 -2
- package/lib/util/isPlainObject.js +5 -2
- package/lib/util/isValidArbitraryValue.js +72 -0
- package/lib/util/log.js +22 -12
- package/lib/util/nameClass.js +17 -8
- package/lib/util/negateValue.js +22 -7
- package/lib/util/normalizeConfig.js +99 -54
- package/lib/util/normalizeScreens.js +73 -0
- package/lib/util/parseAnimationValue.js +42 -40
- package/lib/util/parseBoxShadowValue.js +30 -23
- package/lib/util/parseDependency.js +18 -15
- package/lib/util/parseObjectStyles.js +10 -7
- package/lib/util/pluginUtils.js +51 -42
- package/lib/util/prefixSelector.js +10 -8
- package/lib/util/removeAlphaVariables.js +29 -0
- package/lib/util/resolveConfig.js +91 -66
- package/lib/util/resolveConfigPath.js +11 -9
- package/lib/util/responsive.js +8 -5
- package/lib/util/splitAtTopLevelOnly.js +43 -0
- package/lib/util/tap.js +4 -1
- package/lib/util/toColorValue.js +5 -3
- package/lib/util/toPath.js +24 -3
- package/lib/util/transformThemeValue.js +37 -29
- package/lib/util/validateConfig.js +24 -0
- package/lib/util/withAlphaVariable.js +23 -15
- package/nesting/index.js +2 -12
- package/package.json +43 -43
- package/peers/index.js +11543 -8114
- package/plugin.d.ts +11 -0
- package/plugin.js +2 -1
- package/resolveConfig.d.ts +3 -0
- package/resolveConfig.js +2 -1
- package/scripts/generate-types.js +105 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +293 -36
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +428 -285
- package/src/css/preflight.css +8 -9
- package/src/featureFlags.js +9 -5
- package/src/index.js +14 -6
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/collapseDuplicateDeclarations.js +66 -1
- package/src/lib/defaultExtractor.js +208 -0
- package/src/lib/evaluateTailwindFunctions.js +84 -10
- package/src/lib/expandApplyAtRules.js +488 -153
- package/src/lib/expandTailwindAtRules.js +82 -80
- package/src/lib/generateRules.js +352 -120
- package/src/lib/normalizeTailwindDirectives.js +7 -1
- package/src/lib/offsets.js +239 -0
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/resolveDefaultsAtRules.js +59 -17
- package/src/lib/setupContextUtils.js +337 -174
- package/src/lib/setupTrackingContext.js +13 -8
- package/src/lib/sharedState.js +42 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/src/postcss-plugins/nesting/plugin.js +80 -0
- package/src/processTailwindFeatures.js +12 -2
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/cloneNodes.js +19 -2
- package/src/util/color.js +31 -14
- package/src/util/dataTypes.js +28 -19
- package/src/util/defaults.js +6 -0
- package/src/util/formatVariantSelector.js +237 -23
- package/src/util/getAllConfigs.js +19 -0
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/log.js +11 -7
- package/src/util/nameClass.js +1 -1
- package/src/util/negateValue.js +10 -2
- package/src/util/normalizeConfig.js +16 -3
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +4 -3
- package/src/util/pluginUtils.js +14 -2
- package/src/util/prefixSelector.js +7 -5
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +71 -17
- package/src/util/splitAtTopLevelOnly.js +45 -0
- package/src/util/toPath.js +23 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +13 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +24 -3
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +334 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +276 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/generated/default-theme.d.ts +331 -0
- package/types/index.d.ts +7 -0
- package/lib/lib/setupWatchingContext.js +0 -288
- package/nesting/plugin.js +0 -41
- package/src/lib/setupWatchingContext.js +0 -311
package/lib/util/dataTypes.js
CHANGED
|
@@ -2,90 +2,106 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
normalize: ()=>normalize,
|
|
13
|
+
url: ()=>url,
|
|
14
|
+
number: ()=>number,
|
|
15
|
+
percentage: ()=>percentage,
|
|
16
|
+
length: ()=>length,
|
|
17
|
+
lineWidth: ()=>lineWidth,
|
|
18
|
+
shadow: ()=>shadow,
|
|
19
|
+
color: ()=>color,
|
|
20
|
+
image: ()=>image,
|
|
21
|
+
gradient: ()=>gradient,
|
|
22
|
+
position: ()=>position,
|
|
23
|
+
familyName: ()=>familyName,
|
|
24
|
+
genericName: ()=>genericName,
|
|
25
|
+
absoluteSize: ()=>absoluteSize,
|
|
26
|
+
relativeSize: ()=>relativeSize
|
|
27
|
+
});
|
|
28
|
+
const _color = require("./color");
|
|
29
|
+
const _parseBoxShadowValue = require("./parseBoxShadowValue");
|
|
30
|
+
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
31
|
+
let cssFunctions = [
|
|
32
|
+
"min",
|
|
33
|
+
"max",
|
|
34
|
+
"clamp",
|
|
35
|
+
"calc"
|
|
36
|
+
];
|
|
27
37
|
function normalize(value, isRoot = true) {
|
|
28
38
|
// Keep raw strings if it starts with `url(`
|
|
29
|
-
if (value.includes(
|
|
39
|
+
if (value.includes("url(")) {
|
|
30
40
|
return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
|
|
31
41
|
if (/^url\(.*?\)$/.test(part)) {
|
|
32
42
|
return part;
|
|
33
43
|
}
|
|
34
44
|
return normalize(part, false);
|
|
35
|
-
}).join(
|
|
45
|
+
}).join("");
|
|
36
46
|
}
|
|
37
47
|
// Convert `_` to ` `, except for escaped underscores `\_`
|
|
38
|
-
value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore +
|
|
39
|
-
).replace(/^_/g, ' ').replace(/\\_/g, '_');
|
|
48
|
+
value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_");
|
|
40
49
|
// Remove leftover whitespace
|
|
41
50
|
if (isRoot) {
|
|
42
51
|
value = value.trim();
|
|
43
52
|
}
|
|
44
|
-
// Add spaces around operators inside calc() that do not follow an operator
|
|
53
|
+
// Add spaces around operators inside math functions like calc() that do not follow an operator
|
|
45
54
|
// or '('.
|
|
46
|
-
|
|
55
|
+
value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
|
56
|
+
return match.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
57
|
+
});
|
|
58
|
+
return value;
|
|
47
59
|
}
|
|
48
60
|
function url(value) {
|
|
49
|
-
return value.startsWith(
|
|
61
|
+
return value.startsWith("url(");
|
|
50
62
|
}
|
|
51
63
|
function number(value) {
|
|
52
|
-
return !isNaN(Number(value));
|
|
64
|
+
return !isNaN(Number(value)) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?`).test(value));
|
|
53
65
|
}
|
|
54
66
|
function percentage(value) {
|
|
55
|
-
return
|
|
67
|
+
return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
68
|
+
return /%$/g.test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?%`).test(part));
|
|
69
|
+
});
|
|
56
70
|
}
|
|
57
71
|
let lengthUnits = [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
"cm",
|
|
73
|
+
"mm",
|
|
74
|
+
"Q",
|
|
75
|
+
"in",
|
|
76
|
+
"pc",
|
|
77
|
+
"pt",
|
|
78
|
+
"px",
|
|
79
|
+
"em",
|
|
80
|
+
"ex",
|
|
81
|
+
"ch",
|
|
82
|
+
"rem",
|
|
83
|
+
"lh",
|
|
84
|
+
"vw",
|
|
85
|
+
"vh",
|
|
86
|
+
"vmin",
|
|
87
|
+
"vmax",
|
|
74
88
|
];
|
|
75
|
-
let lengthUnitsPattern = `(?:${lengthUnits.join(
|
|
89
|
+
let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`;
|
|
76
90
|
function length(value) {
|
|
77
|
-
return
|
|
91
|
+
return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
92
|
+
return part === "0" || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part));
|
|
93
|
+
});
|
|
78
94
|
}
|
|
79
95
|
let lineWidths = new Set([
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
96
|
+
"thin",
|
|
97
|
+
"medium",
|
|
98
|
+
"thick"
|
|
83
99
|
]);
|
|
84
100
|
function lineWidth(value) {
|
|
85
101
|
return lineWidths.has(value);
|
|
86
102
|
}
|
|
87
103
|
function shadow(value) {
|
|
88
|
-
let parsedShadows = (0, _parseBoxShadowValue
|
|
104
|
+
let parsedShadows = (0, _parseBoxShadowValue.parseBoxShadowValue)(normalize(value));
|
|
89
105
|
for (let parsedShadow of parsedShadows){
|
|
90
106
|
if (!parsedShadow.valid) {
|
|
91
107
|
return false;
|
|
@@ -95,10 +111,12 @@ function shadow(value) {
|
|
|
95
111
|
}
|
|
96
112
|
function color(value) {
|
|
97
113
|
let colors = 0;
|
|
98
|
-
let result =
|
|
114
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
99
115
|
part = normalize(part);
|
|
100
|
-
if (part.startsWith(
|
|
101
|
-
if ((0, _color
|
|
116
|
+
if (part.startsWith("var(")) return true;
|
|
117
|
+
if ((0, _color.parseColor)(part, {
|
|
118
|
+
loose: true
|
|
119
|
+
}) !== null) return colors++, true;
|
|
102
120
|
return false;
|
|
103
121
|
});
|
|
104
122
|
if (!result) return false;
|
|
@@ -106,16 +124,15 @@ function color(value) {
|
|
|
106
124
|
}
|
|
107
125
|
function image(value) {
|
|
108
126
|
let images = 0;
|
|
109
|
-
let result =
|
|
127
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
|
110
128
|
part = normalize(part);
|
|
111
|
-
if (part.startsWith(
|
|
129
|
+
if (part.startsWith("var(")) return true;
|
|
112
130
|
if (url(part) || gradient(part) || [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
].some((fn)=>part.startsWith(fn)
|
|
118
|
-
)) {
|
|
131
|
+
"element(",
|
|
132
|
+
"image(",
|
|
133
|
+
"cross-fade(",
|
|
134
|
+
"image-set("
|
|
135
|
+
].some((fn)=>part.startsWith(fn))) {
|
|
119
136
|
images++;
|
|
120
137
|
return true;
|
|
121
138
|
}
|
|
@@ -125,11 +142,11 @@ function image(value) {
|
|
|
125
142
|
return images > 0;
|
|
126
143
|
}
|
|
127
144
|
let gradientTypes = new Set([
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
145
|
+
"linear-gradient",
|
|
146
|
+
"radial-gradient",
|
|
147
|
+
"repeating-linear-gradient",
|
|
148
|
+
"repeating-radial-gradient",
|
|
149
|
+
"conic-gradient",
|
|
133
150
|
]);
|
|
134
151
|
function gradient(value) {
|
|
135
152
|
value = normalize(value);
|
|
@@ -141,17 +158,17 @@ function gradient(value) {
|
|
|
141
158
|
return false;
|
|
142
159
|
}
|
|
143
160
|
let validPositions = new Set([
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
161
|
+
"center",
|
|
162
|
+
"top",
|
|
163
|
+
"right",
|
|
164
|
+
"bottom",
|
|
165
|
+
"left"
|
|
149
166
|
]);
|
|
150
167
|
function position(value) {
|
|
151
168
|
let positions = 0;
|
|
152
|
-
let result =
|
|
169
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
153
170
|
part = normalize(part);
|
|
154
|
-
if (part.startsWith(
|
|
171
|
+
if (part.startsWith("var(")) return true;
|
|
155
172
|
if (validPositions.has(part) || length(part) || percentage(part)) {
|
|
156
173
|
positions++;
|
|
157
174
|
return true;
|
|
@@ -163,11 +180,11 @@ function position(value) {
|
|
|
163
180
|
}
|
|
164
181
|
function familyName(value) {
|
|
165
182
|
let fonts = 0;
|
|
166
|
-
let result =
|
|
183
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
|
167
184
|
part = normalize(part);
|
|
168
|
-
if (part.startsWith(
|
|
185
|
+
if (part.startsWith("var(")) return true;
|
|
169
186
|
// If it contains spaces, then it should be quoted
|
|
170
|
-
if (part.includes(
|
|
187
|
+
if (part.includes(" ")) {
|
|
171
188
|
if (!/(['"])([^"']+)\1/g.test(part)) {
|
|
172
189
|
return false;
|
|
173
190
|
}
|
|
@@ -183,39 +200,39 @@ function familyName(value) {
|
|
|
183
200
|
return fonts > 0;
|
|
184
201
|
}
|
|
185
202
|
let genericNames = new Set([
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
"serif",
|
|
204
|
+
"sans-serif",
|
|
205
|
+
"monospace",
|
|
206
|
+
"cursive",
|
|
207
|
+
"fantasy",
|
|
208
|
+
"system-ui",
|
|
209
|
+
"ui-serif",
|
|
210
|
+
"ui-sans-serif",
|
|
211
|
+
"ui-monospace",
|
|
212
|
+
"ui-rounded",
|
|
213
|
+
"math",
|
|
214
|
+
"emoji",
|
|
215
|
+
"fangsong",
|
|
199
216
|
]);
|
|
200
217
|
function genericName(value) {
|
|
201
218
|
return genericNames.has(value);
|
|
202
219
|
}
|
|
203
220
|
let absoluteSizes = new Set([
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
221
|
+
"xx-small",
|
|
222
|
+
"x-small",
|
|
223
|
+
"small",
|
|
224
|
+
"medium",
|
|
225
|
+
"large",
|
|
226
|
+
"x-large",
|
|
227
|
+
"x-large",
|
|
228
|
+
"xxx-large",
|
|
212
229
|
]);
|
|
213
230
|
function absoluteSize(value) {
|
|
214
231
|
return absoluteSizes.has(value);
|
|
215
232
|
}
|
|
216
233
|
let relativeSizes = new Set([
|
|
217
|
-
|
|
218
|
-
|
|
234
|
+
"larger",
|
|
235
|
+
"smaller"
|
|
219
236
|
]);
|
|
220
237
|
function relativeSize(value) {
|
|
221
238
|
return relativeSizes.has(value);
|
package/lib/util/defaults.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "defaults", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>defaults
|
|
8
|
+
});
|
|
6
9
|
function defaults(target, ...sources) {
|
|
7
10
|
for (let source of sources){
|
|
8
11
|
for(let k in source){
|
|
@@ -11,6 +14,12 @@ function defaults(target, ...sources) {
|
|
|
11
14
|
target[k] = source[k];
|
|
12
15
|
}
|
|
13
16
|
}
|
|
17
|
+
for (let k1 of Object.getOwnPropertySymbols(source)){
|
|
18
|
+
var ref1;
|
|
19
|
+
if (!(target === null || target === void 0 ? void 0 : (ref1 = target.hasOwnProperty) === null || ref1 === void 0 ? void 0 : ref1.call(target, k1))) {
|
|
20
|
+
target[k1] = source[k1];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
return target;
|
|
16
25
|
}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>escapeClassName
|
|
8
|
+
});
|
|
9
|
+
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
|
10
|
+
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
|
8
11
|
function _interopRequireDefault(obj) {
|
|
9
12
|
return obj && obj.__esModule ? obj : {
|
|
10
13
|
default: obj
|
|
@@ -15,5 +18,5 @@ function escapeClassName(className) {
|
|
|
15
18
|
let node = _postcssSelectorParser.default.className();
|
|
16
19
|
node.value = className;
|
|
17
20
|
var ref1;
|
|
18
|
-
return (0, _escapeCommas
|
|
21
|
+
return (0, _escapeCommas.default)((ref1 = node === null || node === void 0 ? void 0 : (ref = node.raws) === null || ref === void 0 ? void 0 : ref.value) !== null && ref1 !== void 0 ? ref1 : node.value);
|
|
19
22
|
}
|
package/lib/util/escapeCommas.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>escapeCommas
|
|
8
|
+
});
|
|
6
9
|
function escapeCommas(className) {
|
|
7
|
-
return className.replace(/\\,/g,
|
|
10
|
+
return className.replace(/\\,/g, "\\2c ");
|
|
8
11
|
}
|
|
@@ -2,18 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>_default
|
|
8
|
+
});
|
|
9
|
+
const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
|
|
10
|
+
[color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
|
|
11
|
+
})) : [
|
|
12
12
|
{
|
|
13
13
|
[`${color}`]: values
|
|
14
14
|
}
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
;
|
|
18
|
-
var _default = flattenColorPalette;
|
|
19
|
-
exports.default = _default;
|
|
15
|
+
]));
|
|
16
|
+
const _default = flattenColorPalette;
|