tailwindcss 0.0.0-oxide-insiders.a7fe2fe → 0.0.0-oxide-insiders.7f555c4

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,14 +1,23 @@
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 _default;
9
+ }
10
+ });
2
11
  function _default(pluginConfig, plugins) {
3
- if (void 0 === pluginConfig) return plugins;
4
- let pluginNames = Array.isArray(pluginConfig) ? pluginConfig : [
5
- ...new Set(plugins.filter((pluginName)=>!1 !== pluginConfig && !1 !== pluginConfig[pluginName]).concat(Object.keys(pluginConfig).filter((pluginName)=>!1 !== pluginConfig[pluginName])))
12
+ if (pluginConfig === undefined) {
13
+ return plugins;
14
+ }
15
+ const pluginNames = Array.isArray(pluginConfig) ? pluginConfig : [
16
+ ...new Set(plugins.filter((pluginName)=>{
17
+ return pluginConfig !== false && pluginConfig[pluginName] !== false;
18
+ }).concat(Object.keys(pluginConfig).filter((pluginName)=>{
19
+ return pluginConfig[pluginName] !== false;
20
+ })))
6
21
  ];
7
22
  return pluginNames;
8
23
  }
9
- Object.defineProperty(exports, "__esModule", {
10
- value: !0
11
- }), Object.defineProperty(exports, "default", {
12
- enumerable: !0,
13
- get: ()=>_default
14
- });
@@ -1,23 +1,32 @@
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 _default;
9
+ }
10
+ });
2
11
  function createPlugin(plugin, config) {
3
12
  return {
4
13
  handler: plugin,
5
14
  config
6
15
  };
7
16
  }
