tailwindcss 0.0.0-insiders.dddaded → 0.0.0-insiders.de00a62
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 +17 -9
- package/lib/cli/build/index.js +10 -8
- package/lib/cli/build/plugin.js +31 -29
- package/lib/cli/build/utils.js +18 -8
- package/lib/cli/build/watching.js +13 -11
- 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 +8 -2
- package/lib/corePlugins.js +211 -48
- package/lib/css/preflight.css +24 -8
- 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 +51 -14
- package/lib/lib/defaultExtractor.js +38 -28
- package/lib/lib/detectNesting.js +3 -1
- package/lib/lib/evaluateTailwindFunctions.js +20 -16
- package/lib/lib/expandApplyAtRules.js +41 -33
- package/lib/lib/expandTailwindAtRules.js +38 -19
- package/lib/lib/findAtConfigPath.js +6 -4
- package/lib/lib/generateRules.js +83 -55
- package/lib/lib/getModuleDependencies.js +10 -8
- package/lib/lib/load-config.js +18 -5
- package/lib/lib/normalizeTailwindDirectives.js +5 -3
- package/lib/lib/offsets.js +58 -7
- 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 +27 -21
- package/lib/lib/setupContextUtils.js +143 -94
- 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 +25 -23
- 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 +7 -5
- 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 +36 -14
- package/lib/util/color.js +11 -7
- 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 +180 -31
- 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 +36 -21
- 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 +4 -2
- 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 +43 -18
- package/lib/util/prefixSelector.js +6 -4
- package/lib/util/pseudoElements.js +24 -35
- 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/nesting/index.d.ts +4 -0
- package/package.json +31 -36
- package/peers/index.js +65266 -48224
- package/resolveConfig.d.ts +22 -3
- package/scripts/generate-types.js +1 -2
- package/src/cli/build/plugin.js +7 -7
- package/src/cli/build/watching.js +1 -1
- package/src/cli.js +1 -1
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +165 -29
- package/src/css/preflight.css +24 -8
- package/src/featureFlags.js +3 -8
- package/src/index.js +1 -5
- package/src/lib/content.js +42 -1
- package/src/lib/defaultExtractor.js +30 -17
- package/src/lib/evaluateTailwindFunctions.js +4 -1
- package/src/lib/expandApplyAtRules.js +7 -0
- package/src/lib/expandTailwindAtRules.js +26 -9
- package/src/lib/generateRules.js +50 -26
- package/src/lib/load-config.ts +8 -0
- package/src/lib/offsets.js +61 -2
- package/src/lib/resolveDefaultsAtRules.js +5 -1
- package/src/lib/setupContextUtils.js +77 -38
- package/src/lib/setupTrackingContext.js +2 -4
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +7 -7
- package/src/plugin.js +4 -4
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/cloneNodes.js +35 -14
- package/src/util/color.js +2 -2
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +143 -18
- package/src/util/formatVariantSelector.js +11 -3
- package/src/util/isPlainObject.js +1 -1
- package/src/util/pluginUtils.js +17 -5
- package/src/util/prefixSelector.js +1 -0
- package/src/util/pseudoElements.js +18 -17
- 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 +86 -14
- package/types/config.d.ts +17 -9
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +35 -9
- package/types/index.d.ts +7 -3
package/lib/lib/offsets.js
CHANGED
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Offsets", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: ()
|
|
8
|
+
get: function() {
|
|
9
|
+
return Offsets;
|
|
10
|
+
}
|
|
9
11
|
});
|
|
10
|
-
const _bigSign = /*#__PURE__*/
|
|
11
|
-
const
|
|
12
|
-
function
|
|
12
|
+
const _bigSign = /*#__PURE__*/ _interop_require_default(require("../util/bigSign"));
|
|
13
|
+
const _remapbitfield = require("./remap-bitfield.js");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
13
15
|
return obj && obj.__esModule ? obj : {
|
|
14
16
|
default: obj
|
|
15
17
|
};
|
|
@@ -64,15 +66,19 @@ class Offsets {
|
|
|
64
66
|
variants: 0n,
|
|
65
67
|
parallelIndex: 0n,
|
|
66
68
|
index: this.offsets[layer]++,
|
|
69
|
+
propertyOffset: 0n,
|
|
70
|
+
property: "",
|
|
67
71
|
options: []
|
|
68
72
|
};
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
75
|
+
* @param {string} name
|
|
71
76
|
* @returns {RuleOffset}
|
|
72
|
-
*/ arbitraryProperty() {
|
|
77
|
+
*/ arbitraryProperty(name) {
|
|
73
78
|
return {
|
|
74
79
|
...this.create("utilities"),
|
|
75
|
-
arbitrary: 1n
|
|
80
|
+
arbitrary: 1n,
|
|
81
|
+
property: name
|
|
76
82
|
};
|
|
77
83
|
}
|
|
78
84
|
/**
|
|
@@ -212,6 +218,10 @@ class Offsets {
|
|
|
212
218
|
if (a.arbitrary !== b.arbitrary) {
|
|
213
219
|
return a.arbitrary - b.arbitrary;
|
|
214
220
|
}
|
|
221
|
+
// Always sort arbitrary properties alphabetically
|
|
222
|
+
if (a.propertyOffset !== b.propertyOffset) {
|
|
223
|
+
return a.propertyOffset - b.propertyOffset;
|
|
224
|
+
}
|
|
215
225
|
// Sort utilities, components, etc… in the order they were registered
|
|
216
226
|
return a.index - b.index;
|
|
217
227
|
}
|
|
@@ -253,7 +263,45 @@ class Offsets {
|
|
|
253
263
|
let [offset, rule] = item;
|
|
254
264
|
offset = {
|
|
255
265
|
...offset,
|
|
256
|
-
variants: (0,
|
|
266
|
+
variants: (0, _remapbitfield.remapBitfield)(offset.variants, mapping)
|
|
267
|
+
};
|
|
268
|
+
return [
|
|
269
|
+
offset,
|
|
270
|
+
rule
|
|
271
|
+
];
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* @template T
|
|
276
|
+
* @param {[RuleOffset, T][]} list
|
|
277
|
+
* @returns {[RuleOffset, T][]}
|
|
278
|
+
*/ sortArbitraryProperties(list) {
|
|
279
|
+
// Collect all known arbitrary properties
|
|
280
|
+
let known = new Set();
|
|
281
|
+
for (let [offset] of list){
|
|
282
|
+
if (offset.arbitrary === 1n) {
|
|
283
|
+
known.add(offset.property);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// No arbitrary properties? Nothing to do.
|
|
287
|
+
if (known.size === 0) {
|
|
288
|
+
return list;
|
|
289
|
+
}
|
|
290
|
+
// Sort the properties alphabetically
|
|
291
|
+
let properties = Array.from(known).sort();
|
|
292
|
+
// Create a map from the property name to its offset
|
|
293
|
+
let offsets = new Map();
|
|
294
|
+
let offset = 1n;
|
|
295
|
+
for (let property of properties){
|
|
296
|
+
offsets.set(property, offset++);
|
|
297
|
+
}
|
|
298
|
+
// Apply the sorted offsets to the list
|
|
299
|
+
return list.map((item)=>{
|
|
300
|
+
let [offset, rule] = item;
|
|
301
|
+
var _offsets_get;
|
|
302
|
+
offset = {
|
|
303
|
+
...offset,
|
|
304
|
+
propertyOffset: (_offsets_get = offsets.get(offset.property)) !== null && _offsets_get !== void 0 ? _offsets_get : 0n
|
|
257
305
|
};
|
|
258
306
|
return [
|
|
259
307
|
offset,
|
|
@@ -266,7 +314,10 @@ class Offsets {
|
|
|
266
314
|
* @param {[RuleOffset, T][]} list
|
|
267
315
|
* @returns {[RuleOffset, T][]}
|
|
268
316
|
*/ sort(list) {
|
|
317
|
+
// Sort arbitrary variants so they're in alphabetical order
|
|
269
318
|
list = this.remapArbitraryVariantOffsets(list);
|
|
319
|
+
// Sort arbitrary properties so they're in alphabetical order
|
|
320
|
+
list = this.sortArbitraryProperties(list);
|
|
270
321
|
return list.sort(([a], [b])=>(0, _bigSign.default)(this.compare(a, b)));
|
|
271
322
|
}
|
|
272
323
|
}
|
|
@@ -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 expandApplyAtRules;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function partitionRules(root) {
|
|
10
12
|
if (!root.walkAtRules) return;
|
package/lib/lib/regex.js
CHANGED
|
@@ -9,13 +9,27 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
pattern: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
pattern: function() {
|
|
13
|
+
return pattern;
|
|
14
|
+
},
|
|
15
|
+
withoutCapturing: function() {
|
|
16
|
+
return withoutCapturing;
|
|
17
|
+
},
|
|
18
|
+
any: function() {
|
|
19
|
+
return any;
|
|
20
|
+
},
|
|
21
|
+
optional: function() {
|
|
22
|
+
return optional;
|
|
23
|
+
},
|
|
24
|
+
zeroOrMore: function() {
|
|
25
|
+
return zeroOrMore;
|
|
26
|
+
},
|
|
27
|
+
nestedBrackets: function() {
|
|
28
|
+
return nestedBrackets;
|
|
29
|
+
},
|
|
30
|
+
escape: function() {
|
|
31
|
+
return escape;
|
|
32
|
+
}
|
|
19
33
|
});
|
|
20
34
|
const REGEX_SPECIAL = /[\\^$.*+?()[\]{}|]/g;
|
|
21
35
|
const REGEX_HAS_SPECIAL = RegExp(REGEX_SPECIAL.source);
|
|
@@ -69,7 +69,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "remapBitfield", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: ()
|
|
72
|
+
get: function() {
|
|
73
|
+
return remapBitfield;
|
|
74
|
+
}
|
|
73
75
|
});
|
|
74
76
|
function remapBitfield(num, mapping) {
|
|
75
77
|
// Create masks for the old and new bits that are set
|
|
@@ -9,20 +9,24 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
elementSelectorParser: ()
|
|
13
|
-
|
|
12
|
+
elementSelectorParser: function() {
|
|
13
|
+
return elementSelectorParser;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return resolveDefaultsAtRules;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const _postcss = /*#__PURE__*/
|
|
16
|
-
const
|
|
19
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
20
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
17
21
|
const _featureFlags = require("../featureFlags");
|
|
18
|
-
function
|
|
22
|
+
function _interop_require_default(obj) {
|
|
19
23
|
return obj && obj.__esModule ? obj : {
|
|
20
24
|
default: obj
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
let getNode = {
|
|
24
28
|
id (node) {
|
|
25
|
-
return
|
|
29
|
+
return _postcssselectorparser.default.attribute({
|
|
26
30
|
attribute: "id",
|
|
27
31
|
operator: "=",
|
|
28
32
|
value: node.value,
|
|
@@ -60,14 +64,14 @@ function minimumImpactSelector(nodes) {
|
|
|
60
64
|
let combinatorIdx = rest.findIndex((n)=>n.type === "combinator" && n.value === ">");
|
|
61
65
|
if (combinatorIdx !== -1) {
|
|
62
66
|
rest.splice(0, combinatorIdx);
|
|
63
|
-
rest.unshift(
|
|
67
|
+
rest.unshift(_postcssselectorparser.default.universal());
|
|
64
68
|
}
|
|
65
69
|
return [
|
|
66
70
|
bestNode,
|
|
67
71
|
...rest.reverse()
|
|
68
72
|
].join("").trim();
|
|
69
73
|
}
|
|
70
|
-
let elementSelectorParser = (0,
|
|
74
|
+
let elementSelectorParser = (0, _postcssselectorparser.default)((selectors)=>{
|
|
71
75
|
return selectors.map((s)=>{
|
|
72
76
|
let nodes = s.split((n)=>n.type === "combinator" && n.value === " ").pop();
|
|
73
77
|
return minimumImpactSelector(nodes);
|
|
@@ -107,7 +111,9 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
|
|
|
107
111
|
// we consider them separately because merging the declarations into
|
|
108
112
|
// a single rule will cause browsers that do not understand the
|
|
109
113
|
// vendor prefix to throw out the whole rule
|
|
110
|
-
|
|
114
|
+
// Additionally if a selector contains `:has` we also consider
|
|
115
|
+
// it separately because FF only recently gained support for it
|
|
116
|
+
let selectorGroupName = selector.includes(":-") || selector.includes("::-") || selector.includes(":has") ? selector : "__DEFAULT__";
|
|
111
117
|
var _selectorGroups_get;
|
|
112
118
|
let selectors = (_selectorGroups_get = selectorGroups.get(selectorGroupName)) !== null && _selectorGroups_get !== void 0 ? _selectorGroups_get : new Set();
|
|
113
119
|
selectorGroups.set(selectorGroupName, selectors);
|
|
@@ -119,12 +125,12 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
|
|
|
119
125
|
universal.remove();
|
|
120
126
|
continue;
|
|
121
127
|
}
|
|
122
|
-
for (let [,
|
|
128
|
+
for (let [, selectors] of selectorGroups){
|
|
123
129
|
let universalRule = _postcss.default.rule({
|
|
124
130
|
source: universal.source
|
|
125
131
|
});
|
|
126
132
|
universalRule.selectors = [
|
|
127
|
-
...
|
|
133
|
+
...selectors
|
|
128
134
|
];
|
|
129
135
|
universalRule.append(universal.nodes.map((node)=>node.clone()));
|
|
130
136
|
universal.before(universalRule);
|
|
@@ -133,29 +139,29 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
|
|
|
133
139
|
universal.remove();
|
|
134
140
|
}
|
|
135
141
|
} else if (universals.size) {
|
|
136
|
-
let
|
|
142
|
+
let universalRule = _postcss.default.rule({
|
|
137
143
|
selectors: [
|
|
138
144
|
"*",
|
|
139
145
|
"::before",
|
|
140
146
|
"::after"
|
|
141
147
|
]
|
|
142
148
|
});
|
|
143
|
-
for (let
|
|
144
|
-
|
|
145
|
-
if (!
|
|
146
|
-
|
|
149
|
+
for (let universal of universals){
|
|
150
|
+
universalRule.append(universal.nodes);
|
|
151
|
+
if (!universalRule.parent) {
|
|
152
|
+
universal.before(universalRule);
|
|
147
153
|
}
|
|
148
|
-
if (!
|
|
149
|
-
|
|
154
|
+
if (!universalRule.source) {
|
|
155
|
+
universalRule.source = universal.source;
|
|
150
156
|
}
|
|
151
|
-
|
|
157
|
+
universal.remove();
|
|
152
158
|
}
|
|
153
|
-
let backdropRule =
|
|
159
|
+
let backdropRule = universalRule.clone({
|
|
154
160
|
selectors: [
|
|
155
161
|
"::backdrop"
|
|
156
162
|
]
|
|
157
163
|
});
|
|
158
|
-
|
|
164
|
+
universalRule.after(backdropRule);
|
|
159
165
|
}
|
|
160
166
|
};
|
|
161
167
|
}
|