tailwindcss 0.0.0-oxide-insiders.a7fe2fe → 0.0.0-oxide-insiders.759a8c2

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 (108) hide show
  1. package/lib/cli/build/deps.js +34 -18
  2. package/lib/cli/build/index.js +45 -12
  3. package/lib/cli/build/plugin.js +273 -90
  4. package/lib/cli/build/utils.js +56 -24
  5. package/lib/cli/build/watching.js +156 -38
  6. package/lib/cli/help/index.js +61 -16
  7. package/lib/cli/index.js +121 -62
  8. package/lib/cli/init/index.js +47 -23
  9. package/lib/cli-peer-dependencies.js +23 -13
  10. package/lib/cli.js +5 -1
  11. package/lib/corePluginList.js +7 -4
  12. package/lib/corePlugins.js +855 -386
  13. package/lib/featureFlags.js +43 -18
  14. package/lib/lib/cacheInvalidation.js +78 -30
  15. package/lib/lib/collapseAdjacentRules.js +46 -23
  16. package/lib/lib/collapseDuplicateDeclarations.js +70 -27
  17. package/lib/lib/content.js +134 -41
  18. package/lib/lib/defaultExtractor.js +201 -96
  19. package/lib/lib/detectNesting.js +38 -12
  20. package/lib/lib/evaluateTailwindFunctions.js +192 -103
  21. package/lib/lib/expandApplyAtRules.js +488 -181
  22. package/lib/lib/expandTailwindAtRules.js +240 -70
  23. package/lib/lib/findAtConfigPath.js +34 -15
  24. package/lib/lib/generateRules.js +775 -353
  25. package/lib/lib/getModuleDependencies.js +67 -29
  26. package/lib/lib/load-config.js +27 -17
  27. package/lib/lib/normalizeTailwindDirectives.js +73 -27
  28. package/lib/lib/offsets.js +227 -62
  29. package/lib/lib/partitionApplyAtRules.js +53 -29
  30. package/lib/lib/regex.js +50 -28
  31. package/lib/lib/remap-bitfield.js +86 -9
  32. package/lib/lib/resolveDefaultsAtRules.js +123 -53
  33. package/lib/lib/setupContextUtils.js +1117 -584
  34. package/lib/lib/setupTrackingContext.js +149 -58
  35. package/lib/lib/sharedState.js +71 -23
  36. package/lib/lib/substituteScreenAtRules.js +19 -9
  37. package/lib/oxide/cli/build/deps.js +46 -23
  38. package/lib/oxide/cli/build/index.js +44 -12
  39. package/lib/oxide/cli/build/plugin.js +271 -89
  40. package/lib/oxide/cli/build/utils.js +55 -24
  41. package/lib/oxide/cli/build/watching.js +153 -36
  42. package/lib/oxide/cli/help/index.js +60 -16
  43. package/lib/oxide/cli/index.js +128 -67
  44. package/lib/oxide/cli/init/index.js +40 -19
  45. package/lib/oxide/cli.js +3 -2
  46. package/lib/plugin.js +58 -31
  47. package/lib/postcss-plugins/nesting/index.js +13 -7
  48. package/lib/postcss-plugins/nesting/plugin.js +65 -20
  49. package/lib/processTailwindFeatures.js +41 -10
  50. package/lib/public/colors.js +25 -16
  51. package/lib/public/create-plugin.js +11 -6
  52. package/lib/public/default-config.js +12 -6
  53. package/lib/public/default-theme.js +12 -6
  54. package/lib/public/load-config.js +9 -5
  55. package/lib/public/resolve-config.js +10 -6
  56. package/lib/util/applyImportantSelector.js +28 -17
  57. package/lib/util/bigSign.js +9 -6
  58. package/lib/util/buildMediaQuery.js +19 -10
  59. package/lib/util/cloneDeep.js +19 -9
  60. package/lib/util/cloneNodes.js +29 -14
  61. package/lib/util/color.js +87 -47
  62. package/lib/util/colorNames.js +752 -0
  63. package/lib/util/configurePlugins.js +18 -9
  64. package/lib/util/createPlugin.js +17 -8
  65. package/lib/util/createUtilityPlugin.js +30 -16
  66. package/lib/util/dataTypes.js +189 -38
  67. package/lib/util/defaults.js +21 -9
  68. package/lib/util/escapeClassName.js +15 -9
  69. package/lib/util/escapeCommas.js +9 -6
  70. package/lib/util/flattenColorPalette.js +11 -7
  71. package/lib/util/formatVariantSelector.js +209 -60
  72. package/lib/util/getAllConfigs.js +44 -35
  73. package/lib/util/hashConfig.js +12 -8
  74. package/lib/util/isKeyframeRule.js +10 -7
  75. package/lib/util/isPlainObject.js +14 -9
  76. package/lib/util/isSyntacticallyValidPropertyValue.js +45 -14
  77. package/lib/util/log.js +20 -9
  78. package/lib/util/nameClass.js +31 -10
  79. package/lib/util/negateValue.js +28 -10
  80. package/lib/util/normalizeConfig.js +242 -63
  81. package/lib/util/normalizeScreens.js +145 -70
  82. package/lib/util/parseAnimationValue.js +64 -14
  83. package/lib/util/parseBoxShadowValue.js +63 -14
  84. package/lib/util/parseDependency.js +39 -13
  85. package/lib/util/parseGlob.js +25 -8
  86. package/lib/util/parseObjectStyles.js +29 -18
  87. package/lib/util/pluginUtils.js +196 -77
  88. package/lib/util/prefixSelector.js +31 -12
  89. package/lib/util/pseudoElements.js +116 -34
  90. package/lib/util/removeAlphaVariables.js +23 -8
  91. package/lib/util/resolveConfig.js +224 -105
  92. package/lib/util/resolveConfigPath.js +45 -15
  93. package/lib/util/responsive.js +10 -6
  94. package/lib/util/splitAtTopLevelOnly.js +46 -10
  95. package/lib/util/tap.js +11 -7
  96. package/lib/util/toColorValue.js +10 -7
  97. package/lib/util/toPath.js +28 -8
  98. package/lib/util/transformThemeValue.js +49 -14
  99. package/lib/util/validateConfig.js +25 -15
  100. package/lib/util/validateFormalSyntax.js +14 -6
  101. package/lib/util/withAlphaVariable.js +54 -30
  102. package/package.json +18 -22
  103. package/peers/index.js +57849 -43101
  104. package/src/lib/expandTailwindAtRules.js +1 -1
  105. package/src/lib/setupTrackingContext.js +1 -1
  106. package/src/util/color.js +1 -1
  107. package/src/util/colorNames.js +150 -0
  108. package/src/util/pseudoElements.js +4 -4
