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
package/lib/index.js CHANGED
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
- if (process.env.OXIDE) {
3
- module.exports = require("./oxide/postcss-plugin");
4
- } else {
5
- module.exports = require("./plugin");
6
- }
2
+ module.exports = require("./plugin");
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "hasContentChanged", {
6
6
  enumerable: true,
7
- get: ()=>hasContentChanged
7
+ get: function() {
8
+ return hasContentChanged;
9
+ }
8
10
  });
9
- const _crypto = /*#__PURE__*/ _interopRequireDefault(require("crypto"));
10
- const _sharedState = /*#__PURE__*/ _interopRequireWildcard(require("./sharedState"));
11
- function _interopRequireDefault(obj) {
11
+ const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
12
+ const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -21,7 +23,7 @@ function _getRequireWildcardCache(nodeInterop) {
21
23
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
22
24
  })(nodeInterop);
23
25
  }
24
- function _interopRequireWildcard(obj, nodeInterop) {
26
+ function _interop_require_wildcard(obj, nodeInterop) {
25
27
  if (!nodeInterop && obj && obj.__esModule) {
26
28
  return obj;
27
29
  }
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>collapseAdjacentRules
7
+ get: function() {
8
+ return collapseAdjacentRules;
9
+ }
8
10
  });
9
11
  let comparisonMap = {
10
12
  atrule: [
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>collapseDuplicateDeclarations
7
+ get: function() {
8
+ return collapseDuplicateDeclarations;
9
+ }
8
10
  });
