tailwindcss 0.0.0-insiders.d2fdf9e → 0.0.0-insiders.d32728b

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 (54) hide show
  1. package/CHANGELOG.md +27 -7
  2. package/lib/cli.js +44 -45
  3. package/lib/corePlugins.js +55 -46
  4. package/lib/featureFlags.js +3 -5
  5. package/lib/index.js +1 -2
  6. package/lib/lib/cacheInvalidation.js +32 -14
  7. package/lib/lib/collapseAdjacentRules.js +1 -2
  8. package/lib/lib/defaultExtractor.js +42 -26
  9. package/lib/lib/evaluateTailwindFunctions.js +8 -11
  10. package/lib/lib/expandApplyAtRules.js +11 -26
  11. package/lib/lib/expandTailwindAtRules.js +36 -22
  12. package/lib/lib/generateRules.js +43 -36
  13. package/lib/lib/regex.js +1 -2
  14. package/lib/lib/resolveDefaultsAtRules.js +56 -45
  15. package/lib/lib/setupContextUtils.js +54 -49
  16. package/lib/lib/setupTrackingContext.js +4 -9
  17. package/lib/lib/sharedState.js +1 -2
  18. package/lib/lib/substituteScreenAtRules.js +1 -2
  19. package/lib/postcss-plugins/nesting/plugin.js +1 -2
  20. package/lib/util/buildMediaQuery.js +1 -2
  21. package/lib/util/cloneDeep.js +2 -4
  22. package/lib/util/color.js +5 -10
  23. package/lib/util/createPlugin.js +1 -2
  24. package/lib/util/createUtilityPlugin.js +1 -2
  25. package/lib/util/dataTypes.js +5 -10
  26. package/lib/util/flattenColorPalette.js +2 -5
  27. package/lib/util/formatVariantSelector.js +1 -2
  28. package/lib/util/getAllConfigs.js +2 -5
  29. package/lib/util/isValidArbitraryValue.js +1 -2
  30. package/lib/util/log.js +2 -3
  31. package/lib/util/negateValue.js +1 -2
  32. package/lib/util/normalizeConfig.js +33 -16
  33. package/lib/util/normalizeScreens.js +1 -2
  34. package/lib/util/parseAnimationValue.js +1 -2
  35. package/lib/util/pluginUtils.js +11 -3
  36. package/lib/util/resolveConfig.js +10 -37
  37. package/lib/util/splitAtTopLevelOnly.js +32 -14
  38. package/lib/util/withAlphaVariable.js +5 -5
  39. package/package.json +6 -5
  40. package/src/cli.js +28 -14
  41. package/src/corePlugins.js +9 -2
  42. package/src/featureFlags.js +1 -1
  43. package/src/lib/defaultExtractor.js +7 -7
  44. package/src/lib/evaluateTailwindFunctions.js +3 -1
  45. package/src/lib/resolveDefaultsAtRules.js +53 -36
  46. package/src/lib/setupContextUtils.js +6 -2
  47. package/src/util/log.js +1 -1
  48. package/src/util/pluginUtils.js +13 -1
  49. package/src/util/resolveConfig.js +5 -33
  50. package/src/util/withAlphaVariable.js +1 -1
  51. package/stubs/defaultConfig.stub.js +1 -0
  52. package/stubs/simpleConfig.stub.js +1 -0
  53. package/types/index.d.ts +7 -1
  54. package/types.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Fixed
11
11
 
