tailwindcss 0.0.0-insiders.4c34b2e → 0.0.0-insiders.4c6fbd7

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 (73) hide show
  1. package/lib/cli/build/plugin.js +9 -11
  2. package/lib/cli/build/utils.js +7 -7
  3. package/lib/cli/build/watching.js +1 -1
  4. package/lib/cli/index.js +2 -2
  5. package/lib/corePluginList.js +3 -1
  6. package/lib/corePlugins.js +94 -11
  7. package/lib/css/preflight.css +14 -7
  8. package/lib/featureFlags.js +8 -9
  9. package/lib/lib/cacheInvalidation.js +3 -1
  10. package/lib/lib/collapseAdjacentRules.js +4 -2
  11. package/lib/lib/content.js +36 -3
  12. package/lib/lib/defaultExtractor.js +36 -26
  13. package/lib/lib/evaluateTailwindFunctions.js +2 -2
  14. package/lib/lib/expandApplyAtRules.js +6 -0
  15. package/lib/lib/expandTailwindAtRules.js +34 -33
  16. package/lib/lib/generateRules.js +42 -25
  17. package/lib/lib/load-config.js +14 -3
  18. package/lib/lib/regex.js +12 -12
  19. package/lib/lib/resolveDefaultsAtRules.js +6 -4
  20. package/lib/lib/setupContextUtils.js +82 -67
  21. package/lib/lib/setupTrackingContext.js +1 -2
  22. package/lib/lib/sharedState.js +12 -12
  23. package/lib/plugin.js +4 -2
  24. package/lib/postcss-plugins/nesting/plugin.js +2 -2
  25. package/lib/util/cloneNodes.js +33 -13
  26. package/lib/util/color.js +4 -4
  27. package/lib/util/dataTypes.js +92 -33
  28. package/lib/util/defaults.js +4 -4
  29. package/lib/util/escapeClassName.js +2 -2
  30. package/lib/util/formatVariantSelector.js +12 -7
  31. package/lib/util/getAllConfigs.js +1 -2
  32. package/lib/util/isPlainObject.js +1 -1
  33. package/lib/util/log.js +3 -3
  34. package/lib/util/normalizeConfig.js +15 -18
  35. package/lib/util/normalizeScreens.js +4 -4
  36. package/lib/util/parseBoxShadowValue.js +3 -3
  37. package/lib/util/pluginUtils.js +24 -11
  38. package/lib/util/pseudoElements.js +3 -0
  39. package/lib/util/resolveConfig.js +44 -41
  40. package/lib/util/withAlphaVariable.js +3 -3
  41. package/nesting/index.d.ts +4 -0
  42. package/package.json +21 -20
  43. package/resolveConfig.d.ts +22 -3
  44. package/scripts/generate-types.js +1 -2
  45. package/scripts/release-notes.js +1 -1
  46. package/src/cli/build/plugin.js +5 -8
  47. package/src/cli/build/watching.js +1 -1
  48. package/src/corePluginList.js +1 -1
  49. package/src/corePlugins.js +66 -6
  50. package/src/css/preflight.css +14 -7
  51. package/src/featureFlags.js +1 -5
  52. package/src/lib/content.js +42 -1
  53. package/src/lib/defaultExtractor.js +30 -17
  54. package/src/lib/expandApplyAtRules.js +7 -0
  55. package/src/lib/expandTailwindAtRules.js +39 -32
  56. package/src/lib/generateRules.js +34 -18
  57. package/src/lib/load-config.ts +8 -0
  58. package/src/lib/resolveDefaultsAtRules.js +5 -1
  59. package/src/lib/setupContextUtils.js +58 -33
  60. package/src/plugin.js +1 -1
  61. package/src/util/cloneNodes.js +35 -14
  62. package/src/util/color.js +1 -1
  63. package/src/util/dataTypes.js +75 -11
  64. package/src/util/formatVariantSelector.js +7 -0
  65. package/src/util/isPlainObject.js +1 -1
  66. package/src/util/pluginUtils.js +16 -0
  67. package/src/util/pseudoElements.js +4 -0
  68. package/src/util/resolveConfig.js +42 -24
  69. package/stubs/config.full.js +73 -7
  70. package/types/config.d.ts +13 -3
  71. package/types/generated/corePluginList.d.ts +1 -1
  72. package/types/generated/default-theme.d.ts +34 -9
  73. package/types/index.d.ts +7 -3