8
- Object.defineProperty(exports, "__esModule", {
9
- value: !0
10
- }), Object.defineProperty(exports, "default", {
11
- enumerable: !0,
12
- get: ()=>_default
13
- }), createPlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {
14
- let optionsFunction = function(options) {
17
+ createPlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {
18
+ const optionsFunction = function(options) {
15
19
  return {
16
20
  __options: options,
17
21
  handler: pluginFunction(options),
18
22
  config: configFunction(options)
19
23
  };
20
24
  };
21
- return optionsFunction.__isOptionsFunction = !0, optionsFunction.__pluginFunction = pluginFunction, optionsFunction.__configFunction = configFunction, optionsFunction;
25
+ optionsFunction.__isOptionsFunction = true;
26
+ // Expose plugin dependencies so that `object-hash` returns a different
27
+ // value if anything here changes, to ensure a rebuild is triggered.
28
+ optionsFunction.__pluginFunction = pluginFunction;
29
+ optionsFunction.__configFunction = configFunction;
30
+ return optionsFunction;
22
31
  };
23
32
  const _default = createPlugin;
@@ -1,15 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "default", {
5
- enumerable: !0,
6
- get: ()=>createUtilityPlugin
3
+ value: true
7
4
  });
8
- const _transformThemeValue = function(obj) {
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return createUtilityPlugin;
9
+ }
10
+ });
11
+ const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./transformThemeValue"));
12
+ function _interop_require_default(obj) {
9
13
  return obj && obj.__esModule ? obj : {
10
14
  default: obj
11
15
  };
12
- }(require("./transformThemeValue"));
16
+ }
13
17
  function createUtilityPlugin(themeKey, utilityVariations = [
14
18
  [
15
19
  themeKey,
@@ -17,22 +21,32 @@ function createUtilityPlugin(themeKey, utilityVariations = [
17
21
  themeKey
18
22
  ]
19
23
  ]
20
- ], { filterDefault =!1 , ...options } = {}) {
24
+ ], { filterDefault =false , ...options } = {}) {
21
25
  let transformValue = (0, _transformThemeValue.default)(themeKey);
22
26
  return function({ matchUtilities , theme }) {
23
27
  for (let utilityVariation of utilityVariations){
24
- var _theme;
25
- matchUtilities((Array.isArray(utilityVariation[0]) ? utilityVariation : [
28
+ let group = Array.isArray(utilityVariation[0]) ? utilityVariation : [
26
29
  utilityVariation
27
- ]).reduce((obj, [classPrefix, properties])=>Object.assign(obj, {
28
- [classPrefix]: (value)=>properties.reduce((obj, name)=>Array.isArray(name) ? Object.assign(obj, {
29
- [name[0]]: name[1]
30
- }) : Object.assign(obj, {
30
+ ];
31
+ var _theme;
32
+ matchUtilities(group.reduce((obj, [classPrefix, properties])=>{
33
+ return Object.assign(obj, {
34
+ [classPrefix]: (value)=>{
35
+ return properties.reduce((obj, name)=>{
36
+ if (Array.isArray(name)) {
37
+ return Object.assign(obj, {
38
+ [name[0]]: name[1]
39
+ });
40
+ }
41
+ return Object.assign(obj, {
31
42
  [name]: transformValue(value)
32
- }), {})
33
- }), {}), {
43
+ });
44
+ }, {});
45
+ }
46
+ });
47
+ }, {}), {
34
48
  ...options,
35
- values: filterDefault ? Object.fromEntries(Object.entries(null !== (_theme = theme(themeKey)) && void 0 !== _theme ? _theme : {}).filter(([modifier])=>"DEFAULT" !== modifier)) : theme(themeKey)
49
+ values: filterDefault ? Object.fromEntries(Object.entries((_theme = theme(themeKey)) !== null && _theme !== void 0 ? _theme : {}).filter(([modifier])=>modifier !== "DEFAULT")) : theme(themeKey)
36
50
  });
37
51
  }
38
52
  };
@@ -1,44 +1,104 @@
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
- normalize: ()=>normalize,
11
- url: ()=>url,
12
- number: ()=>number,
13
- percentage: ()=>percentage,
14
- length: ()=>length,
15
- lineWidth: ()=>lineWidth,
16
- shadow: ()=>shadow,
17
- color: ()=>color,
18
- image: ()=>image,
19
- gradient: ()=>gradient,
20
- position: ()=>position,
21
- familyName: ()=>familyName,
22
- genericName: ()=>genericName,
23
- absoluteSize: ()=>absoluteSize,
24
- relativeSize: ()=>relativeSize
10
+ }
11
+ _export(exports, {
12
+ normalize: function() {
13
+ return normalize;
14
+ },
15
+ url: function() {
16
+ return url;
17
+ },
18
+ number: function() {
19
+ return number;
20
+ },
21
+ percentage: function() {
22
+ return percentage;
23
+ },
24
+ length: function() {
25
+ return length;
26
+ },
27
+ lineWidth: function() {
28
+ return lineWidth;
29
+ },
30
+ shadow: function() {
31
+ return shadow;
32
+ },
33
+ color: function() {
34
+ return color;
35
+ },
36
+ image: function() {
37
+ return image;
38
+ },
39
+ gradient: function() {
40
+ return gradient;
41
+ },
42
+ position: function() {
43
+ return position;
44
+ },
45
+ familyName: function() {
46
+ return familyName;
47
+ },
48
+ genericName: function() {
49
+ return genericName;
50
+ },
51
+ absoluteSize: function() {
52
+ return absoluteSize;
53
+ },
54
+ relativeSize: function() {
55
+ return relativeSize;
56
+ }
25
57
  });
26
- const _color = require("./color"), _parseBoxShadowValue = require("./parseBoxShadowValue"), _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
58
+ const _color = require("./color");
59
+ const _parseBoxShadowValue = require("./parseBoxShadowValue");
60
+ const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
27
61
  let cssFunctions = [
28
62
  "min",
29
63
  "max",
30
64
  "clamp",
31
65
  "calc"
32
66
  ];
67
+ // Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
33
68
  function isCSSFunction(value) {
34
- return cssFunctions.some((fn)=>RegExp(`^${fn}\\(.*\\)`).test(value));
69
+ return cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.*\\)`).test(value));
35
70
  }
36
- const placeholder = "--tw-placeholder", placeholderRe = RegExp(placeholder, "g");
37
- function normalize(value, isRoot = !0) {
38
- return value.startsWith("--") ? `var(${value})` : value.includes("url(") ? value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>/^url\(.*?\)$/.test(part) ? part : normalize(part, !1)).join("") : (value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_"), isRoot && (value = value.trim()), value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
71
+ const placeholder = "--tw-placeholder";
72
+ const placeholderRe = new RegExp(placeholder, "g");
73
+ function normalize(value, isRoot = true) {
74
+ if (value.startsWith("--")) {
75
+ return `var(${value})`;
76
+ }
77
+ // Keep raw strings if it starts with `url(`
78
+ if (value.includes("url(")) {
79
+ return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
80
+ if (/^url\(.*?\)$/.test(part)) {
81
+ return part;
82
+ }
83
+ return normalize(part, false);
84
+ }).join("");
85
+ }
86
+ // Convert `_` to ` `, except for escaped underscores `\_`
87
+ value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_");
88
+ // Remove leftover whitespace
89
+ if (isRoot) {
90
+ value = value.trim();
91
+ }
92
+ // Add spaces around operators inside math functions like calc() that do not follow an operator
93
+ // or '('.
94
+ value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
39
95
  let vars = [];
40
- return match.replace(/var\((--.+?)[,)]/g, (match, g1)=>(vars.push(g1), match.replace(g1, placeholder))).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(placeholderRe, ()=>vars.shift());
41
- }));
96
+ return match.replace(/var\((--.+?)[,)]/g, (match, g1)=>{
97
+ vars.push(g1);
98
+ return match.replace(g1, placeholder);
99
+ }).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(placeholderRe, ()=>vars.shift());
100
+ });
101
+ return value;
42
102
  }
43
103
  function url(value) {
44
104
  return value.startsWith("url(");
@@ -49,8 +109,45 @@ function number(value) {
49
109
  function percentage(value) {
50
110
  return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value);
51
111
  }
112
+ // Please refer to MDN when updating this list:
113
+ // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units
114
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units
115
+ let lengthUnits = [
116
+ "cm",
117
+ "mm",
118
+ "Q",
119
+ "in",
120
+ "pc",
121
+ "pt",
122
+ "px",
123
+ "em",
124
+ "ex",
125
+ "ch",
126
+ "rem",
127
+ "lh",
128
+ "rlh",
129
+ "vw",
130
+ "vh",
131
+ "vmin",
132
+ "vmax",
133
+ "vb",
134
+ "vi",
135
+ "svw",
136
+ "svh",
137
+ "lvw",
138
+ "lvh",
139
+ "dvw",
140
+ "dvh",
141
+ "cqw",
142
+ "cqh",
143
+ "cqi",
144
+ "cqb",
145
+ "cqmin",
146
+ "cqmax"
147
+ ];
148
+ let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`;
52
149
  function length(value) {
53
- return "0" === value || RegExp("^[+-]?[0-9]*\\.?[0-9]+(?:[eE][+-]?[0-9]+)?(?:cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cqw|cqh|cqi|cqb|cqmin|cqmax)$").test(value) || isCSSFunction(value);
150
+ return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value);
54
151
  }
55
152
  let lineWidths = new Set([
56
153
  "thin",
@@ -61,23 +158,45 @@ function lineWidth(value) {
61
158
  return lineWidths.has(value);
62
159
  }
63
160
  function shadow(value) {
64
- for (let parsedShadow of (0, _parseBoxShadowValue.parseBoxShadowValue)(normalize(value)))if (!parsedShadow.valid) return !1;
65
- return !0;
161
+ let parsedShadows = (0, _parseBoxShadowValue.parseBoxShadowValue)(normalize(value));
162
+ for (let parsedShadow of parsedShadows){
163
+ if (!parsedShadow.valid) {
164
+ return false;
165
+ }
166
+ }
167
+ return true;
66
168
  }
67
169
  function color(value) {
68
170
  let colors = 0;
69
- return !!(0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>!!(part = normalize(part)).startsWith("var(") || null !== (0, _color.parseColor)(part, {
70
- loose: !0
71
- }) && (colors++, !0)) && colors > 0;
171
+ let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
172
+ part = normalize(part);
173
+ if (part.startsWith("var(")) return true;
174
+ if ((0, _color.parseColor)(part, {
175
+ loose: true
176
+ }) !== null) return colors++, true;
177
+ return false;
178
+ });
179
+ if (!result) return false;
180
+ return colors > 0;
72
181
  }
73
182
  function image(value) {
74
183
  let images = 0;
75
- return !!(0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>!!(part = normalize(part)).startsWith("var(") || !!(url(part) || gradient(part) || [
184
+ let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
185
+ part = normalize(part);
186
+ if (part.startsWith("var(")) return true;
187
+ if (url(part) || gradient(part) || [
76
188
  "element(",
77
189
  "image(",
78
190
  "cross-fade(",
79
191
  "image-set("
80
- ].some((fn)=>part.startsWith(fn))) && (images++, !0)) && images > 0;
192
+ ].some((fn)=>part.startsWith(fn))) {
193
+ images++;
194
+ return true;
195
+ }
196
+ return false;
197
+ });
198
+ if (!result) return false;
199
+ return images > 0;
81
200
  }
