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.
Files changed (112) hide show
  1. package/lib/cli/build/deps.js +10 -18
  2. package/lib/cli/build/index.js +10 -41
  3. package/lib/cli/build/plugin.js +87 -268
  4. package/lib/cli/build/utils.js +18 -40
  5. package/lib/cli/build/watching.js +35 -151
  6. package/lib/cli/help/index.js +15 -58
  7. package/lib/cli/index.js +61 -120
  8. package/lib/cli/init/index.js +21 -43
  9. package/lib/cli-peer-dependencies.js +13 -15
  10. package/lib/cli.js +1 -5
  11. package/lib/corePluginList.js +3 -4
  12. package/lib/corePlugins.js +394 -857
  13. package/lib/featureFlags.js +14 -34
  14. package/lib/index.js +1 -5
  15. package/lib/lib/cacheInvalidation.js +29 -75
  16. package/lib/lib/collapseAdjacentRules.js +22 -43
  17. package/lib/lib/collapseDuplicateDeclarations.js +27 -68
  18. package/lib/lib/content.js +37 -126
  19. package/lib/lib/defaultExtractor.js +96 -199
  20. package/lib/lib/detectNesting.js +12 -36
  21. package/lib/lib/evaluateTailwindFunctions.js +101 -188
  22. package/lib/lib/expandApplyAtRules.js +177 -482
  23. package/lib/lib/expandTailwindAtRules.js +69 -237
  24. package/lib/lib/findAtConfigPath.js +13 -30
  25. package/lib/lib/generateRules.js +349 -765
  26. package/lib/lib/getModuleDependencies.js +27 -63
  27. package/lib/lib/load-config.js +16 -24
  28. package/lib/lib/normalizeTailwindDirectives.js +26 -70
  29. package/lib/lib/offsets.js +61 -224
  30. package/lib/lib/partitionApplyAtRules.js +29 -51
  31. package/lib/lib/regex.js +22 -30
  32. package/lib/lib/remap-bitfield.js +9 -84
  33. package/lib/lib/resolveDefaultsAtRules.js +50 -116
  34. package/lib/lib/setupContextUtils.js +576 -1099
  35. package/lib/lib/setupTrackingContext.js +54 -143
  36. package/lib/lib/sharedState.js +15 -59
  37. package/lib/lib/substituteScreenAtRules.js +8 -16
  38. package/lib/oxide/cli/build/deps.js +17 -32
  39. package/lib/oxide/cli/build/index.js +10 -40
  40. package/lib/oxide/cli/build/plugin.js +87 -267
  41. package/lib/oxide/cli/build/utils.js +18 -39
  42. package/lib/oxide/cli/build/watching.js +34 -149
  43. package/lib/oxide/cli/help/index.js +15 -57
  44. package/lib/oxide/cli/index.js +66 -127
  45. package/lib/oxide/cli/init/index.js +17 -36
  46. package/lib/oxide/cli.js +2 -3
  47. package/lib/plugin.js +30 -57
  48. package/lib/postcss-plugins/nesting/index.js +6 -10
  49. package/lib/postcss-plugins/nesting/plugin.js +17 -60
  50. package/lib/processTailwindFeatures.js +8 -37
  51. package/lib/public/colors.js +15 -22
  52. package/lib/public/create-plugin.js +5 -8
  53. package/lib/public/default-config.js +5 -9
  54. package/lib/public/default-theme.js +5 -9
  55. package/lib/public/load-config.js +4 -6
  56. package/lib/public/resolve-config.js +4 -6
  57. package/lib/util/applyImportantSelector.js +15 -24
  58. package/lib/util/bigSign.js +6 -7
  59. package/lib/util/buildMediaQuery.js +10 -17
  60. package/lib/util/cloneDeep.js +9 -17
  61. package/lib/util/cloneNodes.js +14 -27
  62. package/lib/util/color.js +45 -81
  63. package/lib/util/configurePlugins.js +9 -16
  64. package/lib/util/createPlugin.js +8 -15
  65. package/lib/util/createUtilityPlugin.js +15 -27
  66. package/lib/util/dataTypes.js +23 -144
  67. package/lib/util/defaults.js +9 -19
  68. package/lib/util/escapeClassName.js +6 -10
  69. package/lib/util/escapeCommas.js +6 -7
  70. package/lib/util/flattenColorPalette.js +6 -8
  71. package/lib/util/formatVariantSelector.js +49 -190
  72. package/lib/util/getAllConfigs.js +35 -42
  73. package/lib/util/hashConfig.js +6 -8
  74. package/lib/util/isKeyframeRule.js +6 -7
  75. package/lib/util/isPlainObject.js +8 -11
  76. package/lib/util/isSyntacticallyValidPropertyValue.js +13 -42
  77. package/lib/util/log.js +7 -14
  78. package/lib/util/nameClass.js +6 -21
  79. package/lib/util/negateValue.js +10 -26
  80. package/lib/util/normalizeConfig.js +63 -240
  81. package/lib/util/normalizeScreens.js +70 -137
  82. package/lib/util/parseAnimationValue.js +13 -61
  83. package/lib/util/parseBoxShadowValue.js +12 -57
  84. package/lib/util/parseDependency.js +13 -37
  85. package/lib/util/parseGlob.js +7 -22
  86. package/lib/util/parseObjectStyles.js +17 -26
  87. package/lib/util/pluginUtils.js +69 -176
  88. package/lib/util/prefixSelector.js +11 -28
  89. package/lib/util/pseudoElements.js +29 -105
  90. package/lib/util/removeAlphaVariables.js +8 -21
  91. package/lib/util/resolveConfig.js +103 -220
  92. package/lib/util/resolveConfigPath.js +12 -38
  93. package/lib/util/responsive.js +4 -6
  94. package/lib/util/splitAtTopLevelOnly.js +10 -44
  95. package/lib/util/tap.js +6 -8
  96. package/lib/util/toColorValue.js +6 -7
  97. package/lib/util/toPath.js +8 -26
  98. package/lib/util/transformThemeValue.js +12 -45
  99. package/lib/util/validateConfig.js +14 -22
  100. package/lib/util/validateFormalSyntax.js +5 -11
  101. package/lib/util/withAlphaVariable.js +28 -48
  102. package/package.json +3 -3
  103. package/peers/index.js +14 -16
  104. package/src/cli/build/plugin.js +1 -1
  105. package/src/cli.js +1 -1
  106. package/src/corePlugins.js +16 -17
  107. package/src/featureFlags.js +2 -3
  108. package/src/index.js +1 -5
  109. package/src/lib/expandTailwindAtRules.js +2 -2
  110. package/src/lib/sharedState.js +0 -15
  111. package/src/oxide/cli/build/plugin.ts +1 -1
  112. package/src/plugin.js +1 -1