@@ -61,7 +61,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
61
61
  if (cache && cache.has(obj)) {
62
62
  return cache.get(obj);
63
63
  }
64
- var newObj = {};
64
+ var newObj = {
65
+ __proto__: null
66
+ };
65
67
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
66
68
  for(var key in obj){
67
69
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -96,14 +98,11 @@ async function lightningcss(result, { map = true, minify = true } = {}) {
96
98
  sourceMap: result.map === undefined ? map : !!result.map,
97
99
  inputSourceMap: result.map ? result.map.toString() : undefined,
98
100
  targets: _lightningcss.default.browserslistToTargets((0, _browserslist.default)(browsersListConfig)),
99
- drafts: {
100
- nesting: true
101
- },
102
101
  include: _lightningcss.Features.Nesting,
103
102
  exclude: _lightningcss.Features.LogicalProperties
104
103
  });
105
104
  return Object.assign(result, {
106
- css: transformed.code.toString('utf8'),
105
+ css: transformed.code.toString(),
107
106
  map: result.map ? Object.assign(result.map, {
108
107
  toString () {
109
108
  var _transformed_map;
@@ -180,7 +179,6 @@ let state = {
180
179
  };
181
180
  },
182
181
  loadConfig (configPath, content) {
183
- var _content;
184
182
  if (this.watcher && configPath) {
185
183
  this.refreshConfigDependencies();
186
184
  }
@@ -197,7 +195,7 @@ let state = {
197
195
  };
198
196
  this.configBag.config = (0, _validateConfig.validateConfig)((0, _resolveConfig.default)(this.configBag.config));
199
197
  // Override content files if `--content` has been passed explicitly
200
- if (((_content = content) === null || _content === void 0 ? void 0 : _content.length) > 0) {
198
+ if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
201
199
  this.configBag.config.content.files = content;
202
200
  }
203
201
  return this.configBag.config;
@@ -239,14 +237,14 @@ let state = {
239
237
  return content;
240
238
  },
241
239
  getContext ({ createContext, cliConfigPath, root, result, content }) {
242
- if (this.context) {
243
- this.context.changedContent = this.changedContent.splice(0);
244
- return this.context;
245
- }
246
240
  _sharedState.env.DEBUG && console.time('Searching for config');
247
241
  var _findAtConfigPath1;
248
242
  let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath;
249
243
  _sharedState.env.DEBUG && console.timeEnd('Searching for config');
244
+ if (this.context) {
245
+ this.context.changedContent = this.changedContent.splice(0);
246
+ return this.context;
247
+ }
250
248
  _sharedState.env.DEBUG && console.time('Loading config');
251
249
  let config = this.loadConfig(configPath, content);
252
250
  _sharedState.env.DEBUG && console.timeEnd('Loading config');
@@ -10,20 +10,20 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- indentRecursive: function() {
14
- return indentRecursive;
13
+ drainStdin: function() {
14
+ return drainStdin;
15
15
  },
16
16
  formatNodes: function() {
17
17
  return formatNodes;
18
18
  },
19
- readFileWithRetries: function() {
20
- return readFileWithRetries;
21
- },
22
- drainStdin: function() {
23
- return drainStdin;
19
+ indentRecursive: function() {
20
+ return indentRecursive;
24
21
  },
25
22
  outputFile: function() {
26
23
  return outputFile;
24
+ },
25
+ readFileWithRetries: function() {
26
+ return readFileWithRetries;
27
27
  }
28
28
  });
29
29
  const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
@@ -126,7 +126,7 @@ function createWatcher(args, { state, rebuild }) {
126
126
  // This is very likely a chokidar bug but it's one we need to work around
127
127
  // We treat this as a change event and rebuild the CSS
128
128
  watcher.on('raw', (evt, filePath, meta)=>{
129
- if (evt !== 'rename') {
129
+ if (evt !== 'rename' || filePath === null) {
130
130
  return;
131
131
  }
132
132
  let watchedPath = meta.watchedPath;
package/lib/cli/index.js CHANGED
@@ -151,8 +151,8 @@ let args = (()=>{
151
151
  ...flags,
152
152
  ...sharedFlags
153
153
  }).filter(([_key, value])=>{
154
- var _value_type, _value;
155
- return !((_value = value) === null || _value === void 0 ? void 0 : (_value_type = _value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
154
+ var _value_type;
155
+ return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
156
156
  }).map(([key, value])=>[
157
157
  key,
158
158
  typeof value === 'object' ? value.type : value
@@ -32,6 +32,7 @@ const _default = [
32
32
  "lineClamp",
33
33
  "display",
34
34
  "aspectRatio",
35
+ "size",
35
36
  "height",
36
37
  "maxHeight",
37
38
  "minHeight",
@@ -184,5 +185,6 @@ const _default = [
184
185
  "transitionDuration",
185
186
  "transitionTimingFunction",
186
187
  "willChange",
187
- "content"
188
+ "content",
189
+ "forcedColorAdjust"
188
190
  ];
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- variantPlugins: function() {
13
- return variantPlugins;
14
- },
15
12
  corePlugins: function() {
16
13
  return corePlugins;
14
+ },
15
+ variantPlugins: function() {
16
+ return variantPlugins;
17
17
  }
18
18
  });
19
19
  const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
@@ -61,7 +61,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
61
61
  if (cache && cache.has(obj)) {
62
62
  return cache.get(obj);
63
63
  }
64
- var newObj = {};
64
+ var newObj = {
65
+ __proto__: null
66
+ };
65
67
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
66
68
  for(var key in obj){
67
69
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -80,6 +82,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
80
82
  return newObj;
81
83
  }
82
84
  let variantPlugins = {
85
+ childVariant: ({ addVariant })=>{
86
+ addVariant('*', '& > *');
87
+ },
83
88
  pseudoElementVariants: ({ addVariant })=>{
84
89
  addVariant('first-letter', '&::first-letter');
85
90
  addVariant('first-line', '&::first-line');
@@ -263,15 +268,15 @@ let variantPlugins = {
263
268
  }
264
269
  },
265
270
  directionVariants: ({ addVariant })=>{
266
- addVariant('ltr', ':is([dir="ltr"] &)');
267
- addVariant('rtl', ':is([dir="rtl"] &)');
271
+ addVariant('ltr', '&:where([dir="ltr"], [dir="ltr"] *)');
272
+ addVariant('rtl', '&:where([dir="rtl"], [dir="rtl"] *)');
268
273
  },
269
274
  reducedMotionVariants: ({ addVariant })=>{
270
275
  addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)');
271
276
  addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)');
272
277
  },
273
278
  darkVariants: ({ config, addVariant })=>{
274
- let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'));
279
+ let [mode, selector = '.dark'] = [].concat(config('darkMode', 'media'));
275
280
  if (mode === false) {
276
281
  mode = 'media';
277
282
  _log.default.warn('darkmode-false', [
@@ -280,10 +285,48 @@ let variantPlugins = {
280
285
  'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration'
281
286
  ]);
282
287
  }
283
- if (mode === 'class') {
284
- addVariant('dark', `:is(${className} &)`);
288
+ if (mode === 'variant') {
289
+ let formats;
290
+ if (Array.isArray(selector)) {
291
+ formats = selector;
292
+ } else if (typeof selector === 'function') {
293
+ formats = selector;
294
+ } else if (typeof selector === 'string') {
295
+ formats = [
296
+ selector
297
+ ];
298
+ }
299
+ // TODO: We could also add these warnings if the user passes a function that returns string | string[]
300
+ // But this is an advanced enough use case that it's probably not necessary
301
+ if (Array.isArray(formats)) {
302
+ for (let format of formats){
303
+ if (format === '.dark') {
304
+ mode = false;
305
+ _log.default.warn('darkmode-variant-without-selector', [
306
+ 'When using `variant` for `darkMode`, you must provide a selector.',
307
+ 'Example: `darkMode: ["variant", ".your-selector &"]`'
308
+ ]);
309
+ } else if (!format.includes('&')) {
310
+ mode = false;
311
+ _log.default.warn('darkmode-variant-without-ampersand', [
312
+ 'When using `variant` for `darkMode`, your selector must contain `&`.',
313
+ 'Example `darkMode: ["variant", ".your-selector &"]`'
314
+ ]);
315
+ }
316
+ }
317
+ }
318
+ selector = formats;
319
+ }
320
+ if (mode === 'selector') {
321
+ // New preferred behavior
322
+ addVariant('dark', `&:where(${selector}, ${selector} *)`);
285
323
  } else if (mode === 'media') {
286
324
  addVariant('dark', '@media (prefers-color-scheme: dark)');
325
+ } else if (mode === 'variant') {
326
+ addVariant('dark', selector);
327
+ } else if (mode === 'class') {
328
+ // Old behavior
329
+ addVariant('dark', `:is(${selector} &)`);
287
330
  }
288
331
  },
289
332
  printVariant: ({ addVariant })=>{
@@ -401,7 +444,7 @@ let variantPlugins = {
401
444
  matchVariant('supports', (value = '')=>{
402
445
  let check = (0, _dataTypes.normalize)(value);
403
446
  let isRaw = /^\w*\s*\(/.test(check);
404
- // Chrome has a bug where `(condtion1)or(condition2)` is not valid
447
+ // Chrome has a bug where `(condition1)or(condition2)` is not valid
405
448
  // But `(condition1) or (condition2)` is supported.
406
449
  check = isRaw ? check.replace(/\b(and|or|not)\b/g, ' $1 ') : check;
407
450
  if (isRaw) {
@@ -464,6 +507,9 @@ let variantPlugins = {
464
507
  prefersContrastVariants: ({ addVariant })=>{
465
508
  addVariant('contrast-more', '@media (prefers-contrast: more)');
466
509
  addVariant('contrast-less', '@media (prefers-contrast: less)');
510
+ },
511
+ forcedColorsVariants: ({ addVariant })=>{
512
+ addVariant('forced-colors', '@media (forced-colors: active)');
467
513
  }
468
514
  };
469
515
  let cssTransformValue = [
@@ -779,6 +825,12 @@ let corePlugins = {
779
825
  ]),
780
826
  float: ({ addUtilities })=>{
781
827
  addUtilities({
828
+ '.float-start': {
829
+ float: 'inline-start'
830
+ },
831
+ '.float-end': {
832
+ float: 'inline-end'
833
+ },
782
834
  '.float-right': {
783
835
  float: 'right'
784
836
  },
@@ -792,6 +844,12 @@ let corePlugins = {
792
844
  },
793
845
  clear: ({ addUtilities })=>{
794
846
  addUtilities({
847
+ '.clear-start': {
848
+ clear: 'inline-start'
849
+ },
850
+ '.clear-end': {
851
+ clear: 'inline-end'
852
+ },
795
853
  '.clear-left': {
796
854
  clear: 'left'
797
855
  },
@@ -975,6 +1033,15 @@ let corePlugins = {
975
1033
  ]
976
1034
  ]
977
1035
  ]),
1036
+ size: (0, _createUtilityPlugin.default)('size', [
1037
+ [
1038
+ 'size',
1039
+ [
1040
+ 'width',
1041
+ 'height'
1042
+ ]
1043
+ ]
1044
+ ]),
978
1045
  height: (0, _createUtilityPlugin.default)('height', [
979
1046
  [
980
1047
  'h',
@@ -1618,6 +1685,9 @@ let corePlugins = {
1618
1685
  addUtilities({
1619
1686
  '.appearance-none': {
1620
1687
  appearance: 'none'
1688
+ },
1689
+ '.appearance-auto': {
1690
+ appearance: 'auto'
1621
1691
  }
1622
1692
  });
1623
1693
  },
@@ -2312,6 +2382,9 @@ let corePlugins = {
2312
2382
  },
2313
2383
  '.text-balance': {
2314
2384
  'text-wrap': 'balance'
2385
+ },
2386
+ '.text-pretty': {
2387
+ 'text-wrap': 'pretty'
2315
2388
  }
2316
2389
  });
2317
2390
  },
@@ -4191,5 +4264,15 @@ let corePlugins = {
4191
4264
  ]
4192
4265
  ]
4193
4266
  ]
4194
- ])
4267
+ ]),
4268
+ forcedColorAdjust: ({ addUtilities })=>{
4269
+ addUtilities({
4270
+ '.forced-color-adjust-auto': {
4271
+ 'forced-color-adjust': 'auto'
4272
+ },
4273
+ '.forced-color-adjust-none': {
4274
+ 'forced-color-adjust': 'none'
4275
+ }
4276
+ });
4277
+ }
4195
4278
  };
@@ -24,9 +24,11 @@
24
24
  4. Use the user's configured `sans` font-family by default.
25
25
  5. Use the user's configured `sans` font-feature-settings by default.
26
26
  6. Use the user's configured `sans` font-variation-settings by default.
27
+ 7. Disable tap highlights on iOS.
27
28
  */
28
29
 
29
- html {
30
+ html,
31
+ :host {
30
32
  line-height: 1.5; /* 1 */
31
33
  -webkit-text-size-adjust: 100%; /* 2 */
32
34
  -moz-tab-size: 4; /* 3 */
@@ -34,6 +36,7 @@ html {
34
36
  font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
35
37
  font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
36
38
  font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
39
+ -webkit-tap-highlight-color: transparent; /* 7 */
37
40
  }
38
41
 
39
42
  /*
@@ -99,8 +102,10 @@ strong {
99
102
  }
100
103
 
101
104
  /*
102
- 1. Use the user's configured `mono` font family by default.
103
- 2. Correct the odd `em` font sizing in all browsers.
105
+ 1. Use the user's configured `mono` font-family by default.
106
+ 2. Use the user's configured `mono` font-feature-settings by default.
107
+ 3. Use the user's configured `mono` font-variation-settings by default.
108
+ 4. Correct the odd `em` font sizing in all browsers.
104
109
  */
105
110
 
106
111
  code,
@@ -108,7 +113,9 @@ kbd,
108
113
  samp,
109
114
  pre {
110
115
  font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
111
- font-size: 1em; /* 2 */
116
+ font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */
117
+ font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */
118
+ font-size: 1em; /* 4 */
112
119
  }
113
120
 
114
121
  /*
@@ -188,9 +195,9 @@ select {
188
195
  */
189
196
 
190
197
  button,
191
- [type='button'],
192
- [type='reset'],
193
- [type='submit'] {
198
+ input:where([type='button']),
199
+ input:where([type='reset']),
200
+ input:where([type='submit']) {
194
201
  -webkit-appearance: button; /* 1 */
195
202
  background-color: transparent; /* 2 */
196
203
  background-image: none; /* 2 */
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ default: function() {
13
+ return _default;
14
+ },
12
15
  featureFlags: function() {
13
16
  return featureFlags;
14
17
  },
@@ -17,9 +20,6 @@ _export(exports, {
17
20
  },
18
21
  issueFlagNotices: function() {
19
22
  return issueFlagNotices;
20
- },
21
- default: function() {
22
- return _default;
23
23
  }
24
24
  });
25
25
  const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
@@ -51,24 +51,23 @@ let featureFlags = {
51
51
  };
52
52
  function flagEnabled(config, flag) {
53
53
  if (featureFlags.future.includes(flag)) {
54
- var _config_future, _config;
54
+ var _config_future;
55
55
  var _config_future_flag, _ref;
56
- return config.future === 'all' || ((_ref = (_config_future_flag = (_config = config) === null || _config === void 0 ? void 0 : (_config_future = _config.future) === null || _config_future === void 0 ? void 0 : _config_future[flag]) !== null && _config_future_flag !== void 0 ? _config_future_flag : defaults[flag]) !== null && _ref !== void 0 ? _ref : false);
56
+ return config.future === 'all' || ((_ref = (_config_future_flag = config === null || config === void 0 ? void 0 : (_config_future = config.future) === null || _config_future === void 0 ? void 0 : _config_future[flag]) !== null && _config_future_flag !== void 0 ? _config_future_flag : defaults[flag]) !== null && _ref !== void 0 ? _ref : false);
57
57
  }
58
58
  if (featureFlags.experimental.includes(flag)) {
59
- var _config_experimental, _config1;
59
+ var _config_experimental;
60
60
  var _config_experimental_flag, _ref1;
61
- return config.experimental === 'all' || ((_ref1 = (_config_experimental_flag = (_config1 = config) === null || _config1 === void 0 ? void 0 : (_config_experimental = _config1.experimental) === null || _config_experimental === void 0 ? void 0 : _config_experimental[flag]) !== null && _config_experimental_flag !== void 0 ? _config_experimental_flag : defaults[flag]) !== null && _ref1 !== void 0 ? _ref1 : false);
61
+ return config.experimental === 'all' || ((_ref1 = (_config_experimental_flag = config === null || config === void 0 ? void 0 : (_config_experimental = config.experimental) === null || _config_experimental === void 0 ? void 0 : _config_experimental[flag]) !== null && _config_experimental_flag !== void 0 ? _config_experimental_flag : defaults[flag]) !== null && _ref1 !== void 0 ? _ref1 : false);
62
62
  }
63
63
  return false;
64
64
  }
65
65
  function experimentalFlagsEnabled(config) {
66
- var _config;
67
66
  if (config.experimental === 'all') {
68
67
  return featureFlags.experimental;
69
68
  }
70
69
  var _config_experimental;
71
- return Object.keys((_config_experimental = (_config = config) === null || _config === void 0 ? void 0 : _config.experimental) !== null && _config_experimental !== void 0 ? _config_experimental : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
70
+ return Object.keys((_config_experimental = config === null || config === void 0 ? void 0 : config.experimental) !== null && _config_experimental !== void 0 ? _config_experimental : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
72
71
  }
73
72
  function issueFlagNotices(config) {
74
73
  if (process.env.JEST_WORKER_ID !== undefined) {
@@ -36,7 +36,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
36
36
  if (cache && cache.has(obj)) {
37
37
  return cache.get(obj);
38
38
  }
39
- var newObj = {};
39
+ var newObj = {
40
+ __proto__: null
41
+ };
40
42
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
41
43
  for(var key in obj){
42
44
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -31,10 +31,12 @@ function collapseAdjacentRules() {
31
31
  return;
32
32
  }
33
33
  let properties = comparisonMap[node.type];
34
- var _node_property, _currentRule_property;
35
34
  if (node.type === 'atrule' && node.name === 'font-face') {
36
35
  currentRule = node;
37
- } else if (properties.every((property)=>((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : '').replace(/\s+/g, ' ') === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : '').replace(/\s+/g, ' '))) {
36
+ } else if (properties.every((property)=>{
37
+ var _node_property, _currentRule_property;
38
+ return ((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : '').replace(/\s+/g, ' ') === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : '').replace(/\s+/g, ' ');
39
+ })) {
38
40
  // An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
39
41
  if (node.nodes) {
40
42
  currentRule.append(node.nodes);
@@ -21,7 +21,6 @@ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
21
21
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
22
22
  const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
23
23
  const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
24
- const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
25
24
  const _parseGlob = require("../util/parseGlob");
26
25
  const _sharedState = require("./sharedState");
27
26
  const _oxide = require("@tailwindcss/oxide");
@@ -30,6 +29,37 @@ function _interop_require_default(obj) {
30
29
  default: obj
31
30
  };
32
31
  }
32
+ /*!
33
+ * Modified version of normalize-path, original license below
34
+ *
35
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
36
+ *
37
+ * Copyright (c) 2014-2018, Jon Schlinkert.
38
+ * Released under the MIT License.
39
+ */ function normalizePath(path) {
40
+ if (typeof path !== 'string') {
41
+ throw new TypeError('expected path to be a string');
42
+ }
43
+ if (path === '\\' || path === '/') return '/';
44
+ var len = path.length;
45
+ if (len <= 1) return path;
46
+ // ensure that win32 namespaces has two leading slashes, so that the path is
47
+ // handled properly by the win32 version of path.parse() after being normalized
48
+ // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
49
+ var prefix = '';
50
+ if (len > 4 && path[3] === '\\') {
51
+ var ch = path[2];
52
+ if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') {
53
+ path = path.slice(2);
54
+ prefix = '//';
55
+ }
56
+ }
57
+ // Modified part: instead of purely splitting on `\\` and `/`, we split on
58
+ // `/` and `\\` that is _not_ followed by any of the following characters: ()[]
59
+ // This is to ensure that we keep the escaping of brackets and parentheses
60
+ let segs = path.split(/[/\\]+(?![\(\)\[\]])/);
61
+ return prefix + segs.join('/');
62
+ }
33
63
  /** @typedef {import('../../types/config.js').RawFile} RawFile */ /** @typedef {import('../../types/config.js').FilePath} FilePath */ /*
34
64
  * @param {import('tailwindcss').Config} tailwindConfig
35
65
  * @param {{skip:string[]}} options
@@ -59,7 +89,7 @@ function parseCandidateFiles(context, tailwindConfig) {
59
89
  });
60
90
  // Normalize the file globs
61
91
  files = files.filter((filePath)=>typeof filePath === 'string');
62
- files = files.map(_normalizepath.default);
92
+ files = files.map(normalizePath);
63
93
  // Split into included and excluded globs
64
94
  let tasks = _fastglob.default.generateTasks(files);
65
95
  /** @type {ContentPath[]} */ let included = [];
@@ -86,6 +116,9 @@ function parseCandidateFiles(context, tailwindConfig) {
86
116
  * @param {boolean} ignore
87
117
  * @returns {ContentPath}
88
118
  */ function parseFilePath(filePath, ignore) {
119
+ // Escape special characters in the file path such as: ()[]
120
+ // But only if the special character isn't already escaped
121
+ filePath = filePath.replace(RegExp("(?<!\\\\)([\\[\\]\\(\\)])", "g"), '\\$1');
89
122
  let contentPath = {
90
123
  original: filePath,
91
124
  base: filePath,
@@ -107,7 +140,7 @@ function parseCandidateFiles(context, tailwindConfig) {
107
140
  // Afaik, this technically shouldn't be needed but there's probably
108
141
  // some internal, direct path matching with a normalized path in
109
142
  // a package which can't handle mixed directory separators
110
- let base = (0, _normalizepath.default)(contentPath.base);
143
+ let base = normalizePath(contentPath.base);
111
144
  // If the user's file path contains any special characters (like parens) for instance fast-glob
112
145
  // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
113
146
  base = _fastglob.default.escapePath(base);
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "defaultExtractor", {
8
8
  return defaultExtractor;
9
9
  }
10
10
  });
11
- const _featureFlags = require("../featureFlags");
12
11
  const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
13
12
  function _getRequireWildcardCache(nodeInterop) {
14
13
  if (typeof WeakMap !== "function") return null;
@@ -31,7 +30,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
31
30
  if (cache && cache.has(obj)) {
32
31
  return cache.get(obj);
33
32
  }
34
- var newObj = {};
33
+ var newObj = {
34
+ __proto__: null
35
+ };
35
36
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
36
37
  for(var key in obj){
37
38
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -57,17 +58,15 @@ function defaultExtractor(context) {
57
58
  /** @type {(string|string)[]} */ let results = [];
58
59
  for (let pattern of patterns){
59
60
  var _content_match;
60
- results = [
61
- ...results,
62
- ...(_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []
63
- ];
61
+ for (let result of (_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []){
62
+ results.push(clipAtBalancedParens(result));
63
+ }
64
64
  }
65
- return results.filter((v)=>v !== undefined).map(clipAtBalancedParens);
65
+ return results;
66
66
  };
67
67
  }
68
68
  function* buildRegExps(context) {
69
69
  let separator = context.tailwindConfig.separator;
70
- let variantGroupingEnabled = (0, _featureFlags.flagEnabled)(context.tailwindConfig, 'variantGrouping');
71
70
  let prefix = context.tailwindConfig.prefix !== '' ? _regex.optional(_regex.pattern([
72
71
  /-?/,
73
72
  _regex.escape(context.tailwindConfig.prefix)
@@ -79,16 +78,25 @@ function* buildRegExps(context) {
79
78
  // This is a targeted fix to continue to allow theme()
80
79
  // with square brackets to work in arbitrary properties
81
80
  // while fixing a problem with the regex matching too much
82
- /\[[^\s:'"`]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
81
+ /\[[^\s:'"`\]]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
83
82
  // Utilities
84
83
  _regex.pattern([
85
84
  // Utility Name / Group Name
86
- /-?(?:\w+)/,
85
+ _regex.any([
86
+ /-?(?:\w+)/,
87
+ // This is here to make sure @container supports everything that other utilities do
88
+ /@(?:\w+)/
89
+ ]),
87
90
  // Normal/Arbitrary values
88
91
  _regex.optional(_regex.any([
89
92
  _regex.pattern([
90
93
  // Arbitrary values
91
- /-(?:\w+-)*\[[^\s:]+\]/,
94
+ _regex.any([
95
+ /-(?:\w+-)*\['[^\s]+'\]/,
96
+ /-(?:\w+-)*\["[^\s]+"\]/,
97
+ /-(?:\w+-)*\[`[^\s]+`\]/,
98
+ /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/
99
+ ]),
92
100
  // Not immediately followed by an `{[(`
93
101
  /(?![{([]])/,
94
102
  // optionally followed by an opacity modifier
@@ -96,7 +104,12 @@ function* buildRegExps(context) {
96
104
  ]),
97
105
  _regex.pattern([
98
106
  // Arbitrary values
99
- /-(?:\w+-)*\[[^\s]+\]/,
107
+ _regex.any([
108
+ /-(?:\w+-)*\['[^\s]+'\]/,
109
+ /-(?:\w+-)*\["[^\s]+"\]/,
110
+ /-(?:\w+-)*\[`[^\s]+`\]/,
111
+ /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/
112
+ ]),
100
113
  // Not immediately followed by an `{[(`
101
114
  /(?![{([]])/,
102
115
  // optionally followed by an opacity modifier
@@ -115,6 +128,11 @@ function* buildRegExps(context) {
115
128
  /@\[[^\s"'`]+\](\/[^\s"'`]+)?/,
116
129
  separator
117
130
  ]),
131
+ // With variant modifier (e.g.: group-[..]/modifier)
132
+ _regex.pattern([
133
+ /([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/\w+/,
134
+ separator
135
+ ]),
118
136
  _regex.pattern([
119
137
  /([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/,
120
138
  separator
@@ -126,6 +144,11 @@ function* buildRegExps(context) {
126
144
  ]),
127
145
  // With quotes allowed
128
146
  _regex.any([
147
+ // With variant modifier (e.g.: group-[..]/modifier)
148
+ _regex.pattern([
149
+ /([^\s"'`\[\\]+-)?\[[^\s`]+\]\/\w+/,
150
+ separator
151
+ ]),
129
152
  _regex.pattern([
130
153
  /([^\s"'`\[\\]+-)?\[[^\s`]+\]/,
131
154
  separator
@@ -145,20 +168,7 @@ function* buildRegExps(context) {
145
168
  // Important (optional)
146
169
  /!?/,
147
170
  prefix,
148
- variantGroupingEnabled ? _regex.any([
149
- // Or any of those things but grouped separated by commas
150
- _regex.pattern([
151
- /\(/,
152
- utility,
153
- _regex.zeroOrMore([
154
- /,/,
155
- utility
156
- ]),
157
- /\)/
158
- ]),
159
- // Arbitrary properties, constrained utilities, arbitrary values, etc…
160
- utility
161
- ]) : utility
171
+ utility
162
172
  ]);
163
173
  }
164
174
  // 5. Inner matches