tailwindcss 0.0.0-insiders.dddaded → 0.0.0-insiders.de00a62

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 (160) hide show
  1. package/lib/cli/build/deps.js +17 -9
  2. package/lib/cli/build/index.js +10 -8
  3. package/lib/cli/build/plugin.js +31 -29
  4. package/lib/cli/build/utils.js +18 -8
  5. package/lib/cli/build/watching.js +13 -11
  6. package/lib/cli/help/index.js +6 -4
  7. package/lib/cli/index.js +4 -4
  8. package/lib/cli/init/index.js +8 -6
  9. package/lib/cli-peer-dependencies.js +12 -4
  10. package/lib/cli.js +1 -1
  11. package/lib/corePluginList.js +8 -2
  12. package/lib/corePlugins.js +211 -48
  13. package/lib/css/preflight.css +24 -8
  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 +51 -14
  20. package/lib/lib/defaultExtractor.js +38 -28
  21. package/lib/lib/detectNesting.js +3 -1
  22. package/lib/lib/evaluateTailwindFunctions.js +20 -16
  23. package/lib/lib/expandApplyAtRules.js +41 -33
  24. package/lib/lib/expandTailwindAtRules.js +38 -19
  25. package/lib/lib/findAtConfigPath.js +6 -4
  26. package/lib/lib/generateRules.js +83 -55
  27. package/lib/lib/getModuleDependencies.js +10 -8
  28. package/lib/lib/load-config.js +18 -5
  29. package/lib/lib/normalizeTailwindDirectives.js +5 -3
  30. package/lib/lib/offsets.js +58 -7
  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 +27 -21
  35. package/lib/lib/setupContextUtils.js +143 -94
  36. package/lib/lib/setupTrackingContext.js +27 -24
  37. package/lib/lib/sharedState.js +28 -24
  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 +25 -23
  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 +9 -9
  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 +16 -14
  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 +7 -5
  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 +36 -14
  62. package/lib/util/color.js +11 -7
  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 +180 -31
  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 +36 -21
  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 +4 -2
  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 -5
  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 +43 -18
  89. package/lib/util/prefixSelector.js +6 -4
  90. package/lib/util/pseudoElements.js +24 -35
  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 +5 -3
  101. package/lib/util/validateFormalSyntax.js +3 -1
  102. package/lib/util/withAlphaVariable.js +6 -2
  103. package/lib/value-parser/LICENSE +22 -0
  104. package/lib/value-parser/README.md +3 -0
  105. package/lib/value-parser/index.d.js +2 -0
  106. package/lib/value-parser/index.js +22 -0
  107. package/lib/value-parser/parse.js +259 -0
  108. package/lib/value-parser/stringify.js +38 -0
  109. package/lib/value-parser/unit.js +86 -0
  110. package/lib/value-parser/walk.js +16 -0
  111. package/nesting/index.d.ts +4 -0
  112. package/package.json +31 -36
  113. package/peers/index.js +65266 -48224
  114. package/resolveConfig.d.ts +22 -3
  115. package/scripts/generate-types.js +1 -2
  116. package/src/cli/build/plugin.js +7 -7
  117. package/src/cli/build/watching.js +1 -1
  118. package/src/cli.js +1 -1
  119. package/src/corePluginList.js +1 -1
  120. package/src/corePlugins.js +165 -29
  121. package/src/css/preflight.css +24 -8
  122. package/src/featureFlags.js +3 -8
  123. package/src/index.js +1 -5
  124. package/src/lib/content.js +42 -1
  125. package/src/lib/defaultExtractor.js +30 -17
  126. package/src/lib/evaluateTailwindFunctions.js +4 -1
  127. package/src/lib/expandApplyAtRules.js +7 -0
  128. package/src/lib/expandTailwindAtRules.js +26 -9
  129. package/src/lib/generateRules.js +50 -26
  130. package/src/lib/load-config.ts +8 -0
  131. package/src/lib/offsets.js +61 -2
  132. package/src/lib/resolveDefaultsAtRules.js +5 -1
  133. package/src/lib/setupContextUtils.js +77 -38
  134. package/src/lib/setupTrackingContext.js +2 -4
  135. package/src/lib/sharedState.js +0 -15
  136. package/src/oxide/cli/build/plugin.ts +7 -7
  137. package/src/plugin.js +4 -4
  138. package/src/processTailwindFeatures.js +3 -2
  139. package/src/util/cloneNodes.js +35 -14
  140. package/src/util/color.js +2 -2
  141. package/src/util/colorNames.js +150 -0
  142. package/src/util/dataTypes.js +143 -18
  143. package/src/util/formatVariantSelector.js +11 -3
  144. package/src/util/isPlainObject.js +1 -1
  145. package/src/util/pluginUtils.js +17 -5
  146. package/src/util/prefixSelector.js +1 -0
  147. package/src/util/pseudoElements.js +18 -17
  148. package/src/value-parser/LICENSE +22 -0
  149. package/src/value-parser/README.md +3 -0
  150. package/src/value-parser/index.d.ts +177 -0
  151. package/src/value-parser/index.js +28 -0
  152. package/src/value-parser/parse.js +303 -0
  153. package/src/value-parser/stringify.js +41 -0
  154. package/src/value-parser/unit.js +118 -0
  155. package/src/value-parser/walk.js +18 -0
  156. package/stubs/config.full.js +86 -14
  157. package/types/config.d.ts +17 -9
  158. package/types/generated/corePluginList.d.ts +1 -1
  159. package/types/generated/default-theme.d.ts +35 -9
  160. package/types/index.d.ts +7 -3