@@ -1,56 +1,34 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: ()=>expandApplyAtRules
8
- });
9
- function partitionRules(root) {
10
- if (!root.walkAtRules) return;
11
- let applyParents = new Set();
12
- root.walkAtRules("apply", (rule)=>{
13
- applyParents.add(rule.parent);
14
- });
15
- if (applyParents.size === 0) {
16
- return;
17
- }
18
- for (let rule of applyParents){
19
- let nodeGroups = [];
20
- let lastGroup = [];
21
- for (let node of rule.nodes){
22
- if (node.type === "atrule" && node.name === "apply") {
23
- if (lastGroup.length > 0) {
24
- nodeGroups.push(lastGroup);
25
- lastGroup = [];
26
- }
27
- nodeGroups.push([
28
- node
29
- ]);
30
- } else {
31
- lastGroup.push(node);
32
- }
33
- }
34
- if (lastGroup.length > 0) {
35
- nodeGroups.push(lastGroup);
36
- }
37
- if (nodeGroups.length === 1) {
38
- continue;
39
- }
40
- for (let group of [
41
- ...nodeGroups
42
- ].reverse()){
43
- let clone = rule.clone({
44
- nodes: []
45
- });
46
- clone.append(group);
47
- rule.after(clone);
48
- }
49
- rule.remove();
50
- }
51
- }
52
2
  function expandApplyAtRules() {
53
3
  return (root)=>{
54
- partitionRules(root);
4
+ !function(root) {
5
+ if (!root.walkAtRules) return;
6
+ let applyParents = new Set();
7
+ if (root.walkAtRules("apply", (rule)=>{
8
+ applyParents.add(rule.parent);
9
+ }), 0 !== applyParents.size) for (let rule of applyParents){
10
+ let nodeGroups = [], lastGroup = [];
11
+ for (let node of rule.nodes)"atrule" === node.type && "apply" === node.name ? (lastGroup.length > 0 && (nodeGroups.push(lastGroup), lastGroup = []), nodeGroups.push([
12
+ node
13
+ ])) : lastGroup.push(node);
14
+ if (lastGroup.length > 0 && nodeGroups.push(lastGroup), 1 !== nodeGroups.length) {
15
+ for (let group of [
16
+ ...nodeGroups
17
+ ].reverse()){
18
+ let clone = rule.clone({
19
+ nodes: []
20
+ });
21
+ clone.append(group), rule.after(clone);
22
+ }
23
+ rule.remove();
24
+ }
25
+ }
26
+ }(root);
55
27
  };
56
28
  }