82
201
  let gradientTypes = new Set([
83
202
  "linear-gradient",
@@ -87,8 +206,13 @@ let gradientTypes = new Set([
87
206
  "conic-gradient"
88
207
  ]);
89
208
  function gradient(value) {
90
- for (let type of (value = normalize(value), gradientTypes))if (value.startsWith(`${type}(`)) return !0;
91
- return !1;
209
+ value = normalize(value);
210
+ for (let type of gradientTypes){
211
+ if (value.startsWith(`${type}(`)) {
212
+ return true;
213
+ }
214
+ }
215
+ return false;
92
216
  }
93
217
  let validPositions = new Set([
94
218
  "center",
@@ -99,11 +223,38 @@ let validPositions = new Set([
99
223
  ]);
100
224
  function position(value) {
101
225
  let positions = 0;
102
- return !!(0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>!!(part = normalize(part)).startsWith("var(") || !!(validPositions.has(part) || length(part) || percentage(part)) && (positions++, !0)) && positions > 0;
226
+ let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
227
+ part = normalize(part);
228
+ if (part.startsWith("var(")) return true;
229
+ if (validPositions.has(part) || length(part) || percentage(part)) {
230
+ positions++;
231
+ return true;
232
+ }
233
+ return false;
234
+ });
235
+ if (!result) return false;
236
+ return positions > 0;
103
237
  }
104
238
  function familyName(value) {
105
239
  let fonts = 0;
106
- return !!(0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>!!(part = normalize(part)).startsWith("var(") || !(part.includes(" ") && !/(['"])([^"']+)\1/g.test(part) || /^\d/g.test(part)) && (fonts++, !0)) && fonts > 0;
240
+ let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
241
+ part = normalize(part);
242
+ if (part.startsWith("var(")) return true;
243
+ // If it contains spaces, then it should be quoted
244
+ if (part.includes(" ")) {
245
+ if (!/(['"])([^"']+)\1/g.test(part)) {
246
+ return false;
247
+ }
248
+ }
249
+ // If it starts with a number, it's invalid
250
+ if (/^\d/g.test(part)) {
251
+ return false;
252
+ }
253
+ fonts++;
254
+ return true;
255
+ });
256
+ if (!result) return false;
257
+ return fonts > 0;
107
258
  }