@@ -1,32 +1,54 @@
1
- "use strict";
1
+ /**
2
+ * @param {import('postcss').Container[]} nodes
3
+ * @param {any} source
4
+ * @param {any} raws
5
+ * @returns {import('postcss').Container[]}
6
+ */ "use strict";
2
7
  Object.defineProperty(exports, "__esModule", {
3
8
  value: true
4
9
  });
5
10
  Object.defineProperty(exports, "default", {
6
11
  enumerable: true,
7
- get: ()=>cloneNodes
12
+ get: function() {
13
+ return cloneNodes;
14
+ }
8
15
  });
9
16
  function cloneNodes(nodes, source = undefined, raws = undefined) {
10
17
  return nodes.map((node)=>{
11
- var _node_raws_tailwind;
12
18
  let cloned = node.clone();
13
- // We always want override the source map
14
- // except when explicitly told not to
15
- let shouldOverwriteSource = ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.preserveSource) !== true || !cloned.source;
16
- if (source !== undefined && shouldOverwriteSource) {
17
- cloned.source = source;
18
- if ("walk" in cloned) {
19
- cloned.walk((child)=>{
20
- child.source = source;
21
- });
22
- }
23
- }
24
19
  if (raws !== undefined) {
25
20
  cloned.raws.tailwind = {
26
21
  ...cloned.raws.tailwind,
27
22
  ...raws
28
23
  };
29
24
  }
25
+ if (source !== undefined) {
26
+ traverse(cloned, (node)=>{
27
+ var _node_raws_tailwind;
28
+ // Do not traverse nodes that have opted
29
+ // to preserve their original source
30
+ let shouldPreserveSource = ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.preserveSource) === true && node.source;
31
+ if (shouldPreserveSource) {
32
+ return false;
33
+ }
34
+ // Otherwise we can safely replace the source
35
+ // And continue traversing
36
+ node.source = source;
37
+ });
38
+ }
30
39
  return cloned;
31
40
  });
32
41
  }
42
+ /**
43
+ * Traverse a tree of nodes and don't traverse children if the callback
44
+ * returns false. Ideally we'd use Container#walk instead of this
45
+ * function but it stops traversing siblings too.
46
+ *
47
+ * @param {import('postcss').Container} node
48
+ * @param {(node: import('postcss').Container) => boolean} onNode
49
+ */ function traverse(node, onNode) {
50
+ if (onNode(node) !== false) {
51
+ var _node_each;
52
+ (_node_each = node.each) === null || _node_each === void 0 ? void 0 : _node_each.call(node, (child)=>traverse(child, onNode));
53
+ }
54
+ }
package/lib/util/color.js CHANGED
@@ -9,11 +9,15 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- parseColor: ()=>parseColor,
13
- formatColor: ()=>formatColor
12
+ parseColor: function() {
13
+ return parseColor;
14
+ },
15
+ formatColor: function() {
16
+ return formatColor;
17
+ }
14
18
  });
15
- const _colorName = /*#__PURE__*/ _interopRequireDefault(require("color-name"));
16
- function _interopRequireDefault(obj) {
19
+ const _colorNames = /*#__PURE__*/ _interop_require_default(require("./colorNames"));
20
+ function _interop_require_default(obj) {
17
21
  return obj && obj.__esModule ? obj : {
18
22
  default: obj
19
23
  };
@@ -23,7 +27,7 @@ let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
23
27
  let VALUE = /(?:\d+|\d*\.\d+)%?/;
24
28
  let SEP = /(?:\s*,\s*|\s+)/;
25
29
  let ALPHA_SEP = /\s*[,/]\s*/;
26
- let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/;
30
+ let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)(?:,(?:[^ )]*?|var\(--[^ )]*?\)))?\)/;
27
31
  let RGB = new RegExp(`^(rgba?)\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
28
32
  let HSL = new RegExp(`^(hsla?)\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
29
33
  function parseColor(value, { loose =false } = {}) {
@@ -43,10 +47,10 @@ function parseColor(value, { loose =false } = {}) {
43
47
  alpha: "0"
44
48
  };
45
49
  }
46
- if (value in _colorName.default) {
50
+ if (value in _colorNames.default) {
47
51
  return {
48
52
  mode: "rgb",
49
- color: _colorName.default[value].map((v)=>v.toString())
53
+ color: _colorNames.default[value].map((v)=>v.toString())
50
54
  };
51
55
  }
52
56
  let hex = value.replace(SHORT_HEX, (_, r, g, b, a)=>[