tailwindcss 3.3.1 → 3.3.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.
- package/CHANGELOG.md +47 -6
- package/lib/cli/build/deps.js +17 -9
- package/lib/cli/build/index.js +10 -8
- package/lib/cli/build/plugin.js +29 -27
- package/lib/cli/build/utils.js +18 -8
- package/lib/cli/build/watching.js +12 -10
- package/lib/cli/help/index.js +6 -4
- package/lib/cli/index.js +4 -4
- package/lib/cli/init/index.js +8 -6
- package/lib/cli-peer-dependencies.js +12 -4
- package/lib/cli.js +1 -1
- package/lib/corePluginList.js +3 -1
- package/lib/corePlugins.js +52 -42
- package/lib/css/preflight.css +9 -0
- package/lib/featureFlags.js +14 -9
- package/lib/index.js +1 -5
- package/lib/lib/cacheInvalidation.js +7 -5
- package/lib/lib/collapseAdjacentRules.js +3 -1
- package/lib/lib/collapseDuplicateDeclarations.js +10 -8
- package/lib/lib/content.js +18 -14
- package/lib/lib/defaultExtractor.js +6 -4
- package/lib/lib/detectNesting.js +3 -1
- package/lib/lib/evaluateTailwindFunctions.js +20 -16
- package/lib/lib/expandApplyAtRules.js +37 -40
- package/lib/lib/expandTailwindAtRules.js +19 -17
- package/lib/lib/findAtConfigPath.js +6 -4
- package/lib/lib/generateRules.js +52 -38
- package/lib/lib/getModuleDependencies.js +10 -8
- package/lib/lib/load-config.js +5 -3
- package/lib/lib/normalizeTailwindDirectives.js +5 -3
- package/lib/lib/offsets.js +7 -5
- package/lib/lib/partitionApplyAtRules.js +3 -1
- package/lib/lib/regex.js +21 -7
- package/lib/lib/remap-bitfield.js +3 -1
- package/lib/lib/resolveDefaultsAtRules.js +24 -20
- package/lib/lib/setupContextUtils.js +91 -63
- package/lib/lib/setupTrackingContext.js +27 -24
- package/lib/lib/sharedState.js +28 -24
- package/lib/lib/substituteScreenAtRules.js +5 -3
- package/lib/oxide/cli/build/deps.js +16 -8
- package/lib/oxide/cli/build/index.js +6 -4
- package/lib/oxide/cli/build/plugin.js +19 -17
- package/lib/oxide/cli/build/utils.js +18 -8
- package/lib/oxide/cli/build/watching.js +10 -8
- package/lib/oxide/cli/help/index.js +6 -4
- package/lib/oxide/cli/index.js +4 -4
- package/lib/oxide/cli/init/index.js +6 -4
- package/lib/plugin.js +9 -9
- package/lib/postcss-plugins/nesting/index.js +3 -1
- package/lib/postcss-plugins/nesting/plugin.js +8 -6
- package/lib/processTailwindFeatures.js +16 -14
- package/lib/public/colors.js +5 -3
- package/lib/public/create-plugin.js +5 -3
- package/lib/public/default-config.js +6 -4
- package/lib/public/default-theme.js +6 -4
- package/lib/public/load-config.js +5 -3
- package/lib/public/resolve-config.js +6 -4
- package/lib/util/applyImportantSelector.js +9 -10
- package/lib/util/bigSign.js +3 -1
- package/lib/util/buildMediaQuery.js +3 -1
- package/lib/util/cloneDeep.js +3 -1
- package/lib/util/cloneNodes.js +3 -1
- package/lib/util/color.js +10 -6
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +3 -1
- package/lib/util/createPlugin.js +3 -1
- package/lib/util/createUtilityPlugin.js +5 -3
- package/lib/util/dataTypes.js +59 -21
- package/lib/util/defaults.js +6 -4
- package/lib/util/escapeClassName.js +7 -5
- package/lib/util/escapeCommas.js +3 -1
- package/lib/util/flattenColorPalette.js +3 -1
- package/lib/util/formatVariantSelector.js +30 -110
- package/lib/util/getAllConfigs.js +6 -4
- package/lib/util/hashConfig.js +6 -4
- package/lib/util/isKeyframeRule.js +3 -1
- package/lib/util/isPlainObject.js +3 -1
- package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
- package/lib/util/log.js +8 -4
- package/lib/util/nameClass.js +12 -6
- package/lib/util/negateValue.js +3 -1
- package/lib/util/normalizeConfig.js +7 -5
- package/lib/util/normalizeScreens.js +12 -4
- package/lib/util/parseAnimationValue.js +3 -1
- package/lib/util/parseBoxShadowValue.js +6 -2
- package/lib/util/parseDependency.js +3 -1
- package/lib/util/parseGlob.js +6 -4
- package/lib/util/parseObjectStyles.js +9 -7
- package/lib/util/pluginUtils.js +30 -18
- package/lib/util/prefixSelector.js +6 -4
- package/lib/util/pseudoElements.js +209 -0
- package/lib/util/removeAlphaVariables.js +3 -1
- package/lib/util/resolveConfig.js +10 -8
- package/lib/util/resolveConfigPath.js +9 -5
- package/lib/util/responsive.js +6 -4
- package/lib/util/splitAtTopLevelOnly.js +3 -1
- package/lib/util/tap.js +3 -1
- package/lib/util/toColorValue.js +3 -1
- package/lib/util/toPath.js +3 -1
- package/lib/util/transformThemeValue.js +6 -4
- package/lib/util/validateConfig.js +5 -3
- package/lib/util/validateFormalSyntax.js +3 -1
- package/lib/util/withAlphaVariable.js +6 -2
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/package.json +30 -35
- package/peers/index.js +65828 -48819
- package/src/cli/build/plugin.js +3 -3
- package/src/cli.js +1 -1
- package/src/corePlugins.js +29 -24
- package/src/css/preflight.css +9 -0
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/defaultExtractor.js +1 -1
- package/src/lib/evaluateTailwindFunctions.js +4 -1
- package/src/lib/expandApplyAtRules.js +2 -8
- package/src/lib/expandTailwindAtRules.js +12 -10
- package/src/lib/generateRules.js +15 -8
- package/src/lib/setupContextUtils.js +18 -5
- package/src/lib/setupTrackingContext.js +2 -4
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +4 -4
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/applyImportantSelector.js +2 -5
- package/src/util/color.js +1 -1
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +17 -6
- package/src/util/formatVariantSelector.js +4 -126
- package/src/util/pluginUtils.js +1 -5
- package/src/util/prefixSelector.js +1 -0
- package/src/util/pseudoElements.js +167 -0
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/config.full.js +1 -0
- package/types/generated/default-theme.d.ts +1 -0
package/lib/util/createPlugin.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return createUtilityPlugin;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _transformThemeValue = /*#__PURE__*/
|
|
10
|
-
function
|
|
11
|
+
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./transformThemeValue"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
package/lib/util/dataTypes.js
CHANGED
|
@@ -9,21 +9,51 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
normalize: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
normalize: function() {
|
|
13
|
+
return normalize;
|
|
14
|
+
},
|
|
15
|
+
url: function() {
|
|
16
|
+
return url;
|
|
17
|
+
},
|
|
18
|
+
number: function() {
|
|
19
|
+
return number;
|
|
20
|
+
},
|
|
21
|
+
percentage: function() {
|
|
22
|
+
return percentage;
|
|
23
|
+
},
|
|
24
|
+
length: function() {
|
|
25
|
+
return length;
|
|
26
|
+
},
|
|
27
|
+
lineWidth: function() {
|
|
28
|
+
return lineWidth;
|
|
29
|
+
},
|
|
30
|
+
shadow: function() {
|
|
31
|
+
return shadow;
|
|
32
|
+
},
|
|
33
|
+
color: function() {
|
|
34
|
+
return color;
|
|
35
|
+
},
|
|
36
|
+
image: function() {
|
|
37
|
+
return image;
|
|
38
|
+
},
|
|
39
|
+
gradient: function() {
|
|
40
|
+
return gradient;
|
|
41
|
+
},
|
|
42
|
+
position: function() {
|
|
43
|
+
return position;
|
|
44
|
+
},
|
|
45
|
+
familyName: function() {
|
|
46
|
+
return familyName;
|
|
47
|
+
},
|
|
48
|
+
genericName: function() {
|
|
49
|
+
return genericName;
|
|
50
|
+
},
|
|
51
|
+
absoluteSize: function() {
|
|
52
|
+
return absoluteSize;
|
|
53
|
+
},
|
|
54
|
+
relativeSize: function() {
|
|
55
|
+
return relativeSize;
|
|
56
|
+
}
|
|
27
57
|
});
|
|
28
58
|
const _color = require("./color");
|
|
29
59
|
const _parseBoxShadowValue = require("./parseBoxShadowValue");
|
|
@@ -59,16 +89,23 @@ function normalize(value, isRoot = true) {
|
|
|
59
89
|
if (isRoot) {
|
|
60
90
|
value = value.trim();
|
|
61
91
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
92
|
+
value = normalizeMathOperatorSpacing(value);
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Add spaces around operators inside math functions
|
|
97
|
+
* like calc() that do not follow an operator or '('.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} value
|
|
100
|
+
* @returns {string}
|
|
101
|
+
*/ function normalizeMathOperatorSpacing(value) {
|
|
102
|
+
return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
|
65
103
|
let vars = [];
|
|
66
104
|
return match.replace(/var\((--.+?)[,)]/g, (match, g1)=>{
|
|
67
105
|
vars.push(g1);
|
|
68
106
|
return match.replace(g1, placeholder);
|
|
69
107
|
}).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(placeholderRe, ()=>vars.shift());
|
|
70
108
|
});
|
|
71
|
-
return value;
|
|
72
109
|
}
|
|
73
110
|
function url(value) {
|
|
74
111
|
return value.startsWith("url(");
|
|
@@ -169,11 +206,12 @@ function image(value) {
|
|
|
169
206
|
return images > 0;
|
|
170
207
|
}
|
|
171
208
|
let gradientTypes = new Set([
|
|
209
|
+
"conic-gradient",
|
|
172
210
|
"linear-gradient",
|
|
173
211
|
"radial-gradient",
|
|
212
|
+
"repeating-conic-gradient",
|
|
174
213
|
"repeating-linear-gradient",
|
|
175
|
-
"repeating-radial-gradient"
|
|
176
|
-
"conic-gradient"
|
|
214
|
+
"repeating-radial-gradient"
|
|
177
215
|
]);
|
|
178
216
|
function gradient(value) {
|
|
179
217
|
value = normalize(value);
|
package/lib/util/defaults.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "defaults", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return defaults;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function defaults(target, ...sources) {
|
|
10
12
|
for (let source of sources){
|
|
@@ -14,10 +16,10 @@ function defaults(target, ...sources) {
|
|
|
14
16
|
target[k] = source[k];
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
for (let
|
|
19
|
+
for (let k of Object.getOwnPropertySymbols(source)){
|
|
18
20
|
var _target_hasOwnProperty1;
|
|
19
|
-
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target,
|
|
20
|
-
target[
|
|
21
|
+
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
|
|
22
|
+
target[k] = source[k];
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return escapeClassName;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _escapeCommas = /*#__PURE__*/
|
|
11
|
-
function
|
|
11
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
12
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
function escapeClassName(className) {
|
|
17
19
|
var _node_raws;
|
|
18
|
-
let node =
|
|
20
|
+
let node = _postcssselectorparser.default.className();
|
|
19
21
|
node.value = className;
|
|
20
22
|
var _node_raws_value;
|
|
21
23
|
return (0, _escapeCommas.default)((_node_raws_value = node === null || node === void 0 ? void 0 : (_node_raws = node.raws) === null || _node_raws === void 0 ? void 0 : _node_raws.value) !== null && _node_raws_value !== void 0 ? _node_raws_value : node.value);
|
package/lib/util/escapeCommas.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return escapeCommas;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function escapeCommas(className) {
|
|
10
12
|
return className.replace(/\\,/g, "\\2c ");
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
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
12
|
[color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
|
|
@@ -9,40 +9,47 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
formatVariantSelector: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
formatVariantSelector: function() {
|
|
13
|
+
return formatVariantSelector;
|
|
14
|
+
},
|
|
15
|
+
eliminateIrrelevantSelectors: function() {
|
|
16
|
+
return eliminateIrrelevantSelectors;
|
|
17
|
+
},
|
|
18
|
+
finalizeSelector: function() {
|
|
19
|
+
return finalizeSelector;
|
|
20
|
+
},
|
|
21
|
+
handleMergePseudo: function() {
|
|
22
|
+
return handleMergePseudo;
|
|
23
|
+
}
|
|
18
24
|
});
|
|
19
|
-
const
|
|
20
|
-
const _unesc = /*#__PURE__*/
|
|
21
|
-
const _escapeClassName = /*#__PURE__*/
|
|
22
|
-
const _prefixSelector = /*#__PURE__*/
|
|
23
|
-
|
|
25
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
26
|
+
const _unesc = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser/dist/util/unesc"));
|
|
27
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
|
|
28
|
+
const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
|
|
29
|
+
const _pseudoElements = require("./pseudoElements");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
24
31
|
return obj && obj.__esModule ? obj : {
|
|
25
32
|
default: obj
|
|
26
33
|
};
|
|
27
34
|
}
|
|
28
|
-
/** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ /** @typedef {{format: string,
|
|
35
|
+
/** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ /** @typedef {{format: string, respectPrefix: boolean}[]} RawFormats */ /** @typedef {import('postcss-selector-parser').Root} ParsedFormats */ /** @typedef {RawFormats | ParsedFormats} AcceptedFormats */ let MERGE = ":merge";
|
|
29
36
|
function formatVariantSelector(formats, { context , candidate }) {
|
|
30
37
|
var _context_tailwindConfig_prefix;
|
|
31
38
|
let prefix = (_context_tailwindConfig_prefix = context === null || context === void 0 ? void 0 : context.tailwindConfig.prefix) !== null && _context_tailwindConfig_prefix !== void 0 ? _context_tailwindConfig_prefix : "";
|
|
32
39
|
// Parse the format selector into an AST
|
|
33
40
|
let parsedFormats = formats.map((format)=>{
|
|
34
|
-
let ast = (0,
|
|
41
|
+
let ast = (0, _postcssselectorparser.default)().astSync(format.format);
|
|
35
42
|
return {
|
|
36
43
|
...format,
|
|
37
|
-
ast: format.
|
|
44
|
+
ast: format.respectPrefix ? (0, _prefixSelector.default)(prefix, ast) : ast
|
|
38
45
|
};
|
|
39
46
|
});
|
|
40
47
|
// We start with the candidate selector
|
|
41
|
-
let formatAst =
|
|
48
|
+
let formatAst = _postcssselectorparser.default.root({
|
|
42
49
|
nodes: [
|
|
43
|
-
|
|
50
|
+
_postcssselectorparser.default.selector({
|
|
44
51
|
nodes: [
|
|
45
|
-
|
|
52
|
+
_postcssselectorparser.default.className({
|
|
46
53
|
value: (0, _escapeClassName.default)(candidate)
|
|
47
54
|
})
|
|
48
55
|
]
|
|
@@ -133,7 +140,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
133
140
|
//
|
|
134
141
|
base = base !== null && base !== void 0 ? base : candidate.split(new RegExp(`\\${separator}(?![^[]*\\])`)).pop();
|
|
135
142
|
// Parse the selector into an AST
|
|
136
|
-
let selector = (0,
|
|
143
|
+
let selector = (0, _postcssselectorparser.default)().astSync(current);
|
|
137
144
|
// Normalize escaped classes, e.g.:
|
|
138
145
|
//
|
|
139
146
|
// The idea would be to replace the escaped `base` in the selector with the
|
|
@@ -161,10 +168,10 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
161
168
|
if (formatAst === null) {
|
|
162
169
|
return selector.toString();
|
|
163
170
|
}
|
|
164
|
-
let simpleStart =
|
|
171
|
+
let simpleStart = _postcssselectorparser.default.comment({
|
|
165
172
|
value: "/*__simple__*/"
|
|
166
173
|
});
|
|
167
|
-
let simpleEnd =
|
|
174
|
+
let simpleEnd = _postcssselectorparser.default.comment({
|
|
168
175
|
value: "/*__simple__*/"
|
|
169
176
|
});
|
|
170
177
|
// We can safely replace the escaped base now, since the `base` section is
|
|
@@ -190,7 +197,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
190
197
|
// Re-sort the simple selector to ensure it's in the correct order
|
|
191
198
|
simpleSelector = simpleSelectorForNode(simpleStart);
|
|
192
199
|
let firstNode = parent.index(simpleStart);
|
|
193
|
-
parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(
|
|
200
|
+
parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(_postcssselectorparser.default.selector({
|
|
194
201
|
nodes: simpleSelector
|
|
195
202
|
})).nodes);
|
|
196
203
|
simpleStart.remove();
|
|
@@ -203,12 +210,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
203
210
|
}
|
|
204
211
|
});
|
|
205
212
|
// Move pseudo elements to the end of the selector (if necessary)
|
|
206
|
-
selector.each((sel)=>
|
|
207
|
-
let [pseudoElements] = collectPseudoElements(sel);
|
|
208
|
-
if (pseudoElements.length > 0) {
|
|
209
|
-
sel.nodes.push(...pseudoElements.sort(sortSelector));
|
|
210
|
-
}
|
|
211
|
-
});
|
|
213
|
+
selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
|
|
212
214
|
return selector.toString();
|
|
213
215
|
}
|
|
214
216
|
function handleMergePseudo(selector, format) {
|
|
@@ -242,7 +244,7 @@ function handleMergePseudo(selector, format) {
|
|
|
242
244
|
next = next.next();
|
|
243
245
|
}
|
|
244
246
|
let combinator = next;
|
|
245
|
-
existing.pseudo.parent.insertAfter(existing.pseudo,
|
|
247
|
+
existing.pseudo.parent.insertAfter(existing.pseudo, _postcssselectorparser.default.selector({
|
|
246
248
|
nodes: attachments.map((node)=>node.clone())
|
|
247
249
|
}));
|
|
248
250
|
pseudo.remove();
|
|
@@ -259,85 +261,3 @@ function handleMergePseudo(selector, format) {
|
|
|
259
261
|
format
|
|
260
262
|
];
|
|
261
263
|
}
|
|
262
|
-
// Note: As a rule, double colons (::) should be used instead of a single colon
|
|
263
|
-
// (:). This distinguishes pseudo-classes from pseudo-elements. However, since
|
|
264
|
-
// this distinction was not present in older versions of the W3C spec, most
|
|
265
|
-
// browsers support both syntaxes for the original pseudo-elements.
|
|
266
|
-
let pseudoElementsBC = [
|
|
267
|
-
":before",
|
|
268
|
-
":after",
|
|
269
|
-
":first-line",
|
|
270
|
-
":first-letter"
|
|
271
|
-
];
|
|
272
|
-
// These pseudo-elements _can_ be combined with other pseudo selectors AND the order does matter.
|
|
273
|
-
let pseudoElementExceptions = [
|
|
274
|
-
"::file-selector-button",
|
|
275
|
-
// Webkit scroll bar pseudo elements can be combined with user-action pseudo classes
|
|
276
|
-
"::-webkit-scrollbar",
|
|
277
|
-
"::-webkit-scrollbar-button",
|
|
278
|
-
"::-webkit-scrollbar-thumb",
|
|
279
|
-
"::-webkit-scrollbar-track",
|
|
280
|
-
"::-webkit-scrollbar-track-piece",
|
|
281
|
-
"::-webkit-scrollbar-corner",
|
|
282
|
-
"::-webkit-resizer"
|
|
283
|
-
];
|
|
284
|
-
function collectPseudoElements(selector, force = false) {
|
|
285
|
-
/** @type {Node[]} */ let nodes = [];
|
|
286
|
-
let seenPseudoElement = null;
|
|
287
|
-
for (let node of [
|
|
288
|
-
...selector.nodes
|
|
289
|
-
]){
|
|
290
|
-
if (isPseudoElement(node, force)) {
|
|
291
|
-
nodes.push(node);
|
|
292
|
-
selector.removeChild(node);
|
|
293
|
-
seenPseudoElement = node.value;
|
|
294
|
-
} else if (seenPseudoElement !== null) {
|
|
295
|
-
if (pseudoElementExceptions.includes(seenPseudoElement) && isPseudoClass(node, force)) {
|
|
296
|
-
nodes.push(node);
|
|
297
|
-
selector.removeChild(node);
|
|
298
|
-
} else {
|
|
299
|
-
seenPseudoElement = null;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
if (node === null || node === void 0 ? void 0 : node.nodes) {
|
|
303
|
-
let hasPseudoElementRestrictions = node.type === "pseudo" && (node.value === ":is" || node.value === ":has");
|
|
304
|
-
let [collected, seenPseudoElementInSelector] = collectPseudoElements(node, force || hasPseudoElementRestrictions);
|
|
305
|
-
if (seenPseudoElementInSelector) {
|
|
306
|
-
seenPseudoElement = seenPseudoElementInSelector;
|
|
307
|
-
}
|
|
308
|
-
nodes.push(...collected);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
return [
|
|
312
|
-
nodes,
|
|
313
|
-
seenPseudoElement
|
|
314
|
-
];
|
|
315
|
-
}
|
|
316
|
-
function sortSelector(a, z) {
|
|
317
|
-
// Both nodes are non-pseudo's so we can safely ignore them and keep
|
|
318
|
-
// them in the same order.
|
|
319
|
-
if (a.type !== "pseudo" && z.type !== "pseudo") {
|
|
320
|
-
return 0;
|
|
321
|
-
}
|
|
322
|
-
// If one of them is a combinator, we need to keep it in the same order
|
|
323
|
-
// because that means it will start a new "section" in the selector.
|
|
324
|
-
if (a.type === "combinator" ^ z.type === "combinator") {
|
|
325
|
-
return 0;
|
|
326
|
-
}
|
|
327
|
-
// One of the items is a pseudo and the other one isn't. Let's move
|
|
328
|
-
// the pseudo to the right.
|
|
329
|
-
if (a.type === "pseudo" ^ z.type === "pseudo") {
|
|
330
|
-
return (a.type === "pseudo") - (z.type === "pseudo");
|
|
331
|
-
}
|
|
332
|
-
// Both are pseudo's, move the pseudo elements (except for
|
|
333
|
-
// ::file-selector-button) to the right.
|
|
334
|
-
return isPseudoElement(a) - isPseudoElement(z);
|
|
335
|
-
}
|
|
336
|
-
function isPseudoElement(node, force = false) {
|
|
337
|
-
if (node.type !== "pseudo") return false;
|
|
338
|
-
if (pseudoElementExceptions.includes(node.value) && !force) return false;
|
|
339
|
-
return node.value.startsWith("::") || pseudoElementsBC.includes(node.value);
|
|
340
|
-
}
|
|
341
|
-
function isPseudoClass(node, force) {
|
|
342
|
-
return node.type === "pseudo" && !isPseudoElement(node, force);
|
|
343
|
-
}
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getAllConfigs;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
|
|
10
12
|
const _featureFlags = require("../featureFlags");
|
|
11
|
-
function
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -16,7 +18,7 @@ function _interopRequireDefault(obj) {
|
|
|
16
18
|
function getAllConfigs(config) {
|
|
17
19
|
var _config_presets;
|
|
18
20
|
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
|
|
19
|
-
|
|
21
|
+
_configfull.default
|
|
20
22
|
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
|
21
23
|
const features = {
|
|
22
24
|
// Add experimental configs here...
|
package/lib/util/hashConfig.js
CHANGED
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return hashConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
+
const _objecthash = /*#__PURE__*/ _interop_require_default(require("object-hash"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function hashConfig(config) {
|
|
16
|
-
return (0,
|
|
18
|
+
return (0, _objecthash.default)(config, {
|
|
17
19
|
ignoreUnknown: true
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return isKeyframeRule;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isKeyframeRule(rule) {
|
|
10
12
|
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return isPlainObject;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isPlainObject(value) {
|
|
10
12
|
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
|
@@ -10,7 +10,9 @@ Object.defineProperty(exports, // Arbitrary values must contain balanced bracket
|
|
|
10
10
|
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
|
11
11
|
"default", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: ()
|
|
13
|
+
get: function() {
|
|
14
|
+
return isSyntacticallyValidPropertyValue;
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
let matchingBrackets = new Map([
|
|
16
18
|
[
|
package/lib/util/log.js
CHANGED
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
dim: ()
|
|
13
|
-
|
|
12
|
+
dim: function() {
|
|
13
|
+
return dim;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const _picocolors = /*#__PURE__*/
|
|
16
|
-
function
|
|
19
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
20
|
+
function _interop_require_default(obj) {
|
|
17
21
|
return obj && obj.__esModule ? obj : {
|
|
18
22
|
default: obj
|
|
19
23
|
};
|
package/lib/util/nameClass.js
CHANGED
|
@@ -9,13 +9,19 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
asClass: ()
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
asClass: function() {
|
|
13
|
+
return asClass;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return nameClass;
|
|
17
|
+
},
|
|
18
|
+
formatClass: function() {
|
|
19
|
+
return formatClass;
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
|
-
const _escapeClassName = /*#__PURE__*/
|
|
17
|
-
const _escapeCommas = /*#__PURE__*/
|
|
18
|
-
function
|
|
22
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
|
|
23
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
19
25
|
return obj && obj.__esModule ? obj : {
|
|
20
26
|
default: obj
|
|
21
27
|
};
|
package/lib/util/negateValue.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "normalizeConfig", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return normalizeConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _featureFlags = require("../featureFlags");
|
|
10
|
-
const _log = /*#__PURE__*/
|
|
12
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
12
14
|
if (typeof WeakMap !== "function") return null;
|
|
13
15
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -16,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
16
18
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
17
19
|
})(nodeInterop);
|
|
18
20
|
}
|
|
19
|
-
function
|
|
21
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
20
22
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
21
23
|
return obj;
|
|
22
24
|
}
|
|
@@ -129,8 +131,8 @@ function normalizeConfig(config) {
|
|
|
129
131
|
}
|
|
130
132
|
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
|
131
133
|
if (typeof config.content.transform === "object") {
|
|
132
|
-
for (let
|
|
133
|
-
if (typeof
|
|
134
|
+
for (let value of Object.values(config.content.transform)){
|
|
135
|
+
if (typeof value !== "function") {
|
|
134
136
|
return false;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -33,10 +33,18 @@ function _export(target, all) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
_export(exports, {
|
|
36
|
-
normalizeScreens: ()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
normalizeScreens: function() {
|
|
37
|
+
return normalizeScreens;
|
|
38
|
+
},
|
|
39
|
+
isScreenSortable: function() {
|
|
40
|
+
return isScreenSortable;
|
|
41
|
+
},
|
|
42
|
+
compareScreens: function() {
|
|
43
|
+
return compareScreens;
|
|
44
|
+
},
|
|
45
|
+
toScreen: function() {
|
|
46
|
+
return toScreen;
|
|
47
|
+
}
|
|
40
48
|
});
|
|
41
49
|
function normalizeScreens(screens, root = true) {
|
|
42
50
|
if (Array.isArray(screens)) {
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
parseBoxShadowValue: ()
|
|
13
|
-
|
|
12
|
+
parseBoxShadowValue: function() {
|
|
13
|
+
return parseBoxShadowValue;
|
|
14
|
+
},
|
|
15
|
+
formatBoxShadowValue: function() {
|
|
16
|
+
return formatBoxShadowValue;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
16
20
|
let KEYWORDS = new Set([
|