tailwindcss 0.0.0-insiders.b3d8464 → 0.0.0-insiders.b42e7d9

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 (50) hide show
  1. package/README.md +1 -1
  2. package/lib/cli/build/plugin.js +20 -20
  3. package/lib/corePluginList.js +2 -0
  4. package/lib/corePlugins.js +214 -2
  5. package/lib/css/preflight.css +2 -0
  6. package/lib/featureFlags.js +8 -1
  7. package/lib/lib/expandTailwindAtRules.js +3 -6
  8. package/lib/lib/generateRules.js +31 -22
  9. package/lib/lib/offsets.js +5 -0
  10. package/lib/lib/setupContextUtils.js +36 -9
  11. package/lib/lib/sharedState.js +18 -1
  12. package/lib/oxide/cli/build/plugin.js +20 -20
  13. package/lib/plugin.js +50 -0
  14. package/lib/util/color.js +16 -2
  15. package/lib/util/formatVariantSelector.js +3 -13
  16. package/lib/util/normalizeConfig.js +2 -3
  17. package/lib/util/pluginUtils.js +5 -24
  18. package/lib/util/splitAtTopLevelOnly.js +7 -1
  19. package/package.json +10 -13
  20. package/peers/index.js +73 -143
  21. package/scripts/swap-engines.js +40 -0
  22. package/src/cli/build/plugin.js +1 -1
  23. package/src/corePluginList.js +1 -1
  24. package/src/corePlugins.js +111 -2
  25. package/src/css/preflight.css +2 -0
  26. package/src/featureFlags.js +7 -0
  27. package/src/lib/expandTailwindAtRules.js +10 -15
  28. package/src/lib/generateRules.js +45 -18
  29. package/src/lib/offsets.js +6 -0
  30. package/src/lib/setupContextUtils.js +27 -8
  31. package/src/lib/sharedState.js +17 -1
  32. package/src/oxide/cli/build/plugin.ts +1 -1
  33. package/src/plugin.js +60 -0
  34. package/src/util/color.js +17 -2
  35. package/src/util/formatVariantSelector.js +2 -2
  36. package/src/util/normalizeConfig.js +2 -1
  37. package/src/util/pluginUtils.js +10 -29
  38. package/src/util/splitAtTopLevelOnly.js +8 -1
  39. package/stubs/defaultConfig.stub.js +1 -0
  40. package/types/config.d.ts +7 -1
  41. package/types/generated/corePluginList.d.ts +1 -1
  42. package/CHANGELOG.md +0 -2362
  43. package/lib/cli/shared.js +0 -13
  44. package/lib/oxide/cli/shared.js +0 -12
  45. package/oxide-node-api-shim/index.js +0 -21
  46. package/oxide-node-api-shim/package.json +0 -5
  47. package/scripts/install-integrations.js +0 -27
  48. package/scripts/rebuildFixtures.js +0 -68
  49. package/src/cli/shared.js +0 -6
  50. package/src/oxide/cli/shared.ts +0 -4
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  <p align="center">
17
- <a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/nodejs.yml?branch=master" alt="Build Status"></a>
17
+ <a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci-stable.yml?branch=master" alt="Build Status"></a>
18
18
  <a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
19
19
  <a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
20
20
  <a href="https://github.com/tailwindcss/tailwindcss/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
