tailwindcss 3.3.0 → 3.3.2

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 (126) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/lib/cli/build/deps.js +17 -9
  3. package/lib/cli/build/index.js +10 -8
  4. package/lib/cli/build/plugin.js +27 -25
  5. package/lib/cli/build/utils.js +18 -8
  6. package/lib/cli/build/watching.js +12 -10
  7. package/lib/cli/help/index.js +6 -4
  8. package/lib/cli/index.js +4 -4
  9. package/lib/cli/init/index.js +8 -6
  10. package/lib/cli-peer-dependencies.js +12 -4
  11. package/lib/cli.js +1 -1
  12. package/lib/corePluginList.js +3 -1
  13. package/lib/corePlugins.js +41 -35
  14. package/lib/featureFlags.js +14 -9
  15. package/lib/index.js +1 -5
  16. package/lib/lib/cacheInvalidation.js +7 -5
  17. package/lib/lib/collapseAdjacentRules.js +3 -1
  18. package/lib/lib/collapseDuplicateDeclarations.js +10 -8
  19. package/lib/lib/content.js +18 -14
  20. package/lib/lib/defaultExtractor.js +6 -4
  21. package/lib/lib/detectNesting.js +3 -1
  22. package/lib/lib/evaluateTailwindFunctions.js +18 -16
  23. package/lib/lib/expandApplyAtRules.js +39 -32
  24. package/lib/lib/expandTailwindAtRules.js +15 -13
  25. package/lib/lib/findAtConfigPath.js +6 -4
  26. package/lib/lib/generateRules.js +37 -31
  27. package/lib/lib/getModuleDependencies.js +10 -8
  28. package/lib/lib/load-config.js +14 -8
  29. package/lib/lib/normalizeTailwindDirectives.js +5 -3
  30. package/lib/lib/offsets.js +7 -5
  31. package/lib/lib/partitionApplyAtRules.js +3 -1
  32. package/lib/lib/regex.js +21 -7
  33. package/lib/lib/remap-bitfield.js +3 -1
  34. package/lib/lib/resolveDefaultsAtRules.js +24 -20
  35. package/lib/lib/setupContextUtils.js +67 -57
  36. package/lib/lib/setupTrackingContext.js +26 -24
  37. package/lib/lib/sharedState.js +32 -23
  38. package/lib/lib/substituteScreenAtRules.js +5 -3
  39. package/lib/oxide/cli/build/deps.js +16 -8
  40. package/lib/oxide/cli/build/index.js +6 -4
  41. package/lib/oxide/cli/build/plugin.js +19 -17
  42. package/lib/oxide/cli/build/utils.js +18 -8
  43. package/lib/oxide/cli/build/watching.js +10 -8
  44. package/lib/oxide/cli/help/index.js +6 -4
  45. package/lib/oxide/cli/index.js +4 -4
  46. package/lib/oxide/cli/init/index.js +6 -4
  47. package/lib/plugin.js +7 -7
  48. package/lib/postcss-plugins/nesting/index.js +3 -1
  49. package/lib/postcss-plugins/nesting/plugin.js +8 -6
  50. package/lib/processTailwindFeatures.js +14 -12
  51. package/lib/public/colors.js +5 -3
  52. package/lib/public/create-plugin.js +5 -3
  53. package/lib/public/default-config.js +6 -4
  54. package/lib/public/default-theme.js +6 -4
  55. package/lib/public/load-config.js +5 -3
  56. package/lib/public/resolve-config.js +6 -4
  57. package/lib/util/applyImportantSelector.js +27 -13
  58. package/lib/util/bigSign.js +3 -1
  59. package/lib/util/buildMediaQuery.js +3 -1
  60. package/lib/util/cloneDeep.js +3 -1
  61. package/lib/util/cloneNodes.js +3 -1
  62. package/lib/util/color.js +10 -6
  63. package/lib/util/colorNames.js +752 -0
  64. package/lib/util/configurePlugins.js +3 -1
  65. package/lib/util/createPlugin.js +3 -1
  66. package/lib/util/createUtilityPlugin.js +5 -3
  67. package/lib/util/dataTypes.js +45 -15
  68. package/lib/util/defaults.js +6 -4
  69. package/lib/util/escapeClassName.js +7 -5
  70. package/lib/util/escapeCommas.js +3 -1
  71. package/lib/util/flattenColorPalette.js +3 -1
  72. package/lib/util/formatVariantSelector.js +28 -106
  73. package/lib/util/getAllConfigs.js +6 -4
  74. package/lib/util/hashConfig.js +6 -4
  75. package/lib/util/isKeyframeRule.js +3 -1
  76. package/lib/util/isPlainObject.js +3 -1
  77. package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
  78. package/lib/util/log.js +8 -4
  79. package/lib/util/nameClass.js +12 -6
  80. package/lib/util/negateValue.js +3 -1
  81. package/lib/util/normalizeConfig.js +7 -19
  82. package/lib/util/normalizeScreens.js +12 -4
  83. package/lib/util/parseAnimationValue.js +3 -1
  84. package/lib/util/parseBoxShadowValue.js +6 -2
  85. package/lib/util/parseDependency.js +3 -1
  86. package/lib/util/parseGlob.js +6 -4
  87. package/lib/util/parseObjectStyles.js +9 -7
  88. package/lib/util/pluginUtils.js +30 -18
  89. package/lib/util/prefixSelector.js +6 -4
  90. package/lib/util/pseudoElements.js +225 -0
  91. package/lib/util/removeAlphaVariables.js +3 -1
  92. package/lib/util/resolveConfig.js +10 -8
  93. package/lib/util/resolveConfigPath.js +9 -5
  94. package/lib/util/responsive.js +6 -4
  95. package/lib/util/splitAtTopLevelOnly.js +3 -1
  96. package/lib/util/tap.js +3 -1
  97. package/lib/util/toColorValue.js +3 -1
  98. package/lib/util/toPath.js +3 -1
  99. package/lib/util/transformThemeValue.js +6 -4
  100. package/lib/util/validateConfig.js +16 -3
  101. package/lib/util/validateFormalSyntax.js +3 -1
  102. package/lib/util/withAlphaVariable.js +6 -2
  103. package/package.json +30 -34
  104. package/peers/index.js +65828 -48819
  105. package/src/cli/build/plugin.js +1 -1
  106. package/src/cli.js +1 -1
  107. package/src/corePlugins.js +16 -17
  108. package/src/featureFlags.js +2 -3
  109. package/src/index.js +1 -5
  110. package/src/lib/defaultExtractor.js +1 -1
  111. package/src/lib/expandApplyAtRules.js +6 -0
  112. package/src/lib/expandTailwindAtRules.js +3 -3
  113. package/src/lib/load-config.ts +9 -5
  114. package/src/lib/setupTrackingContext.js +1 -1
  115. package/src/lib/sharedState.js +13 -19
  116. package/src/oxide/cli/build/plugin.ts +1 -1
  117. package/src/plugin.js +1 -1
  118. package/src/util/applyImportantSelector.js +20 -12
  119. package/src/util/color.js +1 -1
  120. package/src/util/colorNames.js +150 -0
  121. package/src/util/formatVariantSelector.js +2 -98
  122. package/src/util/normalizeConfig.js +0 -17
  123. package/src/util/pluginUtils.js +1 -5
  124. package/src/util/pseudoElements.js +170 -0
  125. package/src/util/validateConfig.js +13 -0
  126. package/types/config.d.ts +1 -6