108
259
  let genericNames = new Set([
109
260
  "serif",
@@ -1,15 +1,27 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "defaults", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return defaults;
9
+ }
10
+ });
2
11
  function defaults(target, ...sources) {
3
12
  for (let source of sources){
4
- var _target_hasOwnProperty, _target_hasOwnProperty1;
5
- for(let k in source)(null == target ? void 0 : null === (_target_hasOwnProperty = target.hasOwnProperty) || void 0 === _target_hasOwnProperty ? void 0 : _target_hasOwnProperty.call(target, k)) || (target[k] = source[k]);
6
- for (let k of Object.getOwnPropertySymbols(source))(null == target ? void 0 : null === (_target_hasOwnProperty1 = target.hasOwnProperty) || void 0 === _target_hasOwnProperty1 ? void 0 : _target_hasOwnProperty1.call(target, k)) || (target[k] = source[k]);
13
+ for(let k in source){
14
+ var _target_hasOwnProperty;
15
+ if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty = target.hasOwnProperty) === null || _target_hasOwnProperty === void 0 ? void 0 : _target_hasOwnProperty.call(target, k))) {
16
+ target[k] = source[k];
17
+ }
18
+ }
19
+ for (let k of Object.getOwnPropertySymbols(source)){
20
+ var _target_hasOwnProperty1;
21
+ if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
22
+ target[k] = source[k];
23
+ }
24
+ }
7
25
  }