29
+ Object.defineProperty(exports, "__esModule", {
30
+ value: !0
31
+ }), Object.defineProperty(exports, "default", {
32
+ enumerable: !0,
33
+ get: ()=>expandApplyAtRules
34
+ });
package/lib/lib/regex.js CHANGED
@@ -1,38 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
3
+ value: !0
4
+ }), function(target, all) {
6
5
  for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
6
+ enumerable: !0,
8
7
  get: all[name]
9
8
  });
10
- }
11
- _export(exports, {
9
+ }(exports, {
12
10
  pattern: ()=>pattern,
13
11
  withoutCapturing: ()=>withoutCapturing,
14
12
  any: ()=>any,
15
13
  optional: ()=>optional,
16
14
  zeroOrMore: ()=>zeroOrMore,
17
- nestedBrackets: ()=>nestedBrackets,
15
+ nestedBrackets: ()=>function nestedBrackets(open, close, depth = 1) {
16
+ return withoutCapturing([
17
+ escape(open),
18
+ /[^\s]*/,
19
+ 1 === depth ? `[^${escape(open)}${escape(close)}\s]*` : any([
20
+ `[^${escape(open)}${escape(close)}\s]*`,
21
+ nestedBrackets(open, close, depth - 1)
22
+ ]),
23
+ /[^\s]*/,
24
+ escape(close)
25
+ ]);
26
+ },
18
27
  escape: ()=>escape
19
28
  });
20
- const REGEX_SPECIAL = /[\\^$.*+?()[\]{}|]/g;
21
- const REGEX_HAS_SPECIAL = RegExp(REGEX_SPECIAL.source);
22
- /**
23
- * @param {string|RegExp|Array<string|RegExp>} source
24
- */ function toSource(source) {
25
- source = Array.isArray(source) ? source : [
29
+ const REGEX_SPECIAL = /[\\^$.*+?()[\]{}|]/g, REGEX_HAS_SPECIAL = RegExp(REGEX_SPECIAL.source);
30
+ function toSource(source) {
31
+ return (source = (source = Array.isArray(source) ? source : [
26
32
  source
27
- ];
28
- source = source.map((item)=>item instanceof RegExp ? item.source : item);
29
- return source.join("");
33
+ ]).map((item)=>item instanceof RegExp ? item.source : item)).join("");
30
34
  }
31
35
  function pattern(source) {
32
- return new RegExp(toSource(source), "g");
36
+ return RegExp(toSource(source), "g");
33
37
  }
34
38
  function withoutCapturing(source) {
35
- return new RegExp(`(?:${toSource(source)})`, "g");
39
+ return RegExp(`(?:${toSource(source)})`, "g");
36
40
  }
37
41
  function any(sources) {
38
42
  return `(?:${sources.map(toSource).join("|")})`;
@@ -43,18 +47,6 @@ function optional(source) {
43
47
  function zeroOrMore(source) {
44
48
  return `(?:${toSource(source)})*`;
45
49
  }
46
- function nestedBrackets(open, close, depth = 1) {
47
- return withoutCapturing([
48
- escape(open),
49
- /[^\s]*/,
50
- depth === 1 ? `[^${escape(open)}${escape(close)}\s]*` : any([
51
- `[^${escape(open)}${escape(close)}\s]*`,
52
- nestedBrackets(open, close, depth - 1)
53
- ]),
54
- /[^\s]*/,
55
- escape(close)
56
- ]);
57
- }
58
50
  function escape(string) {
59
51
  return string && REGEX_HAS_SPECIAL.test(string) ? string.replace(REGEX_SPECIAL, "\\$&") : string || "";
60
52
  }
@@ -1,87 +1,12 @@
1
- // @ts-check
2
- /**
3
- * We must remap all the old bits to new bits for each set variant
4
- * Only arbitrary variants are considered as those are the only
5
- * ones that need to be re-sorted at this time
6
- *
7
- * An iterated process that removes and sets individual bits simultaneously
8
- * will not work because we may have a new bit that is also a later old bit
9
- * This means that we would be removing a previously set bit which we don't
10
- * want to do
11
- *
12
- * For example (assume `bN` = `1<<N`)
13
- * Given the "total" mapping `[[b1, b3], [b2, b4], [b3, b1], [b4, b2]]`
14
- * The mapping is "total" because:
15
- * 1. Every input and output is accounted for
16
- * 2. All combinations are unique
17
- * 3. No one input maps to multiple outputs and vice versa
18
- * And, given an offset with all bits set:
19
- * V = b1 | b2 | b3 | b4
20
- *
21
- * Let's explore the issue with removing and setting bits simultaneously:
22
- * V & ~b1 | b3 = b2 | b3 | b4
23
- * V & ~b2 | b4 = b3 | b4
24
- * V & ~b3 | b1 = b1 | b4
25
- * V & ~b4 | b2 = b1 | b2
26
- *
27
- * As you can see, we end up with the wrong result.
28
- * This is because we're removing a bit that was previously set.
29
- * And, thus the final result is missing b3 and b4.
30
- *
31
- * Now, let's explore the issue with removing the bits first:
32
- * V & ~b1 = b2 | b3 | b4
33
- * V & ~b2 = b3 | b4
34
- * V & ~b3 = b4
35
- * V & ~b4 = 0
36
- *
37
- * And then setting the bits:
38
- * V | b3 = b3
39
- * V | b4 = b3 | b4
40
- * V | b1 = b1 | b3 | b4
41
- * V | b2 = b1 | b2 | b3 | b4
42
- *
43
- * We get the correct result because we're not removing any bits that were
44
- * previously set thus properly remapping the bits to the new order
45
- *
46
- * To collect this into a single operation that can be done simultaneously
47
- * we must first create a mask for the old bits that are set and a mask for
48
- * the new bits that are set. Then we can remove the old bits and set the new
49
- * bits simultaneously in a "single" operation like so:
50
- * OldMask = b1 | b2 | b3 | b4
51
- * NewMask = b3 | b4 | b1 | b2
52
- *
53
- * So this:
54
- * V & ~oldMask | newMask
55
- *
56
- * Expands to this:
57
- * V & ~b1 & ~b2 & ~b3 & ~b4 | b3 | b4 | b1 | b2
58
- *
59
- * Which becomes this:
60
- * b1 | b2 | b3 | b4
61
- *
62
- * Which is the correct result!
63
- *
64
- * @param {bigint} num
65
- * @param {[bigint, bigint][]} mapping
66
- */ "use strict";
67
- Object.defineProperty(exports, "__esModule", {
68
- value: true
69
- });
70
- Object.defineProperty(exports, "remapBitfield", {
71
- enumerable: true,
72
- get: ()=>remapBitfield
73
- });
1
+ "use strict";
74
2
  function remapBitfield(num, mapping) {
75
- // Create masks for the old and new bits that are set
76
- let oldMask = 0n;
77
- let newMask = 0n;
78
- for (let [oldBit, newBit] of mapping){
79
- if (num & oldBit) {
80
- oldMask = oldMask | oldBit;
81
- newMask = newMask | newBit;
82
- }
83
- }
84
- // Remove all old bits
85
- // Set all new bits
3
+ let oldMask = 0n, newMask = 0n;
4
+ for (let [oldBit, newBit] of mapping)num & oldBit && (oldMask |= oldBit, newMask |= newBit);
86
5
  return num & ~oldMask | newMask;
87
6
  }
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: !0
9
+ }), Object.defineProperty(exports, "remapBitfield", {
10
+ enumerable: !0,
11
+ get: ()=>remapBitfield
12
+ });
@@ -1,138 +1,81 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
3
+ value: !0
4
+ }), function(target, all) {
6
5
  for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
6
+ enumerable: !0,
8
7
  get: all[name]
9
8
  });