@@ -1,18 +1,27 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return buildMediaQuery;
9
+ }
10
+ });
2
11
  function buildMediaQuery(screens) {
3
- return (screens = Array.isArray(screens) ? screens : [
12
+ screens = Array.isArray(screens) ? screens : [
4
13
  screens
5
- ]).map((screen)=>{
6
- let values = screen.values.map((screen)=>void 0 !== screen.raw ? screen.raw : [
14
+ ];
15
+ return screens.map((screen)=>{
16
+ let values = screen.values.map((screen)=>{
17
+ if (screen.raw !== undefined) {
18
+ return screen.raw;
19
+ }
20
+ return [
7
21
  screen.min && `(min-width: ${screen.min})`,
8
22
  screen.max && `(max-width: ${screen.max})`
9
- ].filter(Boolean).join(" and "));
23
+ ].filter(Boolean).join(" and ");
24
+ });
10
25
  return screen.not ? `not all and ${values}` : values;
11
26
  }).join(", ");
12
27
  }
13
- Object.defineProperty(exports, "__esModule", {
14
- value: !0
15
- }), Object.defineProperty(exports, "default", {
16
- enumerable: !0,
17
- get: ()=>buildMediaQuery
18
- });
@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "cloneDeep", {
5
- enumerable: !0,
6
- get: ()=>function cloneDeep(value) {
7
- return Array.isArray(value) ? value.map((child)=>cloneDeep(child)) : "object" == typeof value && null !== value ? Object.fromEntries(Object.entries(value).map(([k, v])=>[
8
- k,
9
- cloneDeep(v)
10
- ])) : value;
11
- }
3
+ value: true
12
4
  });
5
+ Object.defineProperty(exports, "cloneDeep", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return cloneDeep;
9
+ }
10
+ });
11
+ function cloneDeep(value) {
12
+ if (Array.isArray(value)) {
13
+ return value.map((child)=>cloneDeep(child));
14
+ }
15
+ if (typeof value === "object" && value !== null) {
16
+ return Object.fromEntries(Object.entries(value).map(([k, v])=>[
17
+ k,
18
+ cloneDeep(v)
19
+ ]));
20
+ }
21
+ return value;
22
+ }
@@ -1,19 +1,34 @@
1
1
  "use strict";
