tailwindcss 0.0.0-oxide-insiders.dddaded → 0.0.0-oxide-insiders.b2e3cf2
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/lib/cli/build/deps.js +10 -18
- package/lib/cli/build/index.js +10 -41
- package/lib/cli/build/plugin.js +87 -268
- package/lib/cli/build/utils.js +18 -40
- package/lib/cli/build/watching.js +35 -151
- package/lib/cli/help/index.js +15 -58
- package/lib/cli/index.js +61 -120
- package/lib/cli/init/index.js +21 -43
- package/lib/cli-peer-dependencies.js +13 -15
- package/lib/cli.js +1 -5
- package/lib/corePluginList.js +3 -4
- package/lib/corePlugins.js +394 -857
- package/lib/featureFlags.js +14 -34
- package/lib/index.js +1 -5
- package/lib/lib/cacheInvalidation.js +29 -75
- package/lib/lib/collapseAdjacentRules.js +22 -43
- package/lib/lib/collapseDuplicateDeclarations.js +27 -68
- package/lib/lib/content.js +37 -126
- package/lib/lib/defaultExtractor.js +96 -199
- package/lib/lib/detectNesting.js +12 -36
- package/lib/lib/evaluateTailwindFunctions.js +101 -188
- package/lib/lib/expandApplyAtRules.js +177 -482
- package/lib/lib/expandTailwindAtRules.js +69 -237
- package/lib/lib/findAtConfigPath.js +13 -30
- package/lib/lib/generateRules.js +349 -765
- package/lib/lib/getModuleDependencies.js +27 -63
- package/lib/lib/load-config.js +16 -24
- package/lib/lib/normalizeTailwindDirectives.js +26 -70
- package/lib/lib/offsets.js +61 -224
- package/lib/lib/partitionApplyAtRules.js +29 -51
- package/lib/lib/regex.js +22 -30
- package/lib/lib/remap-bitfield.js +9 -84
- package/lib/lib/resolveDefaultsAtRules.js +50 -116
- package/lib/lib/setupContextUtils.js +576 -1099
- package/lib/lib/setupTrackingContext.js +54 -143
- package/lib/lib/sharedState.js +15 -59
- package/lib/lib/substituteScreenAtRules.js +8 -16
- package/lib/oxide/cli/build/deps.js +17 -32
- package/lib/oxide/cli/build/index.js +10 -40
- package/lib/oxide/cli/build/plugin.js +87 -267
- package/lib/oxide/cli/build/utils.js +18 -39
- package/lib/oxide/cli/build/watching.js +34 -149
- package/lib/oxide/cli/help/index.js +15 -57
- package/lib/oxide/cli/index.js +66 -127
- package/lib/oxide/cli/init/index.js +17 -36
- package/lib/oxide/cli.js +2 -3
- package/lib/plugin.js +30 -57
- package/lib/postcss-plugins/nesting/index.js +6 -10
- package/lib/postcss-plugins/nesting/plugin.js +17 -60
- package/lib/processTailwindFeatures.js +8 -37
- package/lib/public/colors.js +15 -22
- package/lib/public/create-plugin.js +5 -8
- package/lib/public/default-config.js +5 -9
- package/lib/public/default-theme.js +5 -9
- package/lib/public/load-config.js +4 -6
- package/lib/public/resolve-config.js +4 -6
- package/lib/util/applyImportantSelector.js +15 -24
- package/lib/util/bigSign.js +6 -7
- package/lib/util/buildMediaQuery.js +10 -17
- package/lib/util/cloneDeep.js +9 -17
- package/lib/util/cloneNodes.js +14 -27
- package/lib/util/color.js +45 -81
- package/lib/util/configurePlugins.js +9 -16
- package/lib/util/createPlugin.js +8 -15
- package/lib/util/createUtilityPlugin.js +15 -27
- package/lib/util/dataTypes.js +23 -144
- package/lib/util/defaults.js +9 -19
- package/lib/util/escapeClassName.js +6 -10
- package/lib/util/escapeCommas.js +6 -7
- package/lib/util/flattenColorPalette.js +6 -8
- package/lib/util/formatVariantSelector.js +49 -190
- package/lib/util/getAllConfigs.js +35 -42
- package/lib/util/hashConfig.js +6 -8
- package/lib/util/isKeyframeRule.js +6 -7
- package/lib/util/isPlainObject.js +8 -11
- package/lib/util/isSyntacticallyValidPropertyValue.js +13 -42
- package/lib/util/log.js +7 -14
- package/lib/util/nameClass.js +6 -21
- package/lib/util/negateValue.js +10 -26
- package/lib/util/normalizeConfig.js +63 -240
- package/lib/util/normalizeScreens.js +70 -137
- package/lib/util/parseAnimationValue.js +13 -61
- package/lib/util/parseBoxShadowValue.js +12 -57
- package/lib/util/parseDependency.js +13 -37
- package/lib/util/parseGlob.js +7 -22
- package/lib/util/parseObjectStyles.js +17 -26
- package/lib/util/pluginUtils.js +69 -176
- package/lib/util/prefixSelector.js +11 -28
- package/lib/util/pseudoElements.js +29 -105
- package/lib/util/removeAlphaVariables.js +8 -21
- package/lib/util/resolveConfig.js +103 -220
- package/lib/util/resolveConfigPath.js +12 -38
- package/lib/util/responsive.js +4 -6
- package/lib/util/splitAtTopLevelOnly.js +10 -44
- package/lib/util/tap.js +6 -8
- package/lib/util/toColorValue.js +6 -7
- package/lib/util/toPath.js +8 -26
- package/lib/util/transformThemeValue.js +12 -45
- package/lib/util/validateConfig.js +14 -22
- package/lib/util/validateFormalSyntax.js +5 -11
- package/lib/util/withAlphaVariable.js +28 -48
- package/package.json +3 -3
- package/peers/index.js +14 -16
- package/src/cli/build/plugin.js +1 -1
- package/src/cli.js +1 -1
- package/src/corePlugins.js +16 -17
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/expandTailwindAtRules.js +2 -2
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +1 -1
|
@@ -1,43 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
7
6
|
get: ()=>_default
|
|
8
7
|
});
|
|
9
|
-
const _dlv =
|
|
10
|
-
const _didyoumean = /*#__PURE__*/ _interopRequireDefault(require("didyoumean"));
|
|
11
|
-
const _transformThemeValue = /*#__PURE__*/ _interopRequireDefault(require("../util/transformThemeValue"));
|
|
12
|
-
const _postcssValueParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-value-parser"));
|
|
13
|
-
const _normalizeScreens = require("../util/normalizeScreens");
|
|
14
|
-
const _buildMediaQuery = /*#__PURE__*/ _interopRequireDefault(require("../util/buildMediaQuery"));
|
|
15
|
-
const _toPath = require("../util/toPath");
|
|
16
|
-
const _withAlphaVariable = require("../util/withAlphaVariable");
|
|
17
|
-
const _pluginUtils = require("../util/pluginUtils");
|
|
18
|
-
const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
|
|
8
|
+
const _dlv = _interopRequireDefault(require("dlv")), _didyoumean = _interopRequireDefault(require("didyoumean")), _transformThemeValue = _interopRequireDefault(require("../util/transformThemeValue")), _postcssValueParser = _interopRequireDefault(require("postcss-value-parser")), _normalizeScreens = require("../util/normalizeScreens"), _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery")), _toPath = require("../util/toPath"), _withAlphaVariable = require("../util/withAlphaVariable"), _pluginUtils = require("../util/pluginUtils"), _log = _interopRequireDefault(require("../util/log"));
|
|
19
9
|
function _interopRequireDefault(obj) {
|
|
20
10
|
return obj && obj.__esModule ? obj : {
|
|
21
11
|
default: obj
|
|
22
12
|
};
|
|
23
13
|
}
|
|
24
14
|
function isObject(input) {
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
function findClosestExistingPath(theme, path) {
|
|
28
|
-
let parts = (0, _toPath.toPath)(path);
|
|
29
|
-
do {
|
|
30
|
-
parts.pop();
|
|
31
|
-
if ((0, _dlv.default)(theme, parts) !== undefined) break;
|
|
32
|
-
}while (parts.length);
|
|
33
|
-
return parts.length ? parts : undefined;
|
|
15
|
+
return "object" == typeof input && null !== input;
|
|
34
16
|
}
|
|
35
17
|
function pathToString(path) {
|
|
36
|
-
|
|
37
|
-
return path.reduce((acc, cur, i)=>{
|
|
38
|
-
if (cur.includes(".")) return `${acc}[${cur}]`;
|
|
39
|
-
return i === 0 ? cur : `${acc}.${cur}`;
|
|
40
|
-
}, "");
|
|
18
|
+
return "string" == typeof path ? path : path.reduce((acc, cur, i)=>cur.includes(".") ? `${acc}[${cur}]` : 0 === i ? cur : `${acc}.${cur}`, "");
|
|
41
19
|
}
|
|
42
20
|
function list(items) {
|
|
43
21
|
return items.map((key)=>`'${key}'`).join(", ");
|
|
@@ -45,157 +23,89 @@ function list(items) {
|
|
|
45
23
|
function listKeys(obj) {
|
|
46
24
|
return list(Object.keys(obj));
|
|
47
25
|
}
|
|
48
|
-
function validatePath(config, path, defaultValue, themeOpts = {}) {
|
|
49
|
-
const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, "");
|
|
50
|
-
const pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString);
|
|
51
|
-
const value = (0, _dlv.default)(config.theme, pathSegments, defaultValue);
|
|
52
|
-
if (value === undefined) {
|
|
53
|
-
let error = `'${pathString}' does not exist in your theme config.`;
|
|
54
|
-
const parentSegments = pathSegments.slice(0, -1);
|
|
55
|
-
const parentValue = (0, _dlv.default)(config.theme, parentSegments);
|
|
56
|
-
if (isObject(parentValue)) {
|
|
57
|
-
const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [
|
|
58
|
-
...parentSegments,
|
|
59
|
-
key
|
|
60
|
-
]).isValid);
|
|
61
|
-
const suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys);
|
|
62
|
-
if (suggestion) {
|
|
63
|
-
error += ` Did you mean '${pathToString([
|
|
64
|
-
...parentSegments,
|
|
65
|
-
suggestion
|
|
66
|
-
])}'?`;
|
|
67
|
-
} else if (validKeys.length > 0) {
|
|
68
|
-
error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
const closestPath = findClosestExistingPath(config.theme, pathString);
|
|
72
|
-
if (closestPath) {
|
|
73
|
-
const closestValue = (0, _dlv.default)(config.theme, closestPath);
|
|
74
|
-
if (isObject(closestValue)) {
|
|
75
|
-
error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`;
|
|
76
|
-
} else {
|
|
77
|
-
error += ` '${pathToString(closestPath)}' is not an object.`;
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
isValid: false,
|
|
85
|
-
error
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) {
|
|
89
|
-
let error = `'${pathString}' was found but does not resolve to a string.`;
|
|
90
|
-
if (isObject(value)) {
|
|
91
|
-
let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
|
|
92
|
-
...pathSegments,
|
|
93
|
-
key
|
|
94
|
-
]).isValid);
|
|
95
|
-
if (validKeys.length) {
|
|
96
|
-
error += ` Did you mean something like '${pathToString([
|
|
97
|
-
...pathSegments,
|
|
98
|
-
validKeys[0]
|
|
99
|
-
])}'?`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
isValid: false,
|
|
104
|
-
error
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const [themeSection] = pathSegments;
|
|
108
|
-
return {
|
|
109
|
-
isValid: true,
|
|
110
|
-
value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts)
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function extractArgs(node, vNodes, functions) {
|
|
114
|
-
vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions));
|
|
115
|
-
let args = [
|
|
116
|
-
""
|
|
117
|
-
];
|
|
118
|
-
for (let vNode of vNodes){
|
|
119
|
-
if (vNode.type === "div" && vNode.value === ",") {
|
|
120
|
-
args.push("");
|
|
121
|
-
} else {
|
|
122
|
-
args[args.length - 1] += _postcssValueParser.default.stringify(vNode);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return args;
|
|
126
|
-
}
|
|
127
|
-
function resolveVNode(node, vNode, functions) {
|
|
128
|
-
if (vNode.type === "function" && functions[vNode.value] !== undefined) {
|
|
129
|
-
let args = extractArgs(node, vNode.nodes, functions);
|
|
130
|
-
vNode.type = "word";
|
|
131
|
-
vNode.value = functions[vNode.value](node, ...args);
|
|
132
|
-
}
|
|
133
|
-
return vNode;
|
|
134
|
-
}
|
|
135
|
-
function resolveFunctions(node, input, functions) {
|
|
136
|
-
return (0, _postcssValueParser.default)(input).walk((vNode)=>{
|
|
137
|
-
resolveVNode(node, vNode, functions);
|
|
138
|
-
}).toString();
|
|
139
|
-
}
|
|
140
26
|
let nodeTypePropertyMap = {
|
|
141
27
|
atrule: "params",
|
|
142
28
|
decl: "value"
|
|
143
29
|
};
|
|
144
|
-
/**
|
|
145
|
-
* @param {string} path
|
|
146
|
-
* @returns {Iterable<[path: string, alpha: string|undefined]>}
|
|
147
|
-
*/ function* toPaths(path) {
|
|
148
|
-
// Strip quotes from beginning and end of string
|
|
149
|
-
// This allows the alpha value to be present inside of quotes
|
|
150
|
-
path = path.replace(/^['"]+|['"]+$/g, "");
|
|
151
|
-
let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/);
|
|
152
|
-
let alpha = undefined;
|
|
153
|
-
yield [
|
|
154
|
-
path,
|
|
155
|
-
undefined
|
|
156
|
-
];
|
|
157
|
-
if (matches) {
|
|
158
|
-
path = matches[1];
|
|
159
|
-
alpha = matches[2];
|
|
160
|
-
yield [
|
|
161
|
-
path,
|
|
162
|
-
alpha
|
|
163
|
-
];
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
*
|
|
168
|
-
* @param {any} config
|
|
169
|
-
* @param {string} path
|
|
170
|
-
* @param {any} defaultValue
|
|
171
|
-
*/ function resolvePath(config, path, defaultValue) {
|
|
172
|
-
const results = Array.from(toPaths(path)).map(([path, alpha])=>{
|
|
173
|
-
return Object.assign(validatePath(config, path, defaultValue, {
|
|
174
|
-
opacityValue: alpha
|
|
175
|
-
}), {
|
|
176
|
-
resolvedPath: path,
|
|
177
|
-
alpha
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
var _results_find;
|
|
181
|
-
return (_results_find = results.find((result)=>result.isValid)) !== null && _results_find !== void 0 ? _results_find : results[0];
|
|
182
|
-
}
|
|
183
30
|
function _default(context) {
|
|
184
|
-
let config = context.tailwindConfig
|
|
185
|
-
let functions = {
|
|
31
|
+
let config = context.tailwindConfig, functions = {
|
|
186
32
|
theme: (node, path, ...defaultValue)=>{
|
|
187
|
-
let { isValid , value , error , alpha } =
|
|
33
|
+
let { isValid , value , error , alpha } = function(config, path, defaultValue) {
|
|
34
|
+
var _results_find;
|
|
35
|
+
let results = Array.from(function*(path) {
|
|
36
|
+
let alpha, matches = (path = path.replace(/^['"]+|['"]+$/g, "")).match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/);
|
|
37
|
+
yield [
|
|
38
|
+
path,
|
|
39
|
+
void 0
|
|
40
|
+
], matches && (path = matches[1], alpha = matches[2], yield [
|
|
41
|
+
path,
|
|
42
|
+
alpha
|
|
43
|
+
]);
|
|
44
|
+
}(path)).map(([path, alpha])=>Object.assign(function validatePath(config, path, defaultValue, themeOpts = {}) {
|
|
45
|
+
let pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, ""), pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString), value = (0, _dlv.default)(config.theme, pathSegments, defaultValue);
|
|
46
|
+
if (void 0 === value) {
|
|
47
|
+
let error = `'${pathString}' does not exist in your theme config.`, parentSegments = pathSegments.slice(0, -1), parentValue = (0, _dlv.default)(config.theme, parentSegments);
|
|
48
|
+
if (isObject(parentValue)) {
|
|
49
|
+
let validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [
|
|
50
|
+
...parentSegments,
|
|
51
|
+
key
|
|
52
|
+
]).isValid), suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys);
|
|
53
|
+
suggestion ? error += ` Did you mean '${pathToString([
|
|
54
|
+
...parentSegments,
|
|
55
|
+
suggestion
|
|
56
|
+
])}'?` : validKeys.length > 0 && (error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`);
|
|
57
|
+
} else {
|
|
58
|
+
let closestPath = function(theme, path) {
|
|
59
|
+
let parts = (0, _toPath.toPath)(path);
|
|
60
|
+
do if (parts.pop(), void 0 !== (0, _dlv.default)(theme, parts)) break;
|
|
61
|
+
while (parts.length);
|
|
62
|
+
return parts.length ? parts : void 0;
|
|
63
|
+
}(config.theme, pathString);
|
|
64
|
+
if (closestPath) {
|
|
65
|
+
let closestValue = (0, _dlv.default)(config.theme, closestPath);
|
|
66
|
+
isObject(closestValue) ? error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}` : error += ` '${pathToString(closestPath)}' is not an object.`;
|
|
67
|
+
} else error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
isValid: !1,
|
|
71
|
+
error
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (!("string" == typeof value || "number" == typeof value || "function" == typeof value || value instanceof String || value instanceof Number || Array.isArray(value))) {
|
|
75
|
+
let error = `'${pathString}' was found but does not resolve to a string.`;
|
|
76
|
+
if (isObject(value)) {
|
|
77
|
+
let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
|
|
78
|
+
...pathSegments,
|
|
79
|
+
key
|
|
80
|
+
]).isValid);
|
|
81
|
+
validKeys.length && (error += ` Did you mean something like '${pathToString([
|
|
82
|
+
...pathSegments,
|
|
83
|
+
validKeys[0]
|
|
84
|
+
])}'?`);
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
isValid: !1,
|
|
88
|
+
error
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
let [themeSection] = pathSegments;
|
|
92
|
+
return {
|
|
93
|
+
isValid: !0,
|
|
94
|
+
value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts)
|
|
95
|
+
};
|
|
96
|
+
}(config, path, defaultValue, {
|
|
97
|
+
opacityValue: alpha
|
|
98
|
+
}), {
|
|
99
|
+
resolvedPath: path,
|
|
100
|
+
alpha
|
|
101
|
+
}));
|
|
102
|
+
return null !== (_results_find = results.find((result)=>result.isValid)) && void 0 !== _results_find ? _results_find : results[0];
|
|
103
|
+
}(config, path, defaultValue.length ? defaultValue : void 0);
|
|
188
104
|
if (!isValid) {
|
|
189
105
|
var _parentNode_raws_tailwind;
|
|
190
|
-
let parentNode = node.parent;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
// Remove this utility from any caches
|
|
194
|
-
context.markInvalidUtilityNode(parentNode);
|
|
195
|
-
// Remove the CSS node from the markup
|
|
196
|
-
parentNode.remove();
|
|
197
|
-
// Show a warning
|
|
198
|
-
_log.default.warn("invalid-theme-key-in-class", [
|
|
106
|
+
let parentNode = node.parent, candidate = null === (_parentNode_raws_tailwind = null == parentNode ? void 0 : parentNode.raws.tailwind) || void 0 === _parentNode_raws_tailwind ? void 0 : _parentNode_raws_tailwind.candidate;
|
|
107
|
+
if (parentNode && void 0 !== candidate) {
|
|
108
|
+
context.markInvalidUtilityNode(parentNode), parentNode.remove(), _log.default.warn("invalid-theme-key-in-class", [
|
|
199
109
|
`The utility \`${candidate}\` contains an invalid theme value and was not generated.`
|
|
200
110
|
]);
|
|
201
111
|
return;
|
|
@@ -203,32 +113,35 @@ function _default(context) {
|
|
|
203
113
|
throw node.error(error);
|
|
204
114
|
}
|
|
205
115
|
let maybeColor = (0, _pluginUtils.parseColorFormat)(value);
|
|
206
|
-
|
|
207
|
-
if (alpha !== undefined || isColorFunction) {
|
|
208
|
-
if (alpha === undefined) {
|
|
209
|
-
alpha = 1.0;
|
|
210
|
-
}
|
|
211
|
-
value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor);
|
|
212
|
-
}
|
|
213
|
-
return value;
|
|
116
|
+
return (void 0 !== alpha || void 0 !== maybeColor && "function" == typeof maybeColor) && (void 0 === alpha && (alpha = 1.0), value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor)), value;
|
|
214
117
|
},
|
|
215
118
|
screen: (node, screen)=>{
|
|
216
119
|
screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, "");
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
if (!screenDefinition) {
|
|
220
|
-
throw node.error(`The '${screen}' screen does not exist in your theme.`);
|
|
221
|
-
}
|
|
120
|
+
let screenDefinition = (0, _normalizeScreens.normalizeScreens)(config.theme.screens).find(({ name })=>name === screen);
|
|
121
|
+
if (!screenDefinition) throw node.error(`The '${screen}' screen does not exist in your theme.`);
|
|
222
122
|
return (0, _buildMediaQuery.default)(screenDefinition);
|
|
223
123
|
}
|
|
224
124
|
};
|
|
225
125
|
return (root)=>{
|
|
226
126
|
root.walk((node)=>{
|
|
127
|
+
var input;
|
|
227
128
|
let property = nodeTypePropertyMap[node.type];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
129
|
+
void 0 !== property && (node[property] = (input = node[property], (0, _postcssValueParser.default)(input).walk((vNode)=>{
|
|
130
|
+
(function resolveVNode(node, vNode, functions) {
|
|
131
|
+
if ("function" === vNode.type && void 0 !== functions[vNode.value]) {
|
|
132
|
+
let args = function(node, vNodes, functions) {
|
|
133
|
+
vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions));
|
|
134
|
+
let args = [
|
|
135
|
+
""
|
|
136
|
+
];
|
|
137
|
+
for (let vNode of vNodes)"div" === vNode.type && "," === vNode.value ? args.push("") : args[args.length - 1] += _postcssValueParser.default.stringify(vNode);
|
|
138
|
+
return args;
|
|
139
|
+
}(node, vNode.nodes, functions);
|
|
140
|
+
vNode.type = "word", vNode.value = functions[vNode.value](node, ...args);
|
|
141
|
+
}
|
|
142
|
+
return vNode;
|
|
143
|
+
})(node, vNode, functions);
|
|
144
|
+
}).toString()));
|
|
232
145
|
});
|
|
233
146
|
};
|
|
234
147
|
}
|