@@ -9,27 +9,33 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getClassNameFromSelector: ()=>getClassNameFromSelector,
13
- resolveMatches: ()=>resolveMatches,
14
- generateRules: ()=>generateRules
12
+ getClassNameFromSelector: function() {
13
+ return getClassNameFromSelector;
14
+ },
15
+ resolveMatches: function() {
16
+ return resolveMatches;
17
+ },
18
+ generateRules: function() {
19
+ return generateRules;
20
+ }
15
21
  });
16
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
17
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
18
- const _parseObjectStyles = /*#__PURE__*/ _interopRequireDefault(require("../util/parseObjectStyles"));
19
- const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("../util/isPlainObject"));
20
- const _prefixSelector = /*#__PURE__*/ _interopRequireDefault(require("../util/prefixSelector"));
22
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
23
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
24
+ const _parseObjectStyles = /*#__PURE__*/ _interop_require_default(require("../util/parseObjectStyles"));
25
+ const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("../util/isPlainObject"));
26
+ const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
21
27
  const _pluginUtils = require("../util/pluginUtils");
22
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
23
- const _sharedState = /*#__PURE__*/ _interopRequireWildcard(require("./sharedState"));
28
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
29
+ const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
24
30
  const _formatVariantSelector = require("../util/formatVariantSelector");
25
31
  const _nameClass = require("../util/nameClass");
26
32
  const _dataTypes = require("../util/dataTypes");
27
33
  const _setupContextUtils = require("./setupContextUtils");