12
+ - Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576))
13
+
14
+ ## [3.1.1] - 2022-06-09
15
+
16
+ ### Fixed
17
+
18
+ - Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558))
19
+ - Split `::backdrop` into separate defaults group ([#8567](https://github.com/tailwindlabs/tailwindcss/pull/8567))
20
+ - Fix postcss plugin type ([#8564](https://github.com/tailwindlabs/tailwindcss/pull/8564))
21
+ - Fix class detection in markdown code fences and slim templates ([#8569](https://github.com/tailwindlabs/tailwindcss/pull/8569))
22
+
23
+ ## [3.1.0] - 2022-06-08
24
+
25
+ ### Fixed
26
+
12
27
  - Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926))
13
28
  - Don’t split vars with numbers in them inside arbitrary values ([#8091](https://github.com/tailwindlabs/tailwindcss/pull/8091))
14
29
  - Require matching prefix when detecting negatives ([#8121](https://github.com/tailwindlabs/tailwindcss/pull/8121))
@@ -26,17 +41,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
41
  - Fix `matchVariants` that use at-rules and placeholders ([#8392](https://github.com/tailwindlabs/tailwindcss/pull/8392))
27
42
  - Improve types of the `tailwindcss/plugin` ([#8400](https://github.com/tailwindlabs/tailwindcss/pull/8400))
28
43
  - Allow returning parallel variants from `addVariant` or `matchVariant` callback functions ([#8455](https://github.com/tailwindlabs/tailwindcss/pull/8455))
44
+ - Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
45
+ - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
46
+ - Don't inherit `to` value from parent gradients ([#8489](https://github.com/tailwindlabs/tailwindcss/pull/8489))
47
+ - Remove process dependency from log functions ([#8530](https://github.com/tailwindlabs/tailwindcss/pull/8530))
48
+ - Ensure we can use `@import 'tailwindcss/...'` without node_modules ([#8537](https://github.com/tailwindlabs/tailwindcss/pull/8537))
29
49
 
30
50
  ### Changed
31
51
 
32
- - Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
33
52
  - Only apply hover styles when supported (future) ([#8394](https://github.com/tailwindlabs/tailwindcss/pull/8394))
34
53
  - Respect default ring color opacity (future) ([#8448](https://github.com/tailwindlabs/tailwindcss/pull/8448), [3f4005e](https://github.com/tailwindlabs/tailwindcss/commit/3f4005e833445f7549219eb5ae89728cbb3a2630))
35
54
 
36
55
  ### Added
37
56
 
38
- - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
39
- - Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
40
57
  - Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
41
58
  - Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
42
59
  - Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
@@ -44,15 +61,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
44
61
  - Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102))
45
62
  - Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905))
46
63
  - Add TypeScript types for the `tailwind.config.js` file ([#7891](https://github.com/tailwindlabs/tailwindcss/pull/7891))
47
- - Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924))
64
+ - Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924), [#8526](https://github.com/tailwindlabs/tailwindcss/pull/8526))
48
65
  - Add `grid-flow-dense` utility ([#8193](https://github.com/tailwindlabs/tailwindcss/pull/8193))
49
66
  - Add `mix-blend-plus-lighter` utility ([#8288](https://github.com/tailwindlabs/tailwindcss/pull/8288))
50
67
  - Add arbitrary variants ([#8299](https://github.com/tailwindlabs/tailwindcss/pull/8299))
51
- - Add `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310))
68
+ - Add experimental `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310), [34fd0fb8](https://github.com/tailwindlabs/tailwindcss/commit/34fd0fb82aa574cddc5c7aa3ad7d1af5e3735e5d))
52
69
  - Add `prefers-contrast` media query variants ([#8410](https://github.com/tailwindlabs/tailwindcss/pull/8410))
53
- - Experimental support for variant grouping ([#8405](https://github.com/tailwindlabs/tailwindcss/pull/8405))
54
70
  - Add opacity support when referencing colors with `theme` function ([#8416](https://github.com/tailwindlabs/tailwindcss/pull/8416))
55
71
  - Add `postcss-import` support to the CLI ([#8437](https://github.com/tailwindlabs/tailwindcss/pull/8437))
72
+ - Add `optional` variant ([#8486](https://github.com/tailwindlabs/tailwindcss/pull/8486))
73
+ - Add `<alpha-value>` placeholder support for custom colors ([#8501](https://github.com/tailwindlabs/tailwindcss/pull/8501))
56
74
 
57
75
  ## [3.0.24] - 2022-04-12
58
76
 
@@ -1945,7 +1963,9 @@ No release notes
1945
1963
 
1946
1964
  - Everything!
1947
1965
 
1948
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...HEAD
1966
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.1...HEAD
1967
+ [3.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.0...v3.1.1
1968
+ [3.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.0
1949
1969
  [3.0.24]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...v3.0.24
1950
1970
  [3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23
1951
1971
  [3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22
package/lib/cli.js CHANGED
@@ -72,10 +72,8 @@ function drainStdin() {
72
72
  process.stdin.on("data", (chunk)=>{
73
73
  result += chunk;
74
74
  });
75
- process.stdin.on("end", ()=>resolve(result)
76
- );
77
- process.stdin.on("error", (err)=>reject(err)
78
- );
75
+ process.stdin.on("end", ()=>resolve(result));
76
+ process.stdin.on("error", (err)=>reject(err));
79
77
  });
80
78
  }
81
79
  function help({ message , usage , commands: commands1 , options }) {
@@ -166,10 +164,6 @@ let commands = {
166
164
  type: Boolean,
167
165
  description: `Initialize a \`${configs.postcss}\` file`
168
166
  },
169
- "--types": {
170
- type: Boolean,
171
- description: `Add TypeScript types for the \`${configs.tailwind}\` file`
172
- },
173
167
  "-f": "--full",
174
168
  "-p": "--postcss"
175
169
  }
@@ -233,16 +227,13 @@ let sharedFlags = {
233
227
  },
234
228
  "-h": "--help"
235
229
  };
236
- if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined
237
- ))) {
230
+ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
238
231
  help({
239
232
  usage: [
240
233
  "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
241
- "tailwindcss init [--full] [--postcss] [--types] [options...]",
234
+ "tailwindcss init [--full] [--postcss] [options...]",
242
235
  ],
243
- commands: Object.keys(commands).filter((command2)=>command2 !== "build"
244
- ).map((command3)=>`${command3} [options]`
245
- ),
236
+ commands: Object.keys(commands).filter((command2)=>command2 !== "build").map((command3)=>`${command3} [options]`),
246
237
  options: {
247
238
  ...commands.build.args,
248
239
  ...sharedFlags
@@ -250,8 +241,7 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
250
241
  });
251
242
  process.exit(0);
252
243
  }
253
- let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg
254
- )(process.argv[2]) || "build";
244
+ let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
255
245
  if (commands[command] === undefined) {
256
246
  if (_fs.default.existsSync(_path.default.resolve(command))) {
257
247
  // TODO: Deprecate this in future versions
@@ -263,9 +253,7 @@ if (commands[command] === undefined) {
263
253
  usage: [
264
254
  "tailwindcss <command> [options]"
265
255
  ],
266
- commands: Object.keys(commands).filter((command4)=>command4 !== "build"
267
- ).map((command5)=>`${command5} [options]`
268
- ),
256
+ commands: Object.keys(commands).filter((command4)=>command4 !== "build").map((command5)=>`${command5} [options]`),
269
257
  options: sharedFlags
270
258
  });
271
259
  process.exit(1);
@@ -284,8 +272,7 @@ let args = (()=>{
284
272
  }).map(([key, value])=>[
285
273
  key,
286
274
  typeof value === "object" ? value.type : value
287
- ]
288
- )), {
275
+ ])), {
289
276
  permissive: true
290
277
  });
291
278
  // Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
@@ -357,10 +344,6 @@ function init() {
357
344
  messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
358
345
  } else {
359
346
  let stubFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../stubs/defaultConfig.stub.js") : _path.default.resolve(__dirname, "../stubs/simpleConfig.stub.js"), "utf8");
360
- if (args["--types"]) {
361
- let typesHeading = "/** @type {import('tailwindcss/types').Config} */";
362
- stubFile = stubFile.replace(`module.exports = `, `${typesHeading}\nconst config = `) + "\nmodule.exports = config";
363
- }
364
347
  // Change colors import
365
348
  stubFile = stubFile.replace("../colors", "tailwindcss/colors");
366
349
  _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
@@ -406,8 +389,7 @@ async function build() {
406
389
  console.error(`Specified config file ${args["--config"]} does not exist.`);
407
390
  process.exit(9);
408
391
  }
409
- let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
410
- )(_path.default.resolve(`./${configs.tailwind}`));
392
+ let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null)(_path.default.resolve(`./${configs.tailwind}`));
411
393
  async function loadPostCssPlugins() {
412
394
  let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
413
395
  let config1 = customPostCssPath ? await (async ()=>{
@@ -478,8 +460,7 @@ async function build() {
478
460
  // like an object it's probably a raw content object. But this object
479
461
  // is not watchable, so let's remove it.
480
462
  return typeof file === "string";
481
- }).map((glob)=>(0, _normalizePath).default(glob)
482
- );
463
+ }).map((glob)=>(0, _normalizePath).default(glob));
483
464
  }
484
465
  function extractRawContent(config) {
485
466
  return config.content.files.filter((file)=>{
@@ -522,14 +503,36 @@ async function build() {
522
503
  };
523
504
  };
524
505
  tailwindPlugin.postcss = true;
506
+ let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
525
507
  let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : [
526
508
  [
509
+ (root)=>{
510
+ root.walkAtRules("import", (rule)=>{
511
+ if (rule.params.slice(1).startsWith("tailwindcss/")) {
512
+ rule.after(postcss.comment({
513
+ text: IMPORT_COMMENT + rule.params
514
+ }));
515
+ rule.remove();
516
+ }
517
+ });
518
+ },
527
519
  (()=>{
528
520
  try {
529
521
  return require("postcss-import");
530
522
  } catch {}
531
523
  return (0, _indexJs).lazyPostcssImport();
532
- })(),
524
+ })(),
525
+ (root)=>{
526
+ root.walkComments((rule)=>{
527
+ if (rule.text.startsWith(IMPORT_COMMENT)) {
528
+ rule.after(postcss.atRule({
529
+ name: "import",
530
+ params: rule.text.replace(IMPORT_COMMENT, "")
531
+ }));
532
+ rule.remove();
533
+ }
534
+ });
535
+ },
533
536
  ],
534
537
  [],
535
538
  {},
@@ -568,13 +571,11 @@ async function build() {
568
571
  let start = process.hrtime.bigint();
569
572
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
570
573
  recursive: true
571
- }) : null
572
- ).then(()=>processor.process(css, {
574
+ }) : null).then(()=>processor.process(css, {
573
575
  ...postcssOptions,
574
576
  from: input,
575
577
  to: output
576
- })
577
- ).then((result)=>{
578
+ })).then((result)=>{
578
579
  if (!output) {
579
580
  return process.stdout.write(result.css);
580
581
  }
@@ -585,7 +586,7 @@ async function build() {
585
586
  }).then(()=>{
586
587
  let end = process.hrtime.bigint();
587
588
  console.error();
588
- console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
589
+ console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
589
590
  });
590
591
  }
591
592
  let css1 = await (()=>{
@@ -614,8 +615,7 @@ async function build() {
614
615
  delete require.cache[require.resolve(file1)];
615
616
  }
616
617
  if (configPath) {
617
- configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
618
- );
618
+ configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file);
619
619
  for (let dependency of configDependencies){
620
620
  contextDependencies.add(dependency);
621
621
  }
@@ -690,12 +690,10 @@ async function build() {
690
690
  let start = process.hrtime.bigint();
691
691
  return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
692
692
  recursive: true
693
- }) : null
694
- ).then(()=>processor.process(css, {
693
+ }) : null).then(()=>processor.process(css, {
695
694
  from: input,
696
695
  to: output
697
- })
698
- ).then(async (result)=>{
696
+ })).then(async (result)=>{
699
697
  for (let message of result.messages){
700
698
  if (message.type === "dependency") {
701
699
  contextDependencies.add(message.file);
@@ -713,7 +711,7 @@ async function build() {
713
711
  ].filter(Boolean));
714
712
  }).then(()=>{
715
713
  let end = process.hrtime.bigint();
716
- console.error("Done in", (end - start) / BigInt(1000000) + "ms.");
714
+ console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
717
715
  }).catch((err)=>{
718
716
  if (err.name === "CssSyntaxError") {
719
717
  console.error(err.toString());
@@ -795,9 +793,10 @@ async function build() {
795
793
  });
796
794
  }
797
795
  if (shouldWatch) {
798
- /* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.on("end", ()=>process.exit(0)
799
- );
800
- process.stdin.resume();
796
+ /* Abort the watcher if stdin is closed to avoid zombie processes */ if (process.stdin.isTTY) {
797
+ process.stdin.on("end", ()=>process.exit(0));
798
+ process.stdin.resume();
799
+ }
801
800
  startWatcher();
802
801
  } else {
803
802
  buildOnce();
@@ -25,26 +25,44 @@ function _interopRequireDefault(obj) {
25
25
  default: obj
26
26
  };
27
27
  }
28
+ function _getRequireWildcardCache() {
29
+ if (typeof WeakMap !== "function") return null;
30
+ var cache = new WeakMap();
31
+ _getRequireWildcardCache = function() {
32
+ return cache;
33
+ };
34
+ return cache;
35
+ }
28
36
  function _interopRequireWildcard(obj) {
29
37
  if (obj && obj.__esModule) {
30
38
  return obj;
31
- } else {
32
- var newObj = {};
33
- if (obj != null) {
34
- for(var key in obj){
35
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
36
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
37
- if (desc.get || desc.set) {
38
- Object.defineProperty(newObj, key, desc);
39
- } else {
40
- newObj[key] = obj[key];
41
- }
42
- }
39
+ }
40
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
+ return {
42
+ default: obj
43
+ };
44
+ }
45
+ var cache = _getRequireWildcardCache();
46
+ if (cache && cache.has(obj)) {
47
+ return cache.get(obj);
48
+ }
49
+ var newObj = {};
50
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
51
+ for(var key in obj){
52
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
53
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
54
+ if (desc && (desc.get || desc.set)) {
55
+ Object.defineProperty(newObj, key, desc);
56
+ } else {
57
+ newObj[key] = obj[key];
43
58
  }
44
59
  }
45
- newObj.default = obj;
46
- return newObj;
47
60
  }
61
+ newObj.default = obj;
62
+ if (cache) {
63
+ cache.set(obj, newObj);
64
+ }
65
+ return newObj;
48
66
  }
49
67
  let variantPlugins = {
50
68
  pseudoElementVariants: ({ addVariant })=>{
@@ -152,6 +170,7 @@ let variantPlugins = {
152
170
  "indeterminate",
153
171
  "placeholder-shown",
154
172
  "autofill",
173
+ "optional",
155
174
  "required",
156
175
  "valid",
157
176
  "invalid",
@@ -174,8 +193,7 @@ let variantPlugins = {
174
193
  ].map((variant)=>Array.isArray(variant) ? variant : [
175
194
  variant,
176
195
  `&:${variant}`
177
- ]
178
- );
196
+ ]);
179
197
  for (let [variantName, state] of pseudoVariants){
180
198
  addVariant(variantName, (ctx)=>{
181
199
  let result = typeof state === "function" ? state(ctx) : state;
@@ -292,10 +310,7 @@ let corePlugins = {
292
310
  },
293
311
  container: (()=>{
294
312
  function extractMinWidths(breakpoints = []) {
295
- return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min
296
- )
297
- ).filter((v)=>v !== undefined
298
- );
313
+ return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min)).filter((v)=>v !== undefined);
299
314
  }
300
315
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
301
316
  if (typeof paddings === "undefined") {
@@ -337,8 +352,7 @@ let corePlugins = {
337
352
  let minWidths = extractMinWidths(screens);
338
353
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme("container.padding"));
339
354
  let generatePaddingFor = (minWidth)=>{
340
- let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth
341
- );
355
+ let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth);
342
356
  if (!paddingConfig) {
343
357
  return {};
344
358
  }
@@ -347,16 +361,14 @@ let corePlugins = {
347
361
  paddingLeft: paddingConfig.padding
348
362
  };
349
363
  };
350
- let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)
351
- ))).map((minWidth)=>({
364
+ let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)))).map((minWidth)=>({
352
365
  [`@media (min-width: ${minWidth})`]: {
353
366
  ".container": {
354
367
  "max-width": minWidth,
355
368
  ...generatePaddingFor(minWidth)
356
369
  }
357
370
  }
358
- })
359
- );
371
+ }));
360
372
  addComponents([
361
373
  {
362
374
  ".container": Object.assign({
@@ -1033,8 +1045,7 @@ let corePlugins = {
1033
1045
  });
1034
1046
  },
1035
1047
  animation: ({ matchUtilities , theme , config })=>{
1036
- let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}`
1037
- ;
1048
+ let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}`;
1038
1049
  var ref;
1039
1050
  let keyframes = Object.fromEntries(Object.entries((ref = theme("keyframes")) !== null && ref !== void 0 ? ref : {}).map(([key, value])=>{
1040
1051
  return [
@@ -1048,8 +1059,7 @@ let corePlugins = {
1048
1059
  animate: (value1)=>{
1049
1060
  let animations = (0, _parseAnimationValue).default(value1);
1050
1061
  return [
1051
- ...animations.flatMap((animation)=>keyframes[animation.name]
1052
- ),
1062
+ ...animations.flatMap((animation)=>keyframes[animation.name]),
1053
1063
  {
1054
1064
  animation: animations.map(({ name , value })=>{
1055
1065
  if (name === undefined || keyframes[name] === undefined) {
@@ -1749,8 +1759,7 @@ let corePlugins = {
1749
1759
  };
1750
1760
  }
1751
1761
  }, {
1752
- values: (({ DEFAULT: _ , ...colors })=>colors
1753
- )((0, _flattenColorPalette).default(theme("divideColor"))),
1762
+ values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("divideColor"))),
1754
1763
  type: "color"
1755
1764
  });
1756
1765
  },
@@ -2152,8 +2161,7 @@ let corePlugins = {
2152
2161
  });
2153
2162
  }
2154
2163
  }, {
2155
- values: (({ DEFAULT: _ , ...colors })=>colors
2156
- )((0, _flattenColorPalette).default(theme("borderColor"))),
2164
+ values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
2157
2165
  type: [
2158
2166
  "color"
2159
2167
  ]
@@ -2192,8 +2200,7 @@ let corePlugins = {
2192
2200
  });
2193
2201
  }
2194
2202
  }, {
2195
- values: (({ DEFAULT: _ , ...colors })=>colors
2196
- )((0, _flattenColorPalette).default(theme("borderColor"))),
2203
+ values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
2197
2204
  type: "color"
2198
2205
  });
2199
2206
  matchUtilities({
@@ -2246,8 +2253,7 @@ let corePlugins = {
2246
2253
  });
2247
2254
  }
2248
2255
  }, {
2249
- values: (({ DEFAULT: _ , ...colors })=>colors
2250
- )((0, _flattenColorPalette).default(theme("borderColor"))),
2256
+ values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
2251
2257
  type: "color"
2252
2258
  });
2253
2259
  },
@@ -2317,7 +2323,8 @@ let corePlugins = {
2317
2323
  let transparentToValue = transparentTo(value);
2318
2324
  return {
2319
2325
  "--tw-gradient-from": (0, _toColorValue).default(value, "from"),
2320
- "--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`
2326
+ "--tw-gradient-to": transparentToValue,
2327
+ "--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)`
2321
2328
  };
2322
2329
  }
2323
2330
  }, options);
@@ -2325,7 +2332,8 @@ let corePlugins = {
2325
2332
  via: (value)=>{
2326
2333
  let transparentToValue = transparentTo(value);
2327
2334
  return {
2328
- "--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue).default(value, "via")}, var(--tw-gradient-to, ${transparentToValue})`
2335
+ "--tw-gradient-to": transparentToValue,
2336
+ "--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue).default(value, "via")}, var(--tw-gradient-to)`
2329
2337
  };
2330
2338
  }
2331
2339
  }, options);
@@ -3204,12 +3212,15 @@ let corePlugins = {
3204
3212
  },
3205
3213
  ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{
3206
3214
  let ringColorDefault = (()=>{
3207
- var ref;
3215
+ var ref, ref1;
3208
3216
  if ((0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")) {
3209
3217
  return theme("ringColor.DEFAULT");
3210
3218
  }
3211
3219
  let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5");
3212
- return (0, _withAlphaVariable).withAlphaValue((ref = theme("ringColor")) === null || ref === void 0 ? void 0 : ref.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`);
3220
+ if (!((ref = theme("ringColor")) === null || ref === void 0 ? void 0 : ref.DEFAULT)) {
3221
+ return `rgb(147 197 253 / ${ringOpacityDefault})`;
3222
+ }
3223
+ return (0, _withAlphaVariable).withAlphaValue((ref1 = theme("ringColor")) === null || ref1 === void 0 ? void 0 : ref1.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`);
3213
3224
  })();
3214
3225
  addDefaults("ring-width", {
3215
3226
  "--tw-ring-inset": " ",
@@ -3260,8 +3271,7 @@ let corePlugins = {
3260
3271
  });
3261
3272
  }
3262
3273
  }, {
3263
- values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT"
3264
- )),
3274
+ values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")),
3265
3275
  type: "color"
3266
3276
  });
3267
3277
  },
@@ -3343,8 +3353,7 @@ let corePlugins = {
3343
3353
  matchUtilities({
3344
3354
  "drop-shadow": (value)=>{
3345
3355
  return {
3346
- "--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`
3347
- ).join(" ") : `drop-shadow(${value})`,
3356
+ "--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`,
3348
3357
  "@defaults filter": {},
3349
3358
  filter: cssFilterValue
3350
3359
  };
@@ -22,7 +22,7 @@ let featureFlags = {
22
22
  ],
23
23
  experimental: [
24
24
  "optimizeUniversalDefaults",
25
- "variantGrouping"
25
+ "matchVariant" /* , 'variantGrouping' */
26
26
  ]
27
27
  };
28
28
  function flagEnabled(config, flag) {
@@ -43,16 +43,14 @@ function experimentalFlagsEnabled(config) {
43
43
  return featureFlags.experimental;
44
44
  }
45
45
  var ref;
46
- return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]
47
- );
46
+ return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
48
47
  }
49
48
  function issueFlagNotices(config) {
50
49
  if (process.env.JEST_WORKER_ID !== undefined) {
51
50
  return;
52
51
  }
53
52
  if (experimentalFlagsEnabled(config).length > 0) {
54
- let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)
55
- ).join(", ");
53
+ let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", ");
56
54
  _log.default.warn("experimental-flags-enabled", [
57
55
  `You have enabled experimental features: ${changes}`,
58
56
  "Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time.",
package/lib/index.js CHANGED
@@ -19,8 +19,7 @@ module.exports = function tailwindcss(configOrPath) {
19
19
  function(root, result) {
20
20
  let context = (0, _setupTrackingContext).default(configOrPath);
21
21
  if (root.type === "document") {
22
- let roots = root.nodes.filter((node)=>node.type === "root"
23
- );
22
+ let roots = root.nodes.filter((node)=>node.type === "root");
24
23
  for (const root1 of roots){
25
24
  if (root1.type === "root") {
26
25
  (0, _processTailwindFeatures).default(context)(root1, result);
@@ -10,26 +10,44 @@ function _interopRequireDefault(obj) {
10
10
  default: obj
11
11
  };
12
12
  }
13
+ function _getRequireWildcardCache() {
14
+ if (typeof WeakMap !== "function") return null;
15
+ var cache = new WeakMap();
16
+ _getRequireWildcardCache = function() {
17
+ return cache;
18
+ };
19
+ return cache;
20
+ }
13
21
  function _interopRequireWildcard(obj) {
14
22
  if (obj && obj.__esModule) {
15
23
  return obj;
16
- } else {
17
- var newObj = {};
18
- if (obj != null) {
19
- for(var key in obj){
20
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
21
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
22
- if (desc.get || desc.set) {
23
- Object.defineProperty(newObj, key, desc);
24
- } else {
25
- newObj[key] = obj[key];
26
- }
27
- }
24
+ }
25
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
26
+ return {
27
+ default: obj
28
+ };
29
+ }
30
+ var cache = _getRequireWildcardCache();
31
+ if (cache && cache.has(obj)) {
32
+ return cache.get(obj);
33
+ }
34
+ var newObj = {};
35
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
36
+ for(var key in obj){
37
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
38
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
39
+ if (desc && (desc.get || desc.set)) {
40
+ Object.defineProperty(newObj, key, desc);
41
+ } else {
42
+ newObj[key] = obj[key];
28
43
  }
29
44
  }
30
- newObj.default = obj;
31
- return newObj;
32
45
  }
46
+ newObj.default = obj;
47
+ if (cache) {
48
+ cache.set(obj, newObj);
49
+ }
50
+ return newObj;
33
51
  }
34
52
  /**
35
53
  * Calculate the hash of a string.
@@ -19,8 +19,7 @@ function collapseAdjacentRules() {
19
19
  var _property, _property1;
20
20
  if (node.type === "atrule" && node.name === "font-face") {
21
21
  currentRule = node;
22
- } else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : "").replace(/\s+/g, " ") === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : "").replace(/\s+/g, " ")
23
- )) {
22
+ } else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : "").replace(/\s+/g, " ") === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : "").replace(/\s+/g, " "))) {
24
23
  // An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
25
24
  if (node.nodes) {
26
25
  currentRule.append(node.nodes);