10
- }
11
- _export(exports, {
9
+ }(exports, {
12
10
  elementSelectorParser: ()=>elementSelectorParser,
13
11
  default: ()=>resolveDefaultsAtRules
14
12
  });
15
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
16
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
17
- const _featureFlags = require("../featureFlags");
13
+ const _postcss = _interopRequireDefault(require("postcss")), _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser")), _featureFlags = require("../featureFlags");
18
14
  function _interopRequireDefault(obj) {
19
15
  return obj && obj.__esModule ? obj : {
20
16
  default: obj
21
17
  };
22
18
  }
23
19
  let getNode = {
24
- id (node) {
25
- return _postcssSelectorParser.default.attribute({
20
+ id: (node)=>_postcssSelectorParser.default.attribute({
26
21
  attribute: "id",
27
22
  operator: "=",
28
23
  value: node.value,
29
24
  quoteMark: '"'
30
- });
31
- }
32
- };
33
- function minimumImpactSelector(nodes) {
34
- let rest = nodes.filter((node)=>{
35
- // Keep non-pseudo nodes
36
- if (node.type !== "pseudo") return true;
37
- // Keep pseudo nodes that have subnodes
38
- // E.g.: `:not()` contains subnodes inside the parentheses
39
- if (node.nodes.length > 0) return true;
40
- // Keep pseudo `elements`
41
- // This implicitly means that we ignore pseudo `classes`
42
- return node.value.startsWith("::") || [
43
- ":before",
44
- ":after",
45
- ":first-line",
46
- ":first-letter"
47
- ].includes(node.value);
48
- }).reverse();
49
- let searchFor = new Set([
50
- "tag",
51
- "class",
52
- "id",
53
- "attribute"
54
- ]);
55
- let splitPointIdx = rest.findIndex((n)=>searchFor.has(n.type));
56
- if (splitPointIdx === -1) return rest.reverse().join("").trim();
57
- let node = rest[splitPointIdx];
58
- let bestNode = getNode[node.type] ? getNode[node.type](node) : node;
59
- rest = rest.slice(0, splitPointIdx);
60
- let combinatorIdx = rest.findIndex((n)=>n.type === "combinator" && n.value === ">");
61
- if (combinatorIdx !== -1) {
62
- rest.splice(0, combinatorIdx);
63
- rest.unshift(_postcssSelectorParser.default.universal());
64
- }
65
- return [
66
- bestNode,
67
- ...rest.reverse()
68
- ].join("").trim();
69
- }
70
- let elementSelectorParser = (0, _postcssSelectorParser.default)((selectors)=>{
71
- return selectors.map((s)=>{
72
- let nodes = s.split((n)=>n.type === "combinator" && n.value === " ").pop();
73
- return minimumImpactSelector(nodes);
74
- });
75
- });
76
- let cache = new Map();
77
- function extractElementSelector(selector) {
78
- if (!cache.has(selector)) {
79
- cache.set(selector, elementSelectorParser.transformSync(selector));
80
- }
81
- return cache.get(selector);
82
- }
25
+ })
26
+ }, elementSelectorParser = (0, _postcssSelectorParser.default)((selectors)=>selectors.map((s)=>(function(nodes) {
27
+ let rest = nodes.filter((node)=>"pseudo" !== node.type || node.nodes.length > 0 || node.value.startsWith("::") || [
28
+ ":before",
29
+ ":after",
30
+ ":first-line",
31
+ ":first-letter"
32
+ ].includes(node.value)).reverse(), searchFor = new Set([
33
+ "tag",
34
+ "class",
35
+ "id",
36
+ "attribute"
37
+ ]), splitPointIdx = rest.findIndex((n)=>searchFor.has(n.type));
38
+ if (-1 === splitPointIdx) return rest.reverse().join("").trim();
39
+ let node = rest[splitPointIdx], bestNode = getNode[node.type] ? getNode[node.type](node) : node, combinatorIdx = (rest = rest.slice(0, splitPointIdx)).findIndex((n)=>"combinator" === n.type && ">" === n.value);
40
+ return -1 !== combinatorIdx && (rest.splice(0, combinatorIdx), rest.unshift(_postcssSelectorParser.default.universal())), [
41
+ bestNode,
42
+ ...rest.reverse()
43
+ ].join("").trim();
44
+ })(s.split((n)=>"combinator" === n.type && " " === n.value).pop()))), cache = new Map();
83
45
  function resolveDefaultsAtRules({ tailwindConfig }) {
84
46
  return (root)=>{
85
- let variableNodeMap = new Map();
86
- /** @type {Set<import('postcss').AtRule>} */ let universals = new Set();
87
- root.walkAtRules("defaults", (rule)=>{
47
+ let variableNodeMap = new Map(), universals = new Set();
48
+ if (root.walkAtRules("defaults", (rule)=>{
88
49
  if (rule.nodes && rule.nodes.length > 0) {
89
50
  universals.add(rule);
90
51
  return;
91
52
  }
92
53
  let variable = rule.params;
93
- if (!variableNodeMap.has(variable)) {
94
- variableNodeMap.set(variable, new Set());
54
+ variableNodeMap.has(variable) || variableNodeMap.set(variable, new Set()), variableNodeMap.get(variable).add(rule.parent), rule.remove();
55
+ }), (0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) for (let universal of universals){
56
+ var _variableNodeMap_get, _selectorGroups_get, selector;
57
+ let selectorGroups = new Map();
58
+ for (let rule of null !== (_variableNodeMap_get = variableNodeMap.get(universal.params)) && void 0 !== _variableNodeMap_get ? _variableNodeMap_get : [])for (let selector1 of (selector = rule.selector, cache.has(selector) || cache.set(selector, elementSelectorParser.transformSync(selector)), cache.get(selector))){
59
+ let selectorGroupName = selector1.includes(":-") || selector1.includes("::-") ? selector1 : "__DEFAULT__", selectors = null !== (_selectorGroups_get = selectorGroups.get(selectorGroupName)) && void 0 !== _selectorGroups_get ? _selectorGroups_get : new Set();
60
+ selectorGroups.set(selectorGroupName, selectors), selectors.add(selector1);
95
61
  }
96
- variableNodeMap.get(variable).add(rule.parent);
97
- rule.remove();
98
- });
99
- if ((0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) {
100
- for (let universal of universals){
101
- /** @type {Map<string, Set<string>>} */ let selectorGroups = new Map();
102
- var _variableNodeMap_get;
103
- let rules = (_variableNodeMap_get = variableNodeMap.get(universal.params)) !== null && _variableNodeMap_get !== void 0 ? _variableNodeMap_get : [];
104
- for (let rule of rules){
105
- for (let selector of extractElementSelector(rule.selector)){
106
- // If selector contains a vendor prefix after a pseudo element or class,
107
- // we consider them separately because merging the declarations into
108
- // a single rule will cause browsers that do not understand the
109
- // vendor prefix to throw out the whole rule
110
- let selectorGroupName = selector.includes(":-") || selector.includes("::-") ? selector : "__DEFAULT__";
111
- var _selectorGroups_get;
112
- let selectors = (_selectorGroups_get = selectorGroups.get(selectorGroupName)) !== null && _selectorGroups_get !== void 0 ? _selectorGroups_get : new Set();
113
- selectorGroups.set(selectorGroupName, selectors);
114
- selectors.add(selector);
115
- }
62
+ if ((0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) {
63
+ if (0 === selectorGroups.size) {
64
+ universal.remove();
65
+ continue;
116
66
  }
117
- if ((0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) {
118
- if (selectorGroups.size === 0) {
119
- universal.remove();
120
- continue;
121
- }
122
- for (let [, selectors] of selectorGroups){
123
- let universalRule = _postcss.default.rule({
124
- source: universal.source
125
- });
126
- universalRule.selectors = [
127
- ...selectors
128
- ];
129
- universalRule.append(universal.nodes.map((node)=>node.clone()));
130
- universal.before(universalRule);
131
- }
67
+ for (let [, selectors] of selectorGroups){
68
+ let universalRule = _postcss.default.rule({
69
+ source: universal.source
70
+ });
71
+ universalRule.selectors = [
72
+ ...selectors
73
+ ], universalRule.append(universal.nodes.map((node)=>node.clone())), universal.before(universalRule);
132
74
  }
133
- universal.remove();
134
75
  }
135
- } else if (universals.size) {
76
+ universal.remove();
77
+ }
78
+ else if (universals.size) {
136
79
  let universalRule = _postcss.default.rule({
137
80
  selectors: [
138
81
  "*",
@@ -140,16 +83,7 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
140
83
  "::after"
141
84
  ]
142
85
  });
143
- for (let universal of universals){
144
- universalRule.append(universal.nodes);
145
- if (!universalRule.parent) {
146
- universal.before(universalRule);
147
- }
148
- if (!universalRule.source) {
149
- universalRule.source = universal.source;
150
- }
151
- universal.remove();
152
- }
86
+ for (let universal of universals)universalRule.append(universal.nodes), universalRule.parent || universal.before(universalRule), universalRule.source || (universalRule.source = universal.source), universal.remove();
153
87
  let backdropRule = universalRule.clone({
154
88
  selectors: [
155
89
  "::backdrop"