2
- function cloneNodes(nodes, source, raws) {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return cloneNodes;
9
+ }
10
+ });
11
+ function cloneNodes(nodes, source = undefined, raws = undefined) {
3
12
  return nodes.map((node)=>{
4
13
  var _node_raws_tailwind;
5
- let cloned = node.clone(), shouldOverwriteSource = (null === (_node_raws_tailwind = node.raws.tailwind) || void 0 === _node_raws_tailwind ? void 0 : _node_raws_tailwind.preserveSource) !== !0 || !cloned.source;
6
- return void 0 !== source && shouldOverwriteSource && (cloned.source = source, "walk" in cloned && cloned.walk((child)=>{
7
- child.source = source;
8
- })), void 0 !== raws && (cloned.raws.tailwind = {
9
- ...cloned.raws.tailwind,
10
- ...raws
11
- }), cloned;
14
+ let cloned = node.clone();
15
+ // We always want override the source map
16
+ // except when explicitly told not to
17
+ let shouldOverwriteSource = ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.preserveSource) !== true || !cloned.source;
18
+ if (source !== undefined && shouldOverwriteSource) {
19
+ cloned.source = source;
20
+ if ("walk" in cloned) {
21
+ cloned.walk((child)=>{
22
+ child.source = source;
23
+ });
24
+ }
25
+ }
26
+ if (raws !== undefined) {
27
+ cloned.raws.tailwind = {
28
+ ...cloned.raws.tailwind,
29
+ ...raws
30
+ };
31
+ }
32
+ return cloned;
12
33
  });
13
34
  }
