tailwindcss 0.0.0-insiders.fe08e91 → 0.0.0-oxide.956419c
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 +384 -3
- package/LICENSE +1 -2
- package/README.md +12 -8
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +4 -0
- package/lib/cli/build/deps.js +54 -0
- package/lib/cli/build/index.js +48 -0
- package/lib/cli/build/plugin.js +367 -0
- package/lib/cli/build/utils.js +78 -0
- package/lib/cli/build/watching.js +178 -0
- package/lib/cli/help/index.js +71 -0
- package/lib/cli/index.js +239 -0
- package/lib/cli/init/index.js +46 -0
- package/lib/cli/shared.js +13 -0
- package/lib/cli-peer-dependencies.js +20 -7
- package/lib/cli.js +4 -740
- package/lib/constants.js +27 -20
- package/lib/corePluginList.js +6 -3
- package/lib/corePlugins.js +2064 -1811
- package/lib/css/preflight.css +5 -5
- package/lib/featureFlags.js +31 -22
- package/lib/index.js +4 -28
- package/lib/lib/cacheInvalidation.js +90 -0
- package/lib/lib/collapseAdjacentRules.js +27 -9
- package/lib/lib/collapseDuplicateDeclarations.js +12 -9
- package/lib/lib/content.js +176 -0
- package/lib/lib/defaultExtractor.js +225 -31
- package/lib/lib/detectNesting.js +13 -10
- package/lib/lib/evaluateTailwindFunctions.js +118 -55
- package/lib/lib/expandApplyAtRules.js +439 -190
- package/lib/lib/expandTailwindAtRules.js +151 -134
- package/lib/lib/findAtConfigPath.js +44 -0
- package/lib/lib/generateRules.js +454 -187
- package/lib/lib/getModuleDependencies.js +11 -8
- package/lib/lib/normalizeTailwindDirectives.js +36 -32
- package/lib/lib/offsets.js +217 -0
- package/lib/lib/partitionApplyAtRules.js +56 -0
- package/lib/lib/regex.js +60 -0
- package/lib/lib/resolveDefaultsAtRules.js +89 -67
- package/lib/lib/setupContextUtils.js +667 -376
- package/lib/lib/setupTrackingContext.js +38 -67
- package/lib/lib/sharedState.js +27 -14
- package/lib/lib/substituteScreenAtRules.js +11 -9
- package/lib/oxide/cli.d.js +1 -0
- package/lib/oxide/cli.js +2 -0
- package/lib/oxide/postcss-plugin.d.js +1 -0
- package/lib/oxide/postcss-plugin.js +2 -0
- package/lib/plugin.js +48 -0
- 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 +35 -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 +11 -6
- package/lib/util/cloneDeep.js +7 -6
- package/lib/util/cloneNodes.js +21 -3
- package/lib/util/color.js +53 -54
- package/lib/util/configurePlugins.js +5 -2
- package/lib/util/createPlugin.js +6 -6
- package/lib/util/createUtilityPlugin.js +12 -14
- package/lib/util/dataTypes.js +119 -110
- package/lib/util/defaults.js +4 -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 +184 -85
- 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 → isSyntacticallyValidPropertyValue.js} +23 -15
- package/lib/util/log.js +20 -14
- package/lib/util/nameClass.js +20 -9
- package/lib/util/negateValue.js +23 -8
- package/lib/util/normalizeConfig.js +116 -72
- package/lib/util/normalizeScreens.js +120 -11
- package/lib/util/parseAnimationValue.js +42 -40
- package/lib/util/parseBoxShadowValue.js +30 -23
- package/lib/util/parseDependency.js +38 -56
- package/lib/util/parseGlob.js +34 -0
- package/lib/util/parseObjectStyles.js +11 -8
- package/lib/util/pluginUtils.js +147 -50
- package/lib/util/prefixSelector.js +10 -8
- package/lib/util/removeAlphaVariables.js +29 -0
- package/lib/util/resolveConfig.js +97 -85
- 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 +20 -4
- package/lib/util/transformThemeValue.js +37 -29
- package/lib/util/validateConfig.js +24 -0
- package/lib/util/validateFormalSyntax.js +24 -0
- package/lib/util/withAlphaVariable.js +23 -15
- package/nesting/index.js +2 -12
- package/package.json +50 -45
- package/peers/index.js +11381 -7950
- package/plugin.d.ts +11 -0
- package/resolveConfig.d.ts +12 -0
- package/scripts/generate-types.js +105 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli/build/deps.js +56 -0
- package/src/cli/build/index.js +49 -0
- package/src/cli/build/plugin.js +439 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +227 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +234 -0
- package/src/cli/init/index.js +50 -0
- package/src/cli/shared.js +6 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +4 -810
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +532 -217
- package/src/css/preflight.css +5 -5
- package/src/featureFlags.js +15 -9
- package/src/index.js +4 -27
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/content.js +212 -0
- package/src/lib/defaultExtractor.js +196 -33
- package/src/lib/evaluateTailwindFunctions.js +78 -7
- package/src/lib/expandApplyAtRules.js +482 -183
- package/src/lib/expandTailwindAtRules.js +106 -85
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +418 -129
- package/src/lib/normalizeTailwindDirectives.js +1 -0
- package/src/lib/offsets.js +270 -0
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/resolveDefaultsAtRules.js +51 -30
- package/src/lib/setupContextUtils.js +556 -208
- package/src/lib/setupTrackingContext.js +11 -48
- package/src/lib/sharedState.js +5 -0
- package/src/oxide/cli.d.ts +0 -0
- package/src/oxide/cli.ts +1 -0
- package/src/oxide/postcss-plugin.d.ts +0 -0
- package/src/oxide/postcss-plugin.ts +1 -0
- package/src/plugin.js +47 -0
- 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 +8 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +19 -2
- package/src/util/color.js +25 -21
- package/src/util/dataTypes.js +29 -21
- package/src/util/formatVariantSelector.js +184 -61
- package/src/util/getAllConfigs.js +19 -0
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +8 -8
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +44 -6
- package/src/util/normalizeScreens.js +99 -4
- package/src/util/parseBoxShadowValue.js +4 -3
- package/src/util/parseDependency.js +37 -42
- package/src/util/parseGlob.js +24 -0
- package/src/util/pluginUtils.js +132 -10
- package/src/util/prefixSelector.js +7 -5
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -32
- package/src/util/splitAtTopLevelOnly.js +45 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +13 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +167 -164
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +362 -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 +342 -0
- package/types/index.d.ts +7 -0
- package/nesting/plugin.js +0 -41
package/lib/util/dataTypes.js
CHANGED
|
@@ -2,101 +2,109 @@
|
|
|
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
|
-
|
|
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");
|
|
22
31
|
let cssFunctions = [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
"min",
|
|
33
|
+
"max",
|
|
34
|
+
"clamp",
|
|
35
|
+
"calc"
|
|
27
36
|
];
|
|
28
37
|
// Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
|
|
29
|
-
|
|
30
|
-
;
|
|
31
|
-
|
|
32
|
-
;
|
|
38
|
+
function isCSSFunction(value) {
|
|
39
|
+
return cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.*\\)`).test(value));
|
|
40
|
+
}
|
|
33
41
|
function normalize(value, isRoot = true) {
|
|
42
|
+
if (value.startsWith("--")) {
|
|
43
|
+
return `var(${value})`;
|
|
44
|
+
}
|
|
34
45
|
// Keep raw strings if it starts with `url(`
|
|
35
|
-
if (value.includes(
|
|
46
|
+
if (value.includes("url(")) {
|
|
36
47
|
return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
|
|
37
48
|
if (/^url\(.*?\)$/.test(part)) {
|
|
38
49
|
return part;
|
|
39
50
|
}
|
|
40
51
|
return normalize(part, false);
|
|
41
|
-
}).join(
|
|
52
|
+
}).join("");
|
|
42
53
|
}
|
|
43
54
|
// Convert `_` to ` `, except for escaped underscores `\_`
|
|
44
|
-
value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore +
|
|
45
|
-
).replace(/^_/g, ' ').replace(/\\_/g, '_');
|
|
55
|
+
value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_");
|
|
46
56
|
// Remove leftover whitespace
|
|
47
57
|
if (isRoot) {
|
|
48
58
|
value = value.trim();
|
|
49
59
|
}
|
|
50
|
-
// Add spaces around operators inside calc() that do not follow an operator
|
|
60
|
+
// Add spaces around operators inside math functions like calc() that do not follow an operator
|
|
51
61
|
// or '('.
|
|
52
|
-
|
|
62
|
+
value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
|
63
|
+
return match.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
64
|
+
});
|
|
65
|
+
return value;
|
|
53
66
|
}
|
|
54
67
|
function url(value) {
|
|
55
|
-
return value.startsWith(
|
|
68
|
+
return value.startsWith("url(");
|
|
56
69
|
}
|
|
57
70
|
function number(value) {
|
|
58
|
-
return !isNaN(Number(value)) ||
|
|
59
|
-
);
|
|
71
|
+
return !isNaN(Number(value)) || isCSSFunction(value);
|
|
60
72
|
}
|
|
61
73
|
function percentage(value) {
|
|
62
|
-
return
|
|
63
|
-
);
|
|
74
|
+
return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value);
|
|
64
75
|
}
|
|
65
76
|
let lengthUnits = [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
"cm",
|
|
78
|
+
"mm",
|
|
79
|
+
"Q",
|
|
80
|
+
"in",
|
|
81
|
+
"pc",
|
|
82
|
+
"pt",
|
|
83
|
+
"px",
|
|
84
|
+
"em",
|
|
85
|
+
"ex",
|
|
86
|
+
"ch",
|
|
87
|
+
"rem",
|
|
88
|
+
"lh",
|
|
89
|
+
"vw",
|
|
90
|
+
"vh",
|
|
91
|
+
"vmin",
|
|
92
|
+
"vmax"
|
|
82
93
|
];
|
|
83
|
-
let lengthUnitsPattern = `(?:${lengthUnits.join(
|
|
94
|
+
let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`;
|
|
84
95
|
function length(value) {
|
|
85
|
-
return value
|
|
86
|
-
return part === '0' || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part)
|
|
87
|
-
);
|
|
88
|
-
});
|
|
96
|
+
return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value);
|
|
89
97
|
}
|
|
90
98
|
let lineWidths = new Set([
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
"thin",
|
|
100
|
+
"medium",
|
|
101
|
+
"thick"
|
|
94
102
|
]);
|
|
95
103
|
function lineWidth(value) {
|
|
96
104
|
return lineWidths.has(value);
|
|
97
105
|
}
|
|
98
106
|
function shadow(value) {
|
|
99
|
-
let parsedShadows = (0, _parseBoxShadowValue
|
|
107
|
+
let parsedShadows = (0, _parseBoxShadowValue.parseBoxShadowValue)(normalize(value));
|
|
100
108
|
for (let parsedShadow of parsedShadows){
|
|
101
109
|
if (!parsedShadow.valid) {
|
|
102
110
|
return false;
|
|
@@ -106,10 +114,12 @@ function shadow(value) {
|
|
|
106
114
|
}
|
|
107
115
|
function color(value) {
|
|
108
116
|
let colors = 0;
|
|
109
|
-
let result =
|
|
117
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
110
118
|
part = normalize(part);
|
|
111
|
-
if (part.startsWith(
|
|
112
|
-
if ((0, _color
|
|
119
|
+
if (part.startsWith("var(")) return true;
|
|
120
|
+
if ((0, _color.parseColor)(part, {
|
|
121
|
+
loose: true
|
|
122
|
+
}) !== null) return colors++, true;
|
|
113
123
|
return false;
|
|
114
124
|
});
|
|
115
125
|
if (!result) return false;
|
|
@@ -117,16 +127,15 @@ function color(value) {
|
|
|
117
127
|
}
|
|
118
128
|
function image(value) {
|
|
119
129
|
let images = 0;
|
|
120
|
-
let result =
|
|
130
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
|
121
131
|
part = normalize(part);
|
|
122
|
-
if (part.startsWith(
|
|
132
|
+
if (part.startsWith("var(")) return true;
|
|
123
133
|
if (url(part) || gradient(part) || [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
].some((fn)=>part.startsWith(fn)
|
|
129
|
-
)) {
|
|
134
|
+
"element(",
|
|
135
|
+
"image(",
|
|
136
|
+
"cross-fade(",
|
|
137
|
+
"image-set("
|
|
138
|
+
].some((fn)=>part.startsWith(fn))) {
|
|
130
139
|
images++;
|
|
131
140
|
return true;
|
|
132
141
|
}
|
|
@@ -136,11 +145,11 @@ function image(value) {
|
|
|
136
145
|
return images > 0;
|
|
137
146
|
}
|
|
138
147
|
let gradientTypes = new Set([
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
"linear-gradient",
|
|
149
|
+
"radial-gradient",
|
|
150
|
+
"repeating-linear-gradient",
|
|
151
|
+
"repeating-radial-gradient",
|
|
152
|
+
"conic-gradient"
|
|
144
153
|
]);
|
|
145
154
|
function gradient(value) {
|
|
146
155
|
value = normalize(value);
|
|
@@ -152,17 +161,17 @@ function gradient(value) {
|
|
|
152
161
|
return false;
|
|
153
162
|
}
|
|
154
163
|
let validPositions = new Set([
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
"center",
|
|
165
|
+
"top",
|
|
166
|
+
"right",
|
|
167
|
+
"bottom",
|
|
168
|
+
"left"
|
|
160
169
|
]);
|
|
161
170
|
function position(value) {
|
|
162
171
|
let positions = 0;
|
|
163
|
-
let result =
|
|
172
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
|
164
173
|
part = normalize(part);
|
|
165
|
-
if (part.startsWith(
|
|
174
|
+
if (part.startsWith("var(")) return true;
|
|
166
175
|
if (validPositions.has(part) || length(part) || percentage(part)) {
|
|
167
176
|
positions++;
|
|
168
177
|
return true;
|
|
@@ -174,11 +183,11 @@ function position(value) {
|
|
|
174
183
|
}
|
|
175
184
|
function familyName(value) {
|
|
176
185
|
let fonts = 0;
|
|
177
|
-
let result =
|
|
186
|
+
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
|
178
187
|
part = normalize(part);
|
|
179
|
-
if (part.startsWith(
|
|
188
|
+
if (part.startsWith("var(")) return true;
|
|
180
189
|
// If it contains spaces, then it should be quoted
|
|
181
|
-
if (part.includes(
|
|
190
|
+
if (part.includes(" ")) {
|
|
182
191
|
if (!/(['"])([^"']+)\1/g.test(part)) {
|
|
183
192
|
return false;
|
|
184
193
|
}
|
|
@@ -194,39 +203,39 @@ function familyName(value) {
|
|
|
194
203
|
return fonts > 0;
|
|
195
204
|
}
|
|
196
205
|
let genericNames = new Set([
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
"serif",
|
|
207
|
+
"sans-serif",
|
|
208
|
+
"monospace",
|
|
209
|
+
"cursive",
|
|
210
|
+
"fantasy",
|
|
211
|
+
"system-ui",
|
|
212
|
+
"ui-serif",
|
|
213
|
+
"ui-sans-serif",
|
|
214
|
+
"ui-monospace",
|
|
215
|
+
"ui-rounded",
|
|
216
|
+
"math",
|
|
217
|
+
"emoji",
|
|
218
|
+
"fangsong"
|
|
210
219
|
]);
|
|
211
220
|
function genericName(value) {
|
|
212
221
|
return genericNames.has(value);
|
|
213
222
|
}
|
|
214
223
|
let absoluteSizes = new Set([
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
"xx-small",
|
|
225
|
+
"x-small",
|
|
226
|
+
"small",
|
|
227
|
+
"medium",
|
|
228
|
+
"large",
|
|
229
|
+
"x-large",
|
|
230
|
+
"x-large",
|
|
231
|
+
"xxx-large"
|
|
223
232
|
]);
|
|
224
233
|
function absoluteSize(value) {
|
|
225
234
|
return absoluteSizes.has(value);
|
|
226
235
|
}
|
|
227
236
|
let relativeSizes = new Set([
|
|
228
|
-
|
|
229
|
-
|
|
237
|
+
"larger",
|
|
238
|
+
"smaller"
|
|
230
239
|
]);
|
|
231
240
|
function relativeSize(value) {
|
|
232
241
|
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){
|
|
@@ -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;
|