9
11
  function collapseDuplicateDeclarations() {
10
12
  return (root)=>{
@@ -51,21 +53,21 @@ function collapseDuplicateDeclarations() {
51
53
  // with the same unit but the last one in the list.
52
54
  for (let declarations of byProperty.values()){
53
55
  let byUnit = new Map();
54
- for (let decl1 of declarations){
55
- let unit = resolveUnit(decl1.value);
56
+ for (let decl of declarations){
57
+ let unit = resolveUnit(decl.value);
56
58
  if (unit === null) {
57
59
  continue;
58
60
  }
59
61
  if (!byUnit.has(unit)) {
60
62
  byUnit.set(unit, new Set());
61
63
  }
62
- byUnit.get(unit).add(decl1);
64
+ byUnit.get(unit).add(decl);
63
65
  }
64
- for (let declarations1 of byUnit.values()){
66
+ for (let declarations of byUnit.values()){
65
67
  // Get all but the last one
66
- let removableDeclarations = Array.from(declarations1).slice(0, -1);
67
- for (let decl2 of removableDeclarations){
68
- decl2.remove();
68
+ let removableDeclarations = Array.from(declarations).slice(0, -1);
69
+ for (let decl of removableDeclarations){
70
+ decl.remove();
69
71
  }
70
72
  }
71
73
  }
@@ -10,17 +10,21 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- parseCandidateFiles: ()=>parseCandidateFiles,
14
- resolvedChangedContent: ()=>resolvedChangedContent
13
+ parseCandidateFiles: function() {
14
+ return parseCandidateFiles;
15
+ },
16
+ resolvedChangedContent: function() {
17
+ return resolvedChangedContent;
18
+ }
15
19
  });
16
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
17
- const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
18
- const _isGlob = /*#__PURE__*/ _interopRequireDefault(require("is-glob"));
19
- const _fastGlob = /*#__PURE__*/ _interopRequireDefault(require("fast-glob"));
20
- const _normalizePath = /*#__PURE__*/ _interopRequireDefault(require("normalize-path"));
20
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
21
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
22
+ const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
23
+ const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
24
+ const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
21
25
  const _parseGlob = require("../util/parseGlob");
22
26
  const _sharedState = require("./sharedState");
23
- function _interopRequireDefault(obj) {
27
+ function _interop_require_default(obj) {
24
28
  return obj && obj.__esModule ? obj : {
25
29
  default: obj
26
30
  };
@@ -29,9 +33,9 @@ function parseCandidateFiles(context, tailwindConfig) {
29
33
  let files = tailwindConfig.content.files;
30
34
  // Normalize the file globs
31
35
  files = files.filter((filePath)=>typeof filePath === "string");
32
- files = files.map(_normalizePath.default);
36
+ files = files.map(_normalizepath.default);
33
37
  // Split into included and excluded globs
34
- let tasks = _fastGlob.default.generateTasks(files);
38
+ let tasks = _fastglob.default.generateTasks(files);
35
39
  /** @type {ContentPath[]} */ let included = [];
36
40
  /** @type {ContentPath[]} */ let excluded = [];
37
41
  for (const task of tasks){
@@ -63,7 +67,7 @@ function parseCandidateFiles(context, tailwindConfig) {
63
67
  pattern: filePath,
64
68
  glob: null
65
69
  };
66
- if ((0, _isGlob.default)(filePath)) {
70
+ if ((0, _isglob.default)(filePath)) {
67
71
  Object.assign(contentPath, (0, _parseGlob.parseGlob)(filePath));
68
72
  }
69
73
  return contentPath;
@@ -77,10 +81,10 @@ function parseCandidateFiles(context, tailwindConfig) {
77
81
  // Afaik, this technically shouldn't be needed but there's probably
78
82
  // some internal, direct path matching with a normalized path in
79
83
  // a package which can't handle mixed directory separators
80
- let base = (0, _normalizePath.default)(contentPath.base);
84
+ let base = (0, _normalizepath.default)(contentPath.base);
81
85
  // If the user's file path contains any special characters (like parens) for instance fast-glob
82
86
  // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
83
- base = _fastGlob.default.escapePath(base);
87
+ base = _fastglob.default.escapePath(base);
84
88
  contentPath.pattern = contentPath.glob ? `${base}/${contentPath.glob}` : base;
85
89
  contentPath.pattern = contentPath.ignore ? `!${contentPath.pattern}` : contentPath.pattern;
86
90
  return contentPath;
@@ -158,7 +162,7 @@ function resolvedChangedContent(context, candidateFiles, fileModifiedMap) {
158
162
  let mTimesToCommit = new Map();
159
163
  let changedFiles = new Set();
160
164
  _sharedState.env.DEBUG && console.time("Finding changed files");
161
- let files = _fastGlob.default.sync(paths, {
165
+ let files = _fastglob.default.sync(paths, {
162
166
  absolute: true
163
167
  });
164
168
  for (let file of files){
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "defaultExtractor", {
6
6
  enumerable: true,
7
- get: ()=>defaultExtractor
7
+ get: function() {
8
+ return defaultExtractor;
9
+ }
8
10
  });
9
11
  const _featureFlags = require("../featureFlags");
10
- const _regex = /*#__PURE__*/ _interopRequireWildcard(require("./regex"));
12
+ const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
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 _interopRequireWildcard(obj, nodeInterop) {
21
+ function _interop_require_wildcard(obj, nodeInterop) {
20
22
  if (!nodeInterop && obj && obj.__esModule) {
21
23
  return obj;
22
24
  }
@@ -77,7 +79,7 @@ function* buildRegExps(context) {
77
79
  // This is a targeted fix to continue to allow theme()
78
80
  // with square brackets to work in arbitrary properties
79
81
  // while fixing a problem with the regex matching too much
80
- /\[[^\s:'"`]+:[^\s]+?\[[^\s]+?\][^\s]+?\]/,
82
+ /\[[^\s:'"`]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
81
83
  // Utilities
82
84
  _regex.pattern([
83
85
  // Utility Name / Group Name
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  function isRoot(node) {
10
12
  return node.type === "root";
@@ -4,19 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
- const _dlv = /*#__PURE__*/ _interopRequireDefault(require("dlv"));
10
- const _didyoumean = /*#__PURE__*/ _interopRequireDefault(require("didyoumean"));
11
- const _transformThemeValue = /*#__PURE__*/ _interopRequireDefault(require("../util/transformThemeValue"));
12
- const _postcssValueParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-value-parser"));
11
+ const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv"));
12
+ const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean"));
13
+ const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue"));
14
+ const _postcssvalueparser = /*#__PURE__*/ _interop_require_default(require("postcss-value-parser"));
13
15
  const _normalizeScreens = require("../util/normalizeScreens");
14
- const _buildMediaQuery = /*#__PURE__*/ _interopRequireDefault(require("../util/buildMediaQuery"));
16
+ const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
15
17
  const _toPath = require("../util/toPath");
16
18
  const _withAlphaVariable = require("../util/withAlphaVariable");
17
19
  const _pluginUtils = require("../util/pluginUtils");
18
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
19
- function _interopRequireDefault(obj) {
20
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
21
+ function _interop_require_default(obj) {
20
22
  return obj && obj.__esModule ? obj : {
21
23
  default: obj
22
24
  };
@@ -86,22 +88,22 @@ function validatePath(config, path, defaultValue, themeOpts = {}) {
86
88
  };
87
89
  }
88
90
  if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) {
89
- let error1 = `'${pathString}' was found but does not resolve to a string.`;
91
+ let error = `'${pathString}' was found but does not resolve to a string.`;
90
92
  if (isObject(value)) {
91
- let validKeys1 = Object.keys(value).filter((key)=>validatePath(config, [
93
+ let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
92
94
  ...pathSegments,
93
95
  key
94
96
  ]).isValid);
95
- if (validKeys1.length) {
96
- error1 += ` Did you mean something like '${pathToString([
97
+ if (validKeys.length) {
98
+ error += ` Did you mean something like '${pathToString([
97
99
  ...pathSegments,
98
- validKeys1[0]
100
+ validKeys[0]
99
101
  ])}'?`;
100
102
  }
101
103
  }
102
104
  return {
103
105
  isValid: false,
104
- error: error1
106
+ error
105
107
  };
106
108
  }
107
109
  const [themeSection] = pathSegments;
@@ -119,7 +121,7 @@ function extractArgs(node, vNodes, functions) {
119
121
  if (vNode.type === "div" && vNode.value === ",") {
120
122
  args.push("");
121
123
  } else {
122
- args[args.length - 1] += _postcssValueParser.default.stringify(vNode);
124
+ args[args.length - 1] += _postcssvalueparser.default.stringify(vNode);
123
125
  }
124
126
  }
125
127
  return args;
@@ -133,7 +135,7 @@ function resolveVNode(node, vNode, functions) {
133
135
  return vNode;
134
136
  }
135
137
  function resolveFunctions(node, input, functions) {
136
- return (0, _postcssValueParser.default)(input).walk((vNode)=>{
138
+ return (0, _postcssvalueparser.default)(input).walk((vNode)=>{
137
139
  resolveVNode(node, vNode, functions);
138
140
  }).toString();
139
141
  }
@@ -4,14 +4,17 @@ 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
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
11
13
  const _generateRules = require("./generateRules");
12
- const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("../util/escapeClassName"));
14
+ const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
13
15
  const _applyImportantSelector = require("../util/applyImportantSelector");
14
- function _interopRequireDefault(obj) {
16
+ const _pseudoElements = require("../util/pseudoElements");
17
+ function _interop_require_default(obj) {
15
18
  return obj && obj.__esModule ? obj : {
16
19
  default: obj
17
20
  };
@@ -24,7 +27,7 @@ function _interopRequireDefault(obj) {
24
27
  ]
25
28
  });
26
29
  container.walkRules((rule)=>{
27
- (0, _postcssSelectorParser.default)((selectors)=>{
30
+ (0, _postcssselectorparser.default)((selectors)=>{
28
31
  selectors.walkClasses((classSelector)=>{
29
32
  let parentSelector = classSelector.parent.toString();
30
33
  let classes = groups.get(parentSelector);
@@ -41,7 +44,7 @@ function _interopRequireDefault(obj) {
41
44
  groups: normalizedGroups
42
45
  });
43
46
  }
44
- let selectorExtractor = (0, _postcssSelectorParser.default)();
47
+ let selectorExtractor = (0, _postcssselectorparser.default)();
45
48
  /**
46
49
  * @param {string} ruleSelectors
47
50
  */ function extractSelectors(ruleSelectors) {
@@ -310,11 +313,11 @@ function processApply(root, context, localCache) {
310
313
  // Sort tag names before class names (but only sort each group (separated by a combinator)
311
314
  // separately and not in total)
312
315
  // This happens when replacing `.bar` in `.foo.bar` with a tag like `section`
313
- for (let sel1 of replaced){
316
+ for (let sel of replaced){
314
317
  let groups = [
315
318
  []
316
319
  ];
317
- for (let node of sel1.nodes){
320
+ for (let node of sel.nodes){
318
321
  if (node.type === "combinator") {
319
322
  groups.push(node);
320
323
  groups.push([]);
@@ -323,7 +326,7 @@ function processApply(root, context, localCache) {
323
326
  last.push(node);
324
327
  }
325
328
  }
326
- sel1.nodes = [];
329
+ sel.nodes = [];
327
330
  for (let group of groups){
328
331
  if (Array.isArray(group)) {
329
332
  group.sort((a, b)=>{
@@ -339,7 +342,7 @@ function processApply(root, context, localCache) {
339
342
  return 0;
340
343
  });
341
344
  }
342
- sel1.nodes = sel1.nodes.concat(group);
345
+ sel.nodes = sel.nodes.concat(group);
343
346
  }
344
347
  }
345
348
  sel.replaceWith(...replaced);
@@ -357,15 +360,15 @@ function processApply(root, context, localCache) {
357
360
  candidates,
358
361
  apply.source
359
362
  ]);
360
- let [applyCandidates1, important] = extractApplyCandidates(apply.params);
363
+ let [applyCandidates, important] = extractApplyCandidates(apply.params);
361
364
  if (apply.parent.type === "atrule") {
362
365
  if (apply.parent.name === "screen") {
363
366
  let screenType = apply.parent.params;
364
- throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates1.map((c)=>`${screenType}:${c}`).join(" ")} instead.`);
367
+ throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates.map((c)=>`${screenType}:${c}`).join(" ")} instead.`);
365
368
  }
366
369
  throw apply.error(`@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.`);
367
370
  }
368
- for (let applyCandidate of applyCandidates1){
371
+ for (let applyCandidate of applyCandidates){
369
372
  if ([
370
373
  prefix(context, "group"),
371
374
  prefix(context, "peer")
@@ -384,16 +387,16 @@ function processApply(root, context, localCache) {
384
387
  ]);
385
388
  }
386
389
  }
387
- for (let [parent, [candidates1, atApplySource]] of perParentApplies){
390
+ for (let [parent, [candidates, atApplySource]] of perParentApplies){
388
391
  let siblings = [];
389
- for (let [applyCandidate1, important1, rules1] of candidates1){
392
+ for (let [applyCandidate, important, rules] of candidates){
390
393
  let potentialApplyCandidates = [
391
- applyCandidate1,
394
+ applyCandidate,
392
395
  ...extractBaseCandidates([
393
- applyCandidate1
396
+ applyCandidate
394
397
  ], context.tailwindConfig.separator)
395
398
  ];
396
- for (let [meta, node] of rules1){
399
+ for (let [meta, node] of rules){
397
400
  let parentClasses = extractClasses(parent);
398
401
  let nodeClasses = extractClasses(node);
399
402
  // When we encounter a rule like `.dark .a, .b { … }` we only want to be left with `[.dark, .a]` if the base applyCandidate is `.a` or with `[.b]` if the base applyCandidate is `.b`
@@ -424,20 +427,20 @@ function processApply(root, context, localCache) {
424
427
  nodeClasses = nodeClasses.concat(extractBaseCandidates(nodeClasses, context.tailwindConfig.separator));
425
428
  let intersects = parentClasses.some((selector)=>nodeClasses.includes(selector));
426
429
  if (intersects) {
427
- throw node.error(`You cannot \`@apply\` the \`${applyCandidate1}\` utility here because it creates a circular dependency.`);
430
+ throw node.error(`You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.`);
428
431
  }
429
- let root1 = _postcss.default.root({
432
+ let root = _postcss.default.root({
430
433
  nodes: [
431
434
  node.clone()
432
435
  ]
433
436
  });
434
437
  // Make sure every node in the entire tree points back at the @apply rule that generated it
435
- root1.walk((node)=>{
438
+ root.walk((node)=>{
436
439
  node.source = atApplySource;
437
440
  });
438
441
  let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes";
439
442
  if (canRewriteSelector) {
440
- root1.walkRules((rule)=>{
443
+ root.walkRules((rule)=>{
441
444
  // Let's imagine you have the following structure:
442
445
  //
443
446
  // .foo {
@@ -469,7 +472,7 @@ function processApply(root, context, localCache) {
469
472
  // would have replaced this with something that didn't exist and
470
473
  // therefore it removed the selector altogether. In this specific
471
474
  // case it would result in `{}` instead of `.something-unrelated {}`
472
- if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate1)) {
475
+ if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate)) {
473
476
  rule.remove();
474
477
  return;
475
478
  }
@@ -479,25 +482,29 @@ function processApply(root, context, localCache) {
479
482
  // We do *not* want to do this for user CSS that happens to be structured the same
480
483
  let isGenerated = parent.raws.tailwind !== undefined;
481
484
  let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector;
482
- rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate1);
485
+ rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate);
483
486
  // And then re-add it if it was removed
484
487
  if (importantSelector && parentSelector !== parent.selector) {
485
488
  rule.selector = (0, _applyImportantSelector.applyImportantSelector)(rule.selector, importantSelector);
486
489
  }
487
490
  rule.walkDecls((d)=>{
488
- d.important = meta.important || important1;
491
+ d.important = meta.important || important;
489
492
  });
493
+ // Move pseudo elements to the end of the selector (if necessary)
494
+ let selector = (0, _postcssselectorparser.default)().astSync(rule.selector);
495
+ selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
496
+ rule.selector = selector.toString();
490
497
  });
491
498
  }
492
499
  // It could be that the node we were inserted was removed because the class didn't match
493
500
  // If that was the *only* rule in the parent, then we have nothing add so we skip it
494
- if (!root1.nodes[0]) {
501
+ if (!root.nodes[0]) {
495
502
  continue;
496
503
  }
497
504
  // Insert it
498
505
  siblings.push([
499
506
  meta.sort,
500
- root1.nodes[0]
507
+ root.nodes[0]
501
508
  ]);
502
509
  }
503
510
  }
@@ -506,13 +513,13 @@ function processApply(root, context, localCache) {
506
513
  // `parent` refers to the node at `.abc` in: .abc { @apply mt-2 }
507
514
  parent.after(nodes);
508
515
  }
509
- for (let apply1 of applies){
516
+ for (let apply of applies){
510
517
  // If there are left-over declarations, just remove the @apply
511
- if (apply1.parent.nodes.length > 1) {
512
- apply1.remove();
518
+ if (apply.parent.nodes.length > 1) {
519
+ apply.remove();
513
520
  } else {
514
521
  // The node is empty, drop the full node
515
- apply1.parent.remove();
522
+ apply.parent.remove();
516
523
  }
517
524
  }
518
525
  // Do it again, in case we have other `@apply` rules
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>expandTailwindAtRules
7
+ get: function() {
8
+ return expandTailwindAtRules;
9
+ }
8
10
  });
9
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
- const _quickLru = /*#__PURE__*/ _interopRequireDefault(require("quick-lru"));
11
- const _sharedState = /*#__PURE__*/ _interopRequireWildcard(require("./sharedState"));
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru"));
13
+ const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
12
14
  const _generateRules = require("./generateRules");
13
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
14
- const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("../util/cloneNodes"));
15
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
16
+ const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes"));
15
17
  const _defaultExtractor = require("./defaultExtractor");
16
- function _interopRequireDefault(obj) {
18
+ function _interop_require_default(obj) {
17
19
  return obj && obj.__esModule ? obj : {
18
20
  default: obj
19
21
  };
@@ -26,7 +28,7 @@ function _getRequireWildcardCache(nodeInterop) {
26
28
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
27
29
  })(nodeInterop);
28
30
  }
29
- function _interopRequireWildcard(obj, nodeInterop) {
31
+ function _interop_require_wildcard(obj, nodeInterop) {
30
32
  if (!nodeInterop && obj && obj.__esModule) {
31
33
  return obj;
32
34
  }
@@ -79,7 +81,7 @@ let extractorCache = new WeakMap();
79
81
  // up these regexes by 50% that could cut initial build time by like 20%.
80
82
  function getClassCandidates(content, extractor, candidates, seen) {
81
83
  if (!extractorCache.has(extractor)) {
82
- extractorCache.set(extractor, new _quickLru.default({
84
+ extractorCache.set(extractor, new _quicklru.default({
83
85
  maxSize: 25000
84
86
  }));
85
87
  }
@@ -96,8 +98,8 @@ function getClassCandidates(content, extractor, candidates, seen) {
96
98
  } else {
97
99
  let extractorMatches = extractor(line).filter((s)=>s !== "!*");
98
100
  let lineMatchesSet = new Set(extractorMatches);
99
- for (let match1 of lineMatchesSet){
100
- candidates.add(match1);
101
+ for (let match of lineMatchesSet){
102
+ candidates.add(match);
101
103
  }
102
104
  extractorCache.get(extractor).set(line, lineMatchesSet);
103
105
  }
@@ -152,7 +154,7 @@ function expandTailwindAtRules(context) {
152
154
  ]);
153
155
  let seen = new Set();
154
156
  env.DEBUG && console.time("Reading changed files");
155
- if (env.OXIDE) {
157
+ if (false) {
156
158
  // TODO: Pass through or implement `extractor`
157
159
  for (let candidate of require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)){
158
160
  candidates.add(candidate);
@@ -176,7 +178,7 @@ function expandTailwindAtRules(context) {
176
178
  let classCacheCount = context.classCache.size;
177
179
  env.DEBUG && console.time("Generate rules");
178
180
  env.DEBUG && console.time("Sorting candidates");
179
- let sortedCandidates = env.OXIDE ? candidates : new Set([
181
+ let sortedCandidates = false ? candidates : new Set([
180
182
  ...candidates
181
183
  ].sort((a, z)=>{
182
184
  if (a === z) return 0;
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "findAtConfigPath", {
6
6
  enumerable: true,
7
- get: ()=>findAtConfigPath
7
+ get: function() {
8
+ return findAtConfigPath;
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
  };