@@ -18,7 +18,7 @@ const _options = /*#__PURE__*/ _interopRequireDefault(require("postcss-load-conf
18
18
  const _processTailwindFeatures = /*#__PURE__*/ _interopRequireDefault(require("../../processTailwindFeatures"));
19
19
  const _deps = require("./deps");
20
20
  const _utils = require("./utils");
21
- const _shared = require("../shared");
21
+ const _sharedState = require("../../lib/sharedState");
22
22
  const _resolveConfigJs = /*#__PURE__*/ _interopRequireDefault(require("../../../resolveConfig.js"));
23
23
  const _getModuleDependenciesJs = /*#__PURE__*/ _interopRequireDefault(require("../../lib/getModuleDependencies.js"));
24
24
  const _contentJs = require("../../lib/content.js");
@@ -143,7 +143,7 @@ let state = {
143
143
  return config;
144
144
  },
145
145
  refreshConfigDependencies (configPath) {
146
- _shared.env.DEBUG && console.time("Module dependencies");
146
+ _sharedState.env.DEBUG && console.time("Module dependencies");
147
147
  for (let file of this.configDependencies){
148
148
  delete require.cache[require.resolve(file)];
149
149
  }
@@ -153,7 +153,7 @@ let state = {
153
153
  this.configDependencies.add(dependency);
154
154
  }
155
155
  }
156
- _shared.env.DEBUG && console.timeEnd("Module dependencies");
156
+ _sharedState.env.DEBUG && console.timeEnd("Module dependencies");
157
157
  },
158
158
  readContentPaths () {
159
159
  let content = [];
@@ -161,7 +161,7 @@ let state = {
161
161
  // TODO: When we make the postcss plugin async-capable this can become async
162
162
  let files = _fastGlob.default.sync(this.contentPatterns.all);
163
163
  for (let file of files){
164
- if (_shared.env.OXIDE) {
164
+ if (_sharedState.env.OXIDE) {
165
165
  content.push({
166
166
  file,
167
167
  extension: _path.default.extname(file).slice(1)
@@ -190,26 +190,26 @@ let state = {
190
190
  this.context.changedContent = this.changedContent.splice(0);
191
191
  return this.context;
192
192
  }
193
- _shared.env.DEBUG && console.time("Searching for config");
193
+ _sharedState.env.DEBUG && console.time("Searching for config");
194
194
  var _findAtConfigPath;
195
195
  let configPath = (_findAtConfigPath = (0, _findAtConfigPathJs.findAtConfigPath)(root, result)) !== null && _findAtConfigPath !== void 0 ? _findAtConfigPath : cliConfigPath;
196
- _shared.env.DEBUG && console.timeEnd("Searching for config");
197
- _shared.env.DEBUG && console.time("Loading config");
196
+ _sharedState.env.DEBUG && console.timeEnd("Searching for config");
197
+ _sharedState.env.DEBUG && console.time("Loading config");
198
198
  let config = this.loadConfig(configPath, content);
199
- _shared.env.DEBUG && console.timeEnd("Loading config");
200
- _shared.env.DEBUG && console.time("Creating context");
199
+ _sharedState.env.DEBUG && console.timeEnd("Loading config");
200
+ _sharedState.env.DEBUG && console.time("Creating context");
201
201
  this.context = createContext(config, []);
202
202
  Object.assign(this.context, {
203
203
  userConfigPath: configPath
204
204
  });
205
- _shared.env.DEBUG && console.timeEnd("Creating context");
206
- _shared.env.DEBUG && console.time("Resolving content paths");
205
+ _sharedState.env.DEBUG && console.timeEnd("Creating context");
206
+ _sharedState.env.DEBUG && console.time("Resolving content paths");
207
207
  this.refreshContentPaths();
208
- _shared.env.DEBUG && console.timeEnd("Resolving content paths");
208
+ _sharedState.env.DEBUG && console.timeEnd("Resolving content paths");
209
209
  if (this.watcher) {
210
- _shared.env.DEBUG && console.time("Watch new files");
210
+ _sharedState.env.DEBUG && console.time("Watch new files");
211
211
  this.watcher.refreshWatchedFiles();
212
- _shared.env.DEBUG && console.timeEnd("Watch new files");
212
+ _sharedState.env.DEBUG && console.timeEnd("Watch new files");
213
213
  }
214
214
  for (let file of this.readContentPaths()){
215
215
  this.context.changedContent.push(file);
@@ -240,7 +240,7 @@ async function createProcessor(args, cliConfigPath) {
240
240
  return {
241
241
  postcssPlugin: "tailwindcss",
242
242
  Once (root, { result }) {
243
- _shared.env.DEBUG && console.time("Compiling CSS");
243
+ _sharedState.env.DEBUG && console.time("Compiling CSS");
244
244
  (0, _processTailwindFeatures.default)(({ createContext })=>{
245
245
  console.error();
246
246
  console.error("Rebuilding...");
@@ -254,7 +254,7 @@ async function createProcessor(args, cliConfigPath) {
254
254
  });
255
255
  };
256
256
  })(root, result);
257
- _shared.env.DEBUG && console.timeEnd("Compiling CSS");
257
+ _sharedState.env.DEBUG && console.timeEnd("Compiling CSS");
258
258
  }
259
259
  };
260
260
  };
@@ -291,17 +291,17 @@ async function createProcessor(args, cliConfigPath) {
291
291
  if (!state.watcher) {
292
292
  return result;
293
293
  }
294
- _shared.env.DEBUG && console.time("Recording PostCSS dependencies");
294
+ _sharedState.env.DEBUG && console.time("Recording PostCSS dependencies");
295
295
  for (let message of result.messages){
296
296
  if (message.type === "dependency") {
297
297
  state.contextDependencies.add(message.file);
298
298
  }
299
299
  }
300
- _shared.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
300
+ _sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
301
301
  // TODO: This needs to be in a different spot
302
- _shared.env.DEBUG && console.time("Watch new files");
302
+ _sharedState.env.DEBUG && console.time("Watch new files");
303
303
  state.watcher.refreshWatchedFiles();
304
- _shared.env.DEBUG && console.timeEnd("Watch new files");
304
+ _sharedState.env.DEBUG && console.timeEnd("Watch new files");
305
305
  return result;
306
306
  }).then((result)=>{
307
307
  if (!output) {
@@ -40,6 +40,7 @@ const _default = [
40
40
  "flexGrow",
41
41
  "flexBasis",
42
42
  "tableLayout",
43
+ "captionSide",
43
44
  "borderCollapse",
44
45
  "borderSpacing",
45
46
  "transformOrigin",
@@ -91,6 +92,7 @@ const _default = [
91
92
  "overscrollBehavior",
92
93
  "scrollBehavior",
93
94
  "textOverflow",
95
+ "hyphens",
94
96
  "whitespace",
95
97
  "wordBreak",
96
98
  "borderRadius",
@@ -15,6 +15,7 @@ _export(exports, {
15
15
  const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
16
16
  const _path = /*#__PURE__*/ _interopRequireWildcard(require("path"));
17
17
  const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
18
+ const _sharedState = require("./lib/sharedState");
18
19
  const _createUtilityPlugin = /*#__PURE__*/ _interopRequireDefault(require("./util/createUtilityPlugin"));
19
20
  const _buildMediaQuery = /*#__PURE__*/ _interopRequireDefault(require("./util/buildMediaQuery"));
20
21
  const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("./util/escapeClassName"));
@@ -231,7 +232,25 @@ let variantPlugins = {
231
232
  let result = (0, _dataTypes.normalize)(typeof value === "function" ? value(extra) : value);
232
233
  if (!result.includes("&")) result = "&" + result;
233
234
  let [a, b] = fn("", extra);
234
- return result.replace(/&(\S+)?/g, (_, pseudo = "")=>a + pseudo + b);
235
+ let start = null;
236
+ let end = null;
237
+ let quotes = 0;
238
+ for(let i = 0; i < result.length; ++i){
239
+ let c = result[i];
240
+ if (c === "&") {
241
+ start = i;
242
+ } else if (c === "'" || c === '"') {
243
+ quotes += 1;
244
+ } else if (start !== null && c === " " && !quotes) {
245
+ end = i;
246
+ }
247
+ }
248
+ if (start !== null && end === null) {
249
+ end = result.length;
250
+ }
251
+ // Basically this but can handle quotes:
252
+ // result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
253
+ return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end);
235
254
  }, {
236
255
  values: Object.fromEntries(pseudoVariants)
237
256
  });
@@ -650,6 +669,18 @@ let corePlugins = {
650
669
  ]
651
670
  ],
652
671
  [
672
+ [
673
+ "start",
674
+ [
675
+ "inset-inline-start"
676
+ ]
677
+ ],
678
+ [
679
+ "end",
680
+ [
681
+ "inset-inline-end"
682
+ ]
683
+ ],
653
684
  [
654
685
  "top",
655
686
  [
@@ -802,6 +833,18 @@ let corePlugins = {
802
833
  ]
803
834
  ],
804
835
  [
836
+ [
837
+ "ms",
838
+ [
839
+ "margin-inline-start"
840
+ ]
841
+ ],
842
+ [
843
+ "me",
844
+ [
845
+ "margin-inline-end"
846
+ ]
847
+ ],
805
848
  [
806
849
  "mt",
807
850
  [
@@ -1010,6 +1053,16 @@ let corePlugins = {
1010
1053
  }
1011
1054
  });
1012
1055
  },
1056
+ captionSide: ({ addUtilities })=>{
1057
+ addUtilities({
1058
+ ".caption-top": {
1059
+ "caption-side": "top"
1060
+ },
1061
+ ".caption-bottom": {
1062
+ "caption-side": "bottom"
1063
+ }
1064
+ });
1065
+ },
1013
1066
  borderCollapse: ({ addUtilities })=>{
1014
1067
  addUtilities({
1015
1068
  ".border-collapse": {
@@ -1416,6 +1469,18 @@ let corePlugins = {
1416
1469
  ]
1417
1470
  ],
1418
1471
  [
1472
+ [
1473
+ "scroll-ms",
1474
+ [
1475
+ "scroll-margin-inline-start"
1476
+ ]
1477
+ ],
1478
+ [
1479
+ "scroll-me",
1480
+ [
1481
+ "scroll-margin-inline-end"
1482
+ ]
1483
+ ],
1419
1484
  [
1420
1485
  "scroll-mt",
1421
1486
  [
@@ -1468,6 +1533,18 @@ let corePlugins = {
1468
1533
  ]
1469
1534
  ],
1470
1535
  [
1536
+ [
1537
+ "scroll-ps",
1538
+ [
1539
+ "scroll-padding-inline-start"
1540
+ ]
1541
+ ],
1542
+ [
1543
+ "scroll-pe",
1544
+ [
1545
+ "scroll-padding-inline-end"
1546
+ ]
1547
+ ],
1471
1548
  [
1472
1549
  "scroll-pt",
1473
1550
  [
@@ -1772,6 +1849,9 @@ let corePlugins = {
1772
1849
  },
1773
1850
  justifyContent: ({ addUtilities })=>{
1774
1851
  addUtilities({
1852
+ ".justify-normal": {
1853
+ "justify-content": "normal"
1854
+ },
1775
1855
  ".justify-start": {
1776
1856
  "justify-content": "flex-start"
1777
1857
  },
@@ -1789,6 +1869,9 @@ let corePlugins = {
1789
1869
  },
1790
1870
  ".justify-evenly": {
1791
1871
  "justify-content": "space-evenly"
1872
+ },
1873
+ ".justify-stretch": {
1874
+ "justify-content": "stretch"
1792
1875
  }
1793
1876
  });
1794
1877
  },
@@ -1834,6 +1917,15 @@ let corePlugins = {
1834
1917
  matchUtilities({
1835
1918
  "space-x": (value)=>{
1836
1919
  value = value === "0" ? "0px" : value;
1920
+ if (_sharedState.env.OXIDE) {
1921
+ return {
1922
+ "& > :not([hidden]) ~ :not([hidden])": {
1923
+ "--tw-space-x-reverse": "0",
1924
+ "margin-inline-end": `calc(${value} * var(--tw-space-x-reverse))`,
1925
+ "margin-inline-start": `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`
1926
+ }
1927
+ };
1928
+ }
1837
1929
  return {
1838
1930
  "& > :not([hidden]) ~ :not([hidden])": {
1839
1931
  "--tw-space-x-reverse": "0",
@@ -1869,6 +1961,16 @@ let corePlugins = {
1869
1961
  matchUtilities({
1870
1962
  "divide-x": (value)=>{
1871
1963
  value = value === "0" ? "0px" : value;
1964
+ if (_sharedState.env.OXIDE) {
1965
+ return {
1966
+ "& > :not([hidden]) ~ :not([hidden])": {
1967
+ "@defaults border-width": {},
1968
+ "--tw-divide-x-reverse": "0",
1969
+ "border-inline-end-width": `calc(${value} * var(--tw-divide-x-reverse))`,
1970
+ "border-inline-start-width": `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`
1971
+ }
1972
+ };
1973
+ }
1872
1974
  return {
1873
1975
  "& > :not([hidden]) ~ :not([hidden])": {
1874
1976
  "@defaults border-width": {},
@@ -2134,6 +2236,19 @@ let corePlugins = {
2134
2236
  }
2135
2237
  });
2136
2238
  },
2239
+ hyphens: ({ addUtilities })=>{
2240
+ addUtilities({
2241
+ ".hyphens-none": {
2242
+ hyphens: "none"
2243
+ },
2244
+ ".hyphens-manual": {
2245
+ hyphens: "manual"
2246
+ },
2247
+ ".hyphens-auto": {
2248
+ hyphens: "auto"
2249
+ }
2250
+ });
2251
+ },
2137
2252
  whitespace: ({ addUtilities })=>{
2138
2253
  addUtilities({
2139
2254
  ".whitespace-normal": {
@@ -2178,6 +2293,20 @@ let corePlugins = {
2178
2293
  ]
2179
2294
  ],
2180
2295
  [
2296
+ [
2297
+ "rounded-s",
2298
+ [
2299
+ "border-start-start-radius",
2300
+ "border-end-start-radius"
2301
+ ]
2302
+ ],
2303
+ [
2304
+ "rounded-e",
2305
+ [
2306
+ "border-start-end-radius",
2307
+ "border-end-end-radius"
2308
+ ]
2309
+ ],
2181
2310
  [
2182
2311
  "rounded-t",
2183
2312
  [
@@ -2208,6 +2337,30 @@ let corePlugins = {
2208
2337
  ]
2209
2338
  ],
2210
2339
  [
2340
+ [
2341
+ "rounded-ss",
2342
+ [
2343
+ "border-start-start-radius"
2344
+ ]
2345
+ ],
2346
+ [
2347
+ "rounded-se",
2348
+ [
2349
+ "border-start-end-radius"
2350
+ ]
2351
+ ],
2352
+ [
2353
+ "rounded-ee",
2354
+ [
2355
+ "border-end-end-radius"
2356
+ ]
2357
+ ],
2358
+ [
2359
+ "rounded-es",
2360
+ [
2361
+ "border-end-start-radius"
2362
+ ]
2363
+ ],
2211
2364
  [
2212
2365
  "rounded-tl",
2213
2366
  [
@@ -2270,6 +2423,26 @@ let corePlugins = {
2270
2423
  ]
2271
2424
  ],
2272
2425
  [
2426
+ [
2427
+ "border-s",
2428
+ [
2429
+ [
2430
+ "@defaults border-width",
2431
+ {}
2432
+ ],
2433
+ "border-inline-start-width"
2434
+ ]
2435
+ ],
2436
+ [
2437
+ "border-e",
2438
+ [
2439
+ [
2440
+ "@defaults border-width",
2441
+ {}
2442
+ ],
2443
+ "border-inline-end-width"
2444
+ ]
2445
+ ],
2273
2446
  [
2274
2447
  "border-t",
2275
2448
  [
@@ -2401,6 +2574,30 @@ let corePlugins = {
2401
2574
  ]
2402
2575
  });
2403
2576
  matchUtilities({
2577
+ "border-s": (value)=>{
2578
+ if (!corePlugins("borderOpacity")) {
2579
+ return {
2580
+ "border-inline-start-color": (0, _toColorValue.default)(value)
2581
+ };
2582
+ }
2583
+ return (0, _withAlphaVariable.default)({
2584
+ color: value,
2585
+ property: "border-inline-start-color",
2586
+ variable: "--tw-border-opacity"
2587
+ });
2588
+ },
2589
+ "border-e": (value)=>{
2590
+ if (!corePlugins("borderOpacity")) {
2591
+ return {
2592
+ "border-inline-end-color": (0, _toColorValue.default)(value)
2593
+ };
2594
+ }
2595
+ return (0, _withAlphaVariable.default)({
2596
+ color: value,
2597
+ property: "border-inline-end-color",
2598
+ variable: "--tw-border-opacity"
2599
+ });
2600
+ },
2404
2601
  "border-t": (value)=>{
2405
2602
  if (!corePlugins("borderOpacity")) {
2406
2603
  return {
@@ -2756,6 +2953,18 @@ let corePlugins = {
2756
2953
  ]
2757
2954
  ],
2758
2955
  [
2956
+ [
2957
+ "ps",
2958
+ [
2959
+ "padding-inline-start"
2960
+ ]
2961
+ ],
2962
+ [
2963
+ "pe",
2964
+ [
2965
+ "padding-inline-end"
2966
+ ]
2967
+ ],
2759
2968
  [
2760
2969
  "pt",
2761
2970
  [
@@ -2853,11 +3062,14 @@ let corePlugins = {
2853
3062
  let [families, options = {}] = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value : [
2854
3063
  value
2855
3064
  ];
2856
- let { fontFeatureSettings } = options;
3065
+ let { fontFeatureSettings , fontVariationSettings } = options;
2857
3066
  return {
2858
3067
  "font-family": Array.isArray(families) ? families.join(", ") : families,
2859
3068
  ...fontFeatureSettings === undefined ? {} : {
2860
3069
  "font-feature-settings": fontFeatureSettings
3070
+ },
3071
+ ...fontVariationSettings === undefined ? {} : {
3072
+ "font-variation-settings": fontVariationSettings
2861
3073
  }
2862
3074
  };
2863
3075
  }
@@ -23,6 +23,7 @@
23
23
  3. Use a more readable tab size.
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
+ 6. Use the user's configured `sans` font-variation-settings by default.
26
27
  */
27
28
 
28
29
  html {
@@ -32,6 +33,7 @@ html {
32
33
  tab-size: 4; /* 3 */
33
34
  font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
34
35
  font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
36
+ font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
35
37
  }
36
38
 
37
39
  /*
@@ -15,6 +15,7 @@ _export(exports, {
15
15
  });
16
16
  const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
17
17
  const _log = /*#__PURE__*/ _interopRequireDefault(require("./util/log"));
18
+ const _sharedState = require("./lib/sharedState");
18
19
  function _interopRequireDefault(obj) {
19
20
  return obj && obj.__esModule ? obj : {
20
21
  default: obj
@@ -22,7 +23,13 @@ function _interopRequireDefault(obj) {
22
23
  }
23
24
  let defaults = {
24
25
  optimizeUniversalDefaults: false,
25
- generalizedModifiers: true
26
+ generalizedModifiers: true,
27
+ get disableColorOpacityUtilitiesByDefault () {
28
+ return _sharedState.env.OXIDE;
29
+ },
30
+ get relativeContentPathsByDefault () {
31
+ return _sharedState.env.OXIDE;
32
+ }
26
33
  };
27
34
  let featureFlags = {
28
35
  future: [
@@ -13,7 +13,6 @@ const _generateRules = require("./generateRules");
13
13
  const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
14
14
  const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("../util/cloneNodes"));
15
15
  const _defaultExtractor = require("./defaultExtractor");
16
- const _oxide = /*#__PURE__*/ _interopRequireDefault(require("@tailwindcss/oxide"));
17
16
  function _interopRequireDefault(obj) {
18
17
  return obj && obj.__esModule ? obj : {
19
18
  default: obj
@@ -155,7 +154,7 @@ function expandTailwindAtRules(context) {
155
154
  env.DEBUG && console.time("Reading changed files");
156
155
  if (env.OXIDE) {
157
156
  // TODO: Pass through or implement `extractor`
158
- for (let candidate of _oxide.default.parseCandidateStringsFromFiles(context.changedContent)){
157
+ for (let candidate of require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)){
159
158
  candidates.add(candidate);
160
159
  }
161
160
  // for (let { file, content, extension } of context.changedContent) {
@@ -176,16 +175,14 @@ function expandTailwindAtRules(context) {
176
175
  // Generate the actual CSS
177
176
  let classCacheCount = context.classCache.size;
178
177
  env.DEBUG && console.time("Generate rules");
179
- // TODO: Sorting is _probably_ slow, but right now it can guarantee the same order. Eventually
180
- // we will be able to get rid of this.
181
178
  env.DEBUG && console.time("Sorting candidates");
182
- let sortedCandidates = typeof process !== "undefined" && process.env.JEST_WORKER_ID ? new Set([
179
+ let sortedCandidates = env.OXIDE ? candidates : new Set([
183
180
  ...candidates
184
181
  ].sort((a, z)=>{
185
182
  if (a === z) return 0;
186
183
  if (a < z) return -1;
187
184
  return 1;
188
- })) : candidates;
185
+ }));
189
186
  env.DEBUG && console.timeEnd("Sorting candidates");
190
187
  (0, _generateRules.generateRules)(sortedCandidates, context);
191
188
  env.DEBUG && console.timeEnd("Generate rules");
@@ -162,12 +162,12 @@ function applyImportant(matches, classCandidate) {
162
162
  ]
163
163
  });
164
164
  container.walkRules((r)=>{
165
- r.selector = (0, _pluginUtils.updateAllClasses)((0, _pluginUtils.filterSelectorsForClass)(r.selector, classCandidate), (className)=>{
166
- if (className === classCandidate) {
167
- return `!${className}`;
168
- }
169
- return className;
170
- });
165
+ let ast = (0, _postcssSelectorParser.default)().astSync(r.selector);
166
+ // Remove extraneous selectors that do not include the base candidate
167
+ ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
168
+ // Update all instances of the base candidate to include the important marker
169
+ (0, _pluginUtils.updateAllClasses)(ast, (className)=>className === classCandidate ? `!${className}` : className);
170
+ r.selector = ast.toString();
171
171
  r.walkDecls((d)=>d.important = true);
172
172
  });
173
173
  result.push([
@@ -198,10 +198,16 @@ function applyVariant(variant, matches, context) {
198
198
  };
199
199
  // Retrieve "modifier"
200
200
  {
201
- let match = /(.*)\/(.*)$/g.exec(variant);
202
- if (match) {
203
- variant = match[1];
204
- args.modifier = match[2];
201
+ let [baseVariant, ...modifiers] = (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(variant, "/");
202
+ // This is a hack to support variants with `/` in them, like `ar-1/10/20:text-red-500`
203
+ // In this case 1/10 is a value but /20 is a modifier
204
+ if (modifiers.length > 1) {
205
+ baseVariant = baseVariant + "/" + modifiers.slice(0, -1).join("/");
206
+ modifiers = modifiers.slice(-1);
207
+ }
208
+ if (modifiers.length && !context.variantMap.has(variant)) {
209
+ variant = baseVariant;
210
+ args.modifier = modifiers[0];
205
211
  if (!(0, _featureFlags.flagEnabled)(context.tailwindConfig, "generalizedModifiers")) {
206
212
  return [];
207
213
  }
@@ -216,9 +222,9 @@ function applyVariant(variant, matches, context) {
216
222
  // But we don't want:
217
223
  // @-[200px] (`-` is incorrect)
218
224
  // group[:hover] (`-` is missing)
219
- let match1 = /(.)(-?)\[(.*)\]/g.exec(variant);
220
- if (match1) {
221
- let [, char, seperator, value] = match1;
225
+ let match = /(.)(-?)\[(.*)\]/g.exec(variant);
226
+ if (match) {
227
+ let [, char, seperator, value] = match;
222
228
  // @-[200px] case
223
229
  if (char === "@" && seperator === "-") return [];
224
230
  // group[:hover] case
@@ -229,18 +235,21 @@ function applyVariant(variant, matches, context) {
229
235
  }
230
236
  // Register arbitrary variants
231
237
  if (isArbitraryValue(variant) && !context.variantMap.has(variant)) {
238
+ let sort = context.offsets.recordVariant(variant);
232
239
  let selector = (0, _dataTypes.normalize)(variant.slice(1, -1));
233
- if (!(0, _setupContextUtils.isValidVariantFormatString)(selector)) {
240
+ let selectors = (0, _splitAtTopLevelOnlyJs.splitAtTopLevelOnly)(selector, ",");
241
+ // We do not support multiple selectors for arbitrary variants
242
+ if (selectors.length > 1) {
234
243
  return [];
235
244
  }
236
- let fn = (0, _setupContextUtils.parseVariant)(selector);
237
- let sort = context.offsets.recordVariant(variant);
238
- context.variantMap.set(variant, [
239
- [
240
- sort,
241
- fn
242
- ]
243
- ]);
245
+ if (!selectors.every(_setupContextUtils.isValidVariantFormatString)) {
246
+ return [];
247
+ }
248
+ let records = selectors.map((sel, idx)=>[
249
+ context.offsets.applyParallelOffset(sort, idx),
250
+ (0, _setupContextUtils.parseVariant)(sel.trim())
251
+ ]);
252
+ context.variantMap.set(variant, records);
244
253
  }
245
254
  if (context.variantMap.has(variant)) {
246
255
  let isArbitraryVariant = isArbitraryValue(variant);
@@ -167,6 +167,11 @@ class Offsets {
167
167
  if (a.layer !== b.layer) {
168
168
  return this.layerPositions[a.layer] - this.layerPositions[b.layer];
169
169
  }
170
+ // When sorting the `variants` layer, we need to sort based on the parent layer as well within
171
+ // this variants layer.
172
+ if (a.parentLayer !== b.parentLayer) {
173
+ return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer];
174
+ }
170
175
  // Sort based on the sorting function
171
176
  for (let aOptions of a.options){
172
177
  for (let bOptions of b.options){