8
26
  return target;
9
27
  }
10
- Object.defineProperty(exports, "__esModule", {
11
- value: !0
12
- }), Object.defineProperty(exports, "defaults", {
13
- enumerable: !0,
14
- get: ()=>defaults
15
- });
@@ -1,18 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "default", {
5
- enumerable: !0,
6
- get: ()=>escapeClassName
3
+ value: true
7
4
  });
8
- const _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser")), _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
9
- function _interopRequireDefault(obj) {
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return escapeClassName;
9
+ }
10
+ });
11
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
12
+ const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
13
+ function _interop_require_default(obj) {
10
14
  return obj && obj.__esModule ? obj : {
11
15
  default: obj
12
16
  };
13
17
  }
14
18
  function escapeClassName(className) {
15
- var _node_raws, _node_raws_value;
16
- let node = _postcssSelectorParser.default.className();
17
- return node.value = className, (0, _escapeCommas.default)(null !== (_node_raws_value = null == node ? void 0 : null === (_node_raws = node.raws) || void 0 === _node_raws ? void 0 : _node_raws.value) && void 0 !== _node_raws_value ? _node_raws_value : node.value);
19
+ var _node_raws;
20
+ let node = _postcssselectorparser.default.className();
21
+ node.value = className;
22
+ var _node_raws_value;
23
+ return (0, _escapeCommas.default)((_node_raws_value = node === null || node === void 0 ? void 0 : (_node_raws = node.raws) === null || _node_raws === void 0 ? void 0 : _node_raws.value) !== null && _node_raws_value !== void 0 ? _node_raws_value : node.value);
18
24
  }
@@ -1,10 +1,13 @@
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 escapeCommas;
9
+ }
10
+ });
2
11
  function escapeCommas(className) {
3
12
  return className.replace(/\\,/g, "\\2c ");
4
13
  }
5
- Object.defineProperty(exports, "__esModule", {
6
- value: !0
7
- }), Object.defineProperty(exports, "default", {
8
- enumerable: !0,
9
- get: ()=>escapeCommas
10
- });
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "default", {
5
- enumerable: !0,
6
- get: ()=>_default
3
+ value: true
7
4
  });
8
- const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(null != colors ? colors : {}).flatMap(([color, values])=>"object" == typeof values ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
9
- [color + ("DEFAULT" === number ? "" : `-${number}`)]: hex
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
12
+ [color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
10
13
  })) : [
11
14
  {
12
15
  [`${color}`]: values
13
16
  }
14
- ])), _default = flattenColorPalette;
17
+ ]));
18
+ const _default = flattenColorPalette;