28
- const _isSyntacticallyValidPropertyValue = /*#__PURE__*/ _interopRequireDefault(require("../util/isSyntacticallyValidPropertyValue"));
29
- const _splitAtTopLevelOnlyJs = require("../util/splitAtTopLevelOnly.js");
34
+ const _isSyntacticallyValidPropertyValue = /*#__PURE__*/ _interop_require_default(require("../util/isSyntacticallyValidPropertyValue"));
35
+ const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly.js");
30
36
  const _featureFlags = require("../featureFlags");
31
37
  const _applyImportantSelector = require("../util/applyImportantSelector");
32
- function _interopRequireDefault(obj) {
38
+ function _interop_require_default(obj) {
33
39
  return obj && obj.__esModule ? obj : {
34
40
  default: obj
35
41
  };
@@ -42,7 +48,7 @@ function _getRequireWildcardCache(nodeInterop) {
42
48
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
43
49
  })(nodeInterop);
44
50
  }
45
- function _interopRequireWildcard(obj, nodeInterop) {
51
+ function _interop_require_wildcard(obj, nodeInterop) {
46
52
  if (!nodeInterop && obj && obj.__esModule) {
47
53
  return obj;
48
54
  }
@@ -73,7 +79,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
73
79
  }
74
80
  return newObj;
75
81
  }