14
- Object.defineProperty(exports, "__esModule", {
15
- value: !0
16
- }), Object.defineProperty(exports, "default", {
17
- enumerable: !0,
18
- get: ()=>cloneNodes
19
- });
package/lib/util/color.js CHANGED
@@ -1,37 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), function(target, all) {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
5
6
  for(var name in all)Object.defineProperty(target, name, {
6
- enumerable: !0,
7
+ enumerable: true,
7
8
  get: all[name]
8
9
  });
9
- }(exports, {
10
- parseColor: ()=>parseColor,
11
- formatColor: ()=>formatColor
10
+ }
11
+ _export(exports, {
12
+ parseColor: function() {
13
+ return parseColor;
14
+ },
15
+ formatColor: function() {
16
+ return formatColor;
17
+ }
12
18
  });
13
- const _colorName = function(obj) {
19
+ const _colorNames = /*#__PURE__*/ _interop_require_default(require("./colorNames"));
20
+ function _interop_require_default(obj) {
14
21
  return obj && obj.__esModule ? obj : {
15
22
  default: obj
16
23
  };
17
- }(require("color-name"));
18
- let HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i, SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i, VALUE = /(?:\d+|\d*\.\d+)%?/, SEP = /(?:\s*,\s*|\s+)/, ALPHA_SEP = /\s*[,/]\s*/, CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/, RGB = 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*\\)$`), HSL = 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*\\)$`);
19
- function parseColor(value, { loose =!1 } = {}) {
20
- var _match_, _match__toString, _value_match;
21
- if ("string" != typeof value) return null;
22
- if ("transparent" === (value = value.trim())) return {
23
- mode: "rgb",
24
- color: [
25
- "0",
26
- "0",
27
- "0"
28
- ],
29
- alpha: "0"
30
- };
31
- if (value in _colorName.default) return {
32
- mode: "rgb",
33
- color: _colorName.default[value].map((v)=>v.toString())
34
- };
24
+ }
25
+ let HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
26
+ let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
27
+ let VALUE = /(?:\d+|\d*\.\d+)%?/;
28
+ let SEP = /(?:\s*,\s*|\s+)/;
29
+ let ALPHA_SEP = /\s*[,/]\s*/;
30
+ let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/;
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*\\)$`);
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*\\)$`);
33
+ function parseColor(value, { loose =false } = {}) {
34
+ var _match_, _match__toString;
35
+ if (typeof value !== "string") {
36
+ return null;
37
+ }
38
+ value = value.trim();
39
+ if (value === "transparent") {
40
+ return {
41
+ mode: "rgb",
42
+ color: [
43
+ "0",
44
+ "0",
45
+ "0"
46
+ ],
47
+ alpha: "0"
48
+ };
49
+ }
50
+ if (value in _colorNames.default) {
51
+ return {
52
+ mode: "rgb",
53
+ color: _colorNames.default[value].map((v)=>v.toString())
54
+ };
55
+ }
35
56
  let hex = value.replace(SHORT_HEX, (_, r, g, b, a)=>[
36
57
  "#",
37
58
  r,
@@ -42,35 +63,54 @@ function parseColor(value, { loose =!1 } = {}) {
42
63
  b,
43
64
  a ? a + a : ""
44
65
  ].join("")).match(HEX);
45
- if (null !== hex) return {
46
- mode: "rgb",
47
- color: [
48
- parseInt(hex[1], 16),
49
- parseInt(hex[2], 16),
50
- parseInt(hex[3], 16)
51
- ].map((v)=>v.toString()),
52
- alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : void 0
53
- };
54
- let match = null !== (_value_match = value.match(RGB)) && void 0 !== _value_match ? _value_match : value.match(HSL);
55
- if (null === match) return null;
66
+ if (hex !== null) {
67
+ return {
68
+ mode: "rgb",
69
+ color: [
70
+ parseInt(hex[1], 16),
71
+ parseInt(hex[2], 16),
72
+ parseInt(hex[3], 16)
73
+ ].map((v)=>v.toString()),
74
+ alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined
75
+ };
76
+ }
77
+ var _value_match;
78
+ let match = (_value_match = value.match(RGB)) !== null && _value_match !== void 0 ? _value_match : value.match(HSL);
79
+ if (match === null) {
80
+ return null;
81
+ }
56
82
  let color = [
57
83
  match[2],
58
84
  match[3],
59
85
  match[4]
60
86
  ].filter(Boolean).map((v)=>v.toString());
61
- return 2 === color.length && color[0].startsWith("var(") ? {
62
- mode: match[1],
63
- color: [
64
- color[0]
65
- ],
66
- alpha: color[1]
67
- } : (loose || 3 === color.length) && (!(color.length < 3) || color.some((part)=>/^var\(.*?\)$/.test(part))) ? {
87
+ // rgba(var(--my-color), 0.1)
88
+ // hsla(var(--my-color), 0.1)
89
+ if (color.length === 2 && color[0].startsWith("var(")) {
90
+ return {
91
+ mode: match[1],
92
+ color: [
93
+ color[0]
94
+ ],
95
+ alpha: color[1]
96
+ };
97
+ }
98
+ if (!loose && color.length !== 3) {
99
+ return null;
100
+ }
101
+ if (color.length < 3 && !color.some((part)=>/^var\(.*?\)$/.test(part))) {
102
+ return null;
103
+ }
104
+ return {
68
105
  mode: match[1],
69
106
  color,
70
- alpha: null === (_match_ = match[5]) || void 0 === _match_ ? void 0 : null === (_match__toString = _match_.toString) || void 0 === _match__toString ? void 0 : _match__toString.call(_match_)
71
- } : null;
107
+ alpha: (_match_ = match[5]) === null || _match_ === void 0 ? void 0 : (_match__toString = _match_.toString) === null || _match__toString === void 0 ? void 0 : _match__toString.call(_match_)
108
+ };
72
109
  }
73
110
  function formatColor({ mode , color , alpha }) {
74
- let hasAlpha = void 0 !== alpha;
75
- return "rgba" === mode || "hsla" === mode ? `${mode}(${color.join(", ")}${hasAlpha ? `, ${alpha}` : ""})` : `${mode}(${color.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`;
111
+ let hasAlpha = alpha !== undefined;
112
+ if (mode === "rgba" || mode === "hsla") {
113
+ return `${mode}(${color.join(", ")}${hasAlpha ? `, ${alpha}` : ""})`;
114
+ }
115
+ return `${mode}(${color.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`;
76
116
  }