76
- let classNameParser = (0, _postcssSelectorParser.default)((selectors)=>{
82
+ let classNameParser = (0, _postcssselectorparser.default)((selectors)=>{
77
83
  return selectors.first.filter(({ type })=>type === "class").pop().value;
78
84
  });
79
85
  function getClassNameFromSelector(selector) {
@@ -163,7 +169,7 @@ function applyImportant(matches, classCandidate) {
163
169
  ]
164
170
  });
165
171
  container.walkRules((r)=>{
166
- let ast = (0, _postcssSelectorParser.default)().astSync(r.selector);
172
+ let ast = (0, _postcssselectorparser.default)().astSync(r.selector);
167
173
  // Remove extraneous selectors that do not include the base candidate
168
174
  ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
169
175
  // Update all instances of the base candidate to include the important marker
@@ -199,7 +205,7 @@ function applyVariant(variant, matches, context) {
199
205
  };
200
206
  // Retrieve "modifier"
201
207
  {
202
- let [baseVariant, ...modifiers] = (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(variant, "/");
208
+ let [baseVariant, ...modifiers] = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(variant, "/");
203
209
  // This is a hack to support variants with `/` in them, like `ar-1/10/20:text-red-500`
204
210
  // In this case 1/10 is a value but /20 is a modifier
205
211
  if (modifiers.length > 1) {
@@ -238,7 +244,7 @@ function applyVariant(variant, matches, context) {
238
244
  if (isArbitraryValue(variant) && !context.variantMap.has(variant)) {
239
245
  let sort = context.offsets.recordVariant(variant);
240
246
  let selector = (0, _dataTypes.normalize)(variant.slice(1, -1));
241
- let selectors = (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(selector, ",");
247
+ let selectors = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(selector, ",");
242
248
  // We do not support multiple selectors for arbitrary variants
243
249
  if (selectors.length > 1) {
244
250
  return [];
@@ -320,14 +326,14 @@ function applyVariant(variant, matches, context) {
320
326
  // It can happen that a list of format strings is returned from within the function. In that
321
327
  // case, we have to process them as well. We can use the existing `variantSort`.
322
328
  if (Array.isArray(ruleWithVariant)) {
323
- for (let [idx, variantFunction1] of ruleWithVariant.entries()){
329
+ for (let [idx, variantFunction] of ruleWithVariant.entries()){
324
330
  // This is a little bit scary since we are pushing to an array of items that we are
325
331
  // currently looping over. However, you can also think of it like a processing queue
326
332
  // where you keep handling jobs until everything is done and each job can queue more
327
333
  // jobs if needed.
328
334
  variantFunctionTuples.push([
329
335
  context.offsets.applyParallelOffset(variantSort, idx),
330
- variantFunction1,
336
+ variantFunction,
331
337
  // If the clone has been modified we have to pass that back
332
338
  // though so each rule can use the modified container
333
339
  clone.clone()
@@ -359,7 +365,7 @@ function applyVariant(variant, matches, context) {
359
365
  // as well. E.g.: `${variant}${separator}${className}`.
360
366
  // However, plugin authors probably also prepend or append certain
361
367
  // classes, pseudos, ids, ...
362
- let rebuiltBase = (0, _postcssSelectorParser.default)((selectors)=>{
368
+ let rebuiltBase = (0, _postcssselectorparser.default)((selectors)=>{
363
369
  selectors.walkClasses((classNode)=>{
364
370
  classNode.value = `${variant}${context.tailwindConfig.separator}${classNode.value}`;
365
371
  });
@@ -550,7 +556,7 @@ function splitWithSeparator(input, separator) {
550
556
  _sharedState.NOT_ON_DEMAND
551
557
  ];
552
558
  }
553
- return (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(input, separator);
559
+ return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(input, separator);
554
560
  }
555
561
  function* recordCandidates(matches, classCandidate) {
556
562
  for (const match of matches){
@@ -575,7 +581,7 @@ function* resolveMatches(candidate, context, original = candidate) {
575
581
  if ((0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping")) {
576
582
  if (classCandidate.startsWith("(") && classCandidate.endsWith(")")) {
577
583
  let base = variants.slice().reverse().join(separator);
578
- for (let part of (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(classCandidate.slice(1, -1), ",")){
584
+ for (let part of (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(classCandidate.slice(1, -1), ",")){
579
585
  yield* resolveMatches(base + separator + part, context, original);
580
586
  }
581
587
  }
@@ -617,18 +623,18 @@ function* resolveMatches(candidate, context, original = candidate) {
617
623
  }
618
624
  }
619
625
  } else if (modifier === "DEFAULT" || modifier === "-DEFAULT") {
620
- let ruleSet1 = plugin;
621
- let [rules1, options1] = parseRules(ruleSet1, context.postCssNodeCache);
622
- for (let rule1 of rules1){
626
+ let ruleSet = plugin;
627
+ let [rules, options] = parseRules(ruleSet, context.postCssNodeCache);
628
+ for (let rule of rules){
623
629
  matchesPerPlugin.push([
624
630
  {
625
631
  ...sort,
626
632
  options: {
627
633
  ...sort.options,
628
- ...options1
634
+ ...options
629
635
  }
630
636
  },
631
- rule1
637
+ rule
632
638
  ]);
633
639
  }
634
640
  }
@@ -704,11 +710,11 @@ function* resolveMatches(candidate, context, original = candidate) {
704
710
  }
705
711
  let messages = [];
706
712
  for (let [idx, group] of typesPerPlugin.entries()){
707
- for (let type1 of group){
708
- let rules2 = matches[idx].map(([, rule])=>rule).flat().map((rule)=>rule.toString().split("\n").slice(1, -1) // Remove selector and closing '}'
713
+ for (let type of group){
714
+ let rules = matches[idx].map(([, rule])=>rule).flat().map((rule)=>rule.toString().split("\n").slice(1, -1) // Remove selector and closing '}'
709
715
  .map((line)=>line.trim()).map((x)=>` ${x}`) // Re-indent
710
716
  .join("\n")).join("\n\n");
711
- messages.push(` Use \`${candidate.replace("[", `[${type1}:`)}\` for \`${rules2.trim()}\``);
717
+ messages.push(` Use \`${candidate.replace("[", `[${type}:`)}\` for \`${rules.trim()}\``);
712
718
  break;
713
719
  }
714
720
  }
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>getModuleDependencies
7
+ get: function() {
8
+ return getModuleDependencies;
9
+ }
8
10
  });
9
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
- const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
- function _interopRequireDefault(obj) {
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -59,10 +61,10 @@ function resolveWithExtension(file, extensions) {
59
61
  }
60
62
  }
61
63
  // Try to find `./a/index.js` from `./a`
62
- for (let ext1 of extensions){
63
- let full1 = `${file}/index${ext1}`;
64
- if (_fs.default.existsSync(full1)) {
65
- return full1;
64
+ for (let ext of extensions){
65
+ let full = `${file}/index${ext}`;
66
+ if (_fs.default.existsSync(full)) {
67
+ return full;
66
68
  }
67
69
  }
68
70
  return null;
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "loadConfig", {
6
6
  enumerable: true,
7
- get: ()=>loadConfig
7
+ get: function() {
8
+ return loadConfig;
9
+ }
8
10
  });
9
- const _jiti = /*#__PURE__*/ _interopRequireDefault(require("jiti"));
11
+ const _jiti = /*#__PURE__*/ _interop_require_default(require("jiti"));
10
12
  const _sucrase = require("sucrase");
11
- function _interopRequireDefault(obj) {
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -28,9 +30,13 @@ function lazyJiti() {
28
30
  });
29
31
  }
30
32
  function loadConfig(path) {
31
- try {
32
- return path ? require(path) : {};
33
- } catch {
34
- return lazyJiti()(path);
35
- }
33
+ let config = function() {
34
+ try {
35
+ return path ? require(path) : {};
36
+ } catch {
37
+ return lazyJiti()(path);
38
+ }
39
+ }();
40
+ var _config_default;
41
+ return (_config_default = config.default) !== null && _config_default !== void 0 ? _config_default : config;
36
42
  }
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>normalizeTailwindDirectives
7
+ get: function() {
8
+ return normalizeTailwindDirectives;
9
+ }
8
10
  });
9
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
10
- function _interopRequireDefault(obj) {
11
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
12
+ function _interop_require_default(obj) {
11
13
  return obj && obj.__esModule ? obj : {
12
14
  default: obj
13
15
  };
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "Offsets", {
7
7
  enumerable: true,
8
- get: ()=>Offsets
8
+ get: function() {
9
+ return Offsets;
10
+ }
9
11
  });
10
- const _bigSign = /*#__PURE__*/ _interopRequireDefault(require("../util/bigSign"));
11
- const _remapBitfieldJs = require("./remap-bitfield.js");
12
- function _interopRequireDefault(obj) {
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
  };
@@ -253,7 +255,7 @@ class Offsets {
253
255
  let [offset, rule] = item;
254
256
  offset = {
255
257
  ...offset,
256
- variants: (0, _remapBitfieldJs.remapBitfield)(offset.variants, mapping)
258
+ variants: (0, _remapbitfield.remapBitfield)(offset.variants, mapping)
257
259
  };
258
260
  return [
259
261
  offset,
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>expandApplyAtRules
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: ()=>pattern,
13
- withoutCapturing: ()=>withoutCapturing,
14
- any: ()=>any,
15
- optional: ()=>optional,
16
- zeroOrMore: ()=>zeroOrMore,
17
- nestedBrackets: ()=>nestedBrackets,
18
- escape: ()=>escape
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: ()=>remapBitfield
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: ()=>elementSelectorParser,
13
- default: ()=>resolveDefaultsAtRules
12
+ elementSelectorParser: function() {
13
+ return elementSelectorParser;
14
+ },
15
+ default: function() {
16
+ return resolveDefaultsAtRules;
17
+ }
14
18
  });
15
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
16
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
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 _interopRequireDefault(obj) {
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 _postcssSelectorParser.default.attribute({
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(_postcssSelectorParser.default.universal());
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, _postcssSelectorParser.default)((selectors)=>{
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);
@@ -119,12 +123,12 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
119
123
  universal.remove();
120
124
  continue;
121
125
  }
122
- for (let [, selectors1] of selectorGroups){
126
+ for (let [, selectors] of selectorGroups){
123
127
  let universalRule = _postcss.default.rule({
124
128
  source: universal.source
125
129
  });
126
130
  universalRule.selectors = [
127
- ...selectors1
131
+ ...selectors
128
132
  ];
129
133
  universalRule.append(universal.nodes.map((node)=>node.clone()));
130
134
  universal.before(universalRule);
@@ -133,29 +137,29 @@ function resolveDefaultsAtRules({ tailwindConfig }) {
133
137
  universal.remove();
134
138
  }
135
139
  } else if (universals.size) {
136
- let universalRule1 = _postcss.default.rule({
140
+ let universalRule = _postcss.default.rule({
137
141
  selectors: [
138
142
  "*",
139
143
  "::before",
140
144
  "::after"
141
145
  ]
142
146
  });
143
- for (let universal1 of universals){
144
- universalRule1.append(universal1.nodes);
145
- if (!universalRule1.parent) {
146
- universal1.before(universalRule1);
147
+ for (let universal of universals){
148
+ universalRule.append(universal.nodes);
149
+ if (!universalRule.parent) {
150
+ universal.before(universalRule);
147
151
  }
148
- if (!universalRule1.source) {
149
- universalRule1.source = universal1.source;
152
+ if (!universalRule.source) {
153
+ universalRule.source = universal.source;
150
154
  }
151
- universal1.remove();
155
+ universal.remove();
152
156
  }
153
- let backdropRule = universalRule1.clone({
157
+ let backdropRule = universalRule.clone({
154
158
  selectors: [
155
159
  "::backdrop"
156
160
  ]
157
161
  });
158
- universalRule1.after(backdropRule);
162
+ universalRule.after(backdropRule);
159
163
  }
160
164
  };
161
165
  }