tailwindcss 3.0.23 → 3.1.1

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 (119) hide show
  1. package/CHANGELOG.md +92 -2
  2. package/colors.d.ts +3 -0
  3. package/defaultConfig.d.ts +3 -0
  4. package/defaultTheme.d.ts +3 -0
  5. package/lib/cli-peer-dependencies.js +10 -5
  6. package/lib/cli.js +266 -203
  7. package/lib/constants.js +8 -8
  8. package/lib/corePluginList.js +1 -0
  9. package/lib/corePlugins.js +1640 -1562
  10. package/lib/css/preflight.css +1 -8
  11. package/lib/featureFlags.js +14 -12
  12. package/lib/index.js +16 -6
  13. package/lib/lib/cacheInvalidation.js +87 -0
  14. package/lib/lib/collapseAdjacentRules.js +30 -15
  15. package/lib/lib/collapseDuplicateDeclarations.js +1 -1
  16. package/lib/lib/defaultExtractor.js +191 -32
  17. package/lib/lib/detectNesting.js +9 -9
  18. package/lib/lib/evaluateTailwindFunctions.js +37 -28
  19. package/lib/lib/expandApplyAtRules.js +379 -189
  20. package/lib/lib/expandTailwindAtRules.js +168 -144
  21. package/lib/lib/generateRules.js +177 -95
  22. package/lib/lib/getModuleDependencies.js +14 -14
  23. package/lib/lib/normalizeTailwindDirectives.js +35 -35
  24. package/lib/lib/partitionApplyAtRules.js +7 -7
  25. package/lib/lib/regex.js +52 -0
  26. package/lib/lib/resolveDefaultsAtRules.js +96 -81
  27. package/lib/lib/setupContextUtils.js +202 -159
  28. package/lib/lib/setupTrackingContext.js +61 -63
  29. package/lib/lib/sharedState.js +10 -9
  30. package/lib/lib/substituteScreenAtRules.js +3 -4
  31. package/lib/postcss-plugins/nesting/README.md +2 -2
  32. package/lib/postcss-plugins/nesting/index.js +1 -1
  33. package/lib/postcss-plugins/nesting/plugin.js +40 -9
  34. package/lib/processTailwindFeatures.js +7 -7
  35. package/lib/public/colors.js +241 -241
  36. package/lib/public/resolve-config.js +5 -5
  37. package/lib/util/buildMediaQuery.js +2 -3
  38. package/lib/util/cloneDeep.js +3 -5
  39. package/lib/util/cloneNodes.js +12 -1
  40. package/lib/util/color.js +42 -51
  41. package/lib/util/createPlugin.js +1 -2
  42. package/lib/util/createUtilityPlugin.js +6 -7
  43. package/lib/util/dataTypes.js +85 -81
  44. package/lib/util/escapeClassName.js +5 -5
  45. package/lib/util/escapeCommas.js +1 -1
  46. package/lib/util/flattenColorPalette.js +4 -7
  47. package/lib/util/formatVariantSelector.js +82 -75
  48. package/lib/util/getAllConfigs.js +15 -10
  49. package/lib/util/hashConfig.js +5 -5
  50. package/lib/util/isKeyframeRule.js +1 -1
  51. package/lib/util/isPlainObject.js +1 -1
  52. package/lib/util/isValidArbitraryValue.js +26 -27
  53. package/lib/util/log.js +9 -10
  54. package/lib/util/nameClass.js +7 -7
  55. package/lib/util/negateValue.js +4 -5
  56. package/lib/util/normalizeConfig.js +68 -58
  57. package/lib/util/normalizeScreens.js +5 -6
  58. package/lib/util/parseAnimationValue.js +56 -57
  59. package/lib/util/parseBoxShadowValue.js +19 -20
  60. package/lib/util/parseDependency.js +32 -32
  61. package/lib/util/parseObjectStyles.js +6 -6
  62. package/lib/util/pluginUtils.js +20 -12
  63. package/lib/util/prefixSelector.js +1 -1
  64. package/lib/util/resolveConfig.js +81 -58
  65. package/lib/util/resolveConfigPath.js +16 -16
  66. package/lib/util/responsive.js +6 -6
  67. package/lib/util/splitAtTopLevelOnly.js +90 -0
  68. package/lib/util/toColorValue.js +1 -1
  69. package/lib/util/toPath.js +2 -2
  70. package/lib/util/transformThemeValue.js +30 -28
  71. package/lib/util/validateConfig.js +21 -0
  72. package/lib/util/withAlphaVariable.js +23 -23
  73. package/package.json +33 -27
  74. package/peers/index.js +7702 -5822
  75. package/plugin.d.ts +11 -0
  76. package/scripts/generate-types.js +52 -0
  77. package/src/cli-peer-dependencies.js +7 -1
  78. package/src/cli.js +118 -24
  79. package/src/corePluginList.js +1 -1
  80. package/src/corePlugins.js +109 -30
  81. package/src/css/preflight.css +1 -8
  82. package/src/featureFlags.js +4 -4
  83. package/src/index.js +15 -1
  84. package/src/lib/cacheInvalidation.js +52 -0
  85. package/src/lib/collapseAdjacentRules.js +21 -2
  86. package/src/lib/defaultExtractor.js +177 -35
  87. package/src/lib/evaluateTailwindFunctions.js +20 -4
  88. package/src/lib/expandApplyAtRules.js +418 -186
  89. package/src/lib/expandTailwindAtRules.js +29 -9
  90. package/src/lib/generateRules.js +137 -51
  91. package/src/lib/regex.js +74 -0
  92. package/src/lib/resolveDefaultsAtRules.js +53 -32
  93. package/src/lib/setupContextUtils.js +128 -65
  94. package/src/lib/setupTrackingContext.js +7 -3
  95. package/src/lib/sharedState.js +1 -0
  96. package/src/postcss-plugins/nesting/README.md +2 -2
  97. package/src/postcss-plugins/nesting/plugin.js +36 -0
  98. package/src/util/cloneNodes.js +14 -1
  99. package/src/util/color.js +25 -21
  100. package/src/util/dataTypes.js +14 -6
  101. package/src/util/formatVariantSelector.js +79 -62
  102. package/src/util/getAllConfigs.js +7 -0
  103. package/src/util/log.js +8 -8
  104. package/src/util/normalizeConfig.js +0 -8
  105. package/src/util/parseBoxShadowValue.js +3 -2
  106. package/src/util/pluginUtils.js +13 -1
  107. package/src/util/resolveConfig.js +66 -22
  108. package/src/util/splitAtTopLevelOnly.js +71 -0
  109. package/src/util/toPath.js +1 -1
  110. package/src/util/transformThemeValue.js +4 -2
  111. package/src/util/validateConfig.js +13 -0
  112. package/src/util/withAlphaVariable.js +1 -1
  113. package/stubs/defaultConfig.stub.js +5 -1
  114. package/stubs/simpleConfig.stub.js +1 -0
  115. package/types/config.d.ts +325 -0
  116. package/types/generated/.gitkeep +0 -0
  117. package/types/generated/colors.d.ts +276 -0
  118. package/types/generated/corePluginList.d.ts +1 -0
  119. package/types/index.d.ts +7 -0
package/lib/util/color.js CHANGED
@@ -12,88 +12,79 @@ function _interopRequireDefault(obj) {
12
12
  }
13
13
  let HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
14
14
  let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
15
- let VALUE = `(?:\\d+|\\d*\\.\\d+)%?`;
16
- let SEP = `(?:\\s*,\\s*|\\s+)`;
17
- let ALPHA_SEP = `\\s*[,/]\\s*`;
18
- let RGB = new RegExp(`^rgba?\\(\\s*(${VALUE})${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
19
- let HSL = new RegExp(`^hsla?\\(\\s*((?:${VALUE})(?:deg|rad|grad|turn)?)${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
20
- function parseColor(value) {
21
- if (typeof value !== 'string') {
15
+ let VALUE = /(?:\d+|\d*\.\d+)%?/;
16
+ let SEP = /(?:\s*,\s*|\s+)/;
17
+ let ALPHA_SEP = /\s*[,/]\s*/;
18
+ let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/;
19
+ let RGB = new RegExp(`^(rgb)a?\\(\\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*\\)$`);
20
+ let HSL = new RegExp(`^(hsl)a?\\(\\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*\\)$`);
21
+ function parseColor(value, { loose =false } = {}) {
22
+ var ref, ref1;
23
+ if (typeof value !== "string") {
22
24
  return null;
23
25
  }
24
26
  value = value.trim();
25
- if (value === 'transparent') {
27
+ if (value === "transparent") {
26
28
  return {
27
- mode: 'rgb',
29
+ mode: "rgb",
28
30
  color: [
29
- '0',
30
- '0',
31
- '0'
31
+ "0",
32
+ "0",
33
+ "0"
32
34
  ],
33
- alpha: '0'
35
+ alpha: "0"
34
36
  };
35
37
  }
36
38
  if (value in _colorName.default) {
37
39
  return {
38
- mode: 'rgb',
39
- color: _colorName.default[value].map((v)=>v.toString()
40
- )
40
+ mode: "rgb",
41
+ color: _colorName.default[value].map((v)=>v.toString())
41
42
  };
42
43
  }
43
44
  let hex = value.replace(SHORT_HEX, (_, r, g, b, a)=>[
44
- '#',
45
+ "#",
45
46
  r,
46
47
  r,
47
48
  g,
48
49
  g,
49
50
  b,
50
51
  b,
51
- a ? a + a : ''
52
- ].join('')
53
- ).match(HEX);
52
+ a ? a + a : ""
53
+ ].join("")).match(HEX);
54
54
  if (hex !== null) {
55
55
  return {
56
- mode: 'rgb',
56
+ mode: "rgb",
57
57
  color: [
58
58
  parseInt(hex[1], 16),
59
59
  parseInt(hex[2], 16),
60
60
  parseInt(hex[3], 16)
61
- ].map((v)=>v.toString()
62
- ),
61
+ ].map((v)=>v.toString()),
63
62
  alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined
64
63
  };
65
64
  }
66
- let rgbMatch = value.match(RGB);
67
- if (rgbMatch !== null) {
68
- var ref, ref1;
69
- return {
70
- mode: 'rgb',
71
- color: [
72
- rgbMatch[1],
73
- rgbMatch[2],
74
- rgbMatch[3]
75
- ].map((v)=>v.toString()
76
- ),
77
- alpha: (ref = rgbMatch[4]) === null || ref === void 0 ? void 0 : (ref1 = ref.toString) === null || ref1 === void 0 ? void 0 : ref1.call(ref)
78
- };
65
+ var ref2;
66
+ let match = (ref2 = value.match(RGB)) !== null && ref2 !== void 0 ? ref2 : value.match(HSL);
67
+ if (match === null) {
68
+ return null;
79
69
  }
80
- let hslMatch = value.match(HSL);
81
- if (hslMatch !== null) {
82
- var ref2, ref3;
83
- return {
84
- mode: 'hsl',
85
- color: [
86
- hslMatch[1],
87
- hslMatch[2],
88
- hslMatch[3]
89
- ].map((v)=>v.toString()
90
- ),
91
- alpha: (ref2 = hslMatch[4]) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.toString) === null || ref3 === void 0 ? void 0 : ref3.call(ref2)
92
- };
70
+ let color = [
71
+ match[2],
72
+ match[3],
73
+ match[4]
74
+ ].filter(Boolean).map((v)=>v.toString());
75
+ if (!loose && color.length !== 3) {
76
+ return null;
93
77
  }
94
- return null;
78
+ if (color.length < 3 && !color.some((part)=>/^var\(.*?\)$/.test(part))) {
79
+ return null;
80
+ }
81
+ return {
82
+ mode: match[1],
83
+ color,
84
+ alpha: (ref = match[5]) === null || ref === void 0 ? void 0 : (ref1 = ref.toString) === null || ref1 === void 0 ? void 0 : ref1.call(ref)
85
+ };
95
86
  }
96
87
  function formatColor({ mode , color , alpha }) {
97
88
  let hasAlpha = alpha !== undefined;
98
- return `${mode}(${color.join(' ')}${hasAlpha ? ` / ${alpha}` : ''})`;
89
+ return `${mode}(${color.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`;
99
90
  }
@@ -9,8 +9,7 @@ function createPlugin(plugin, config) {
9
9
  config
10
10
  };
11
11
  }
12
- createPlugin.withOptions = function(pluginFunction, configFunction = ()=>({})
13
- ) {
12
+ createPlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {
14
13
  const optionsFunction = function(options) {
15
14
  return {
16
15
  __options: options,
@@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  exports.default = createUtilityPlugin;
6
6
  var _transformThemeValue = _interopRequireDefault(require("./transformThemeValue"));
7
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
7
  function createUtilityPlugin(themeKey, utilityVariations = [
13
8
  [
14
9
  themeKey,
@@ -41,9 +36,13 @@ function createUtilityPlugin(themeKey, utilityVariations = [
41
36
  });
42
37
  }, {}), {
43
38
  ...options,
44
- values: filterDefault ? Object.fromEntries(Object.entries((ref = theme(themeKey)) !== null && ref !== void 0 ? ref : {}).filter(([modifier])=>modifier !== 'DEFAULT'
45
- )) : theme(themeKey)
39
+ values: filterDefault ? Object.fromEntries(Object.entries((ref = theme(themeKey)) !== null && ref !== void 0 ? ref : {}).filter(([modifier])=>modifier !== "DEFAULT")) : theme(themeKey)
46
40
  });
47
41
  }
48
42
  };
49
43
  }
44
+ function _interopRequireDefault(obj) {
45
+ return obj && obj.__esModule ? obj : {
46
+ default: obj
47
+ };
48
+ }
@@ -20,10 +20,10 @@ exports.relativeSize = relativeSize;
20
20
  var _color = require("./color");
21
21
  var _parseBoxShadowValue = require("./parseBoxShadowValue");
22
22
  let cssFunctions = [
23
- 'min',
24
- 'max',
25
- 'clamp',
26
- 'calc'
23
+ "min",
24
+ "max",
25
+ "clamp",
26
+ "calc"
27
27
  ];
28
28
  // Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
29
29
  let COMMA = /,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
@@ -32,65 +32,68 @@ let UNDERSCORE = /_(?![^(]*\))/g // Underscore separator that is not located bet
32
32
  ;
33
33
  function normalize(value, isRoot = true) {
34
34
  // Keep raw strings if it starts with `url(`
35
- if (value.includes('url(')) {
35
+ if (value.includes("url(")) {
36
36
  return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
37
37
  if (/^url\(.*?\)$/.test(part)) {
38
38
  return part;
39
39
  }
40
40
  return normalize(part, false);
41
- }).join('');
41
+ }).join("");
42
42
  }
43
43
  // Convert `_` to ` `, except for escaped underscores `\_`
44
- value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + ' '.repeat(fullMatch.length - 1)
45
- ).replace(/^_/g, ' ').replace(/\\_/g, '_');
44
+ value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_");
46
45
  // Remove leftover whitespace
47
46
  if (isRoot) {
48
47
  value = value.trim();
49
48
  }
50
49
  // Add spaces around operators inside calc() that do not follow an operator
51
50
  // or '('.
52
- return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, '$1 $2 ');
51
+ value = value.replace(/calc\(.+\)/g, (match)=>{
52
+ return match.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
53
+ });
54
+ // Add spaces around some operators not inside calc() that do not follow an operator
55
+ // or '('.
56
+ return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([\/])/g, "$1 $2 ");
53
57
  }
54
58
  function url(value) {
55
- return value.startsWith('url(');
59
+ return value.startsWith("url(");
56
60
  }
57
61
  function number(value) {
58
- return !isNaN(Number(value)) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?`).test(value)
59
- );
62
+ return !isNaN(Number(value)) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?`).test(value));
60
63
  }
61
64
  function percentage(value) {
62
- return /%$/g.test(value) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?%`).test(value)
63
- );
65
+ return value.split(UNDERSCORE).every((part)=>{
66
+ return /%$/g.test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?%`).test(part));
67
+ });
64
68
  }
65
69
  let lengthUnits = [
66
- 'cm',
67
- 'mm',
68
- 'Q',
69
- 'in',
70
- 'pc',
71
- 'pt',
72
- 'px',
73
- 'em',
74
- 'ex',
75
- 'ch',
76
- 'rem',
77
- 'lh',
78
- 'vw',
79
- 'vh',
80
- 'vmin',
81
- 'vmax',
70
+ "cm",
71
+ "mm",
72
+ "Q",
73
+ "in",
74
+ "pc",
75
+ "pt",
76
+ "px",
77
+ "em",
78
+ "ex",
79
+ "ch",
80
+ "rem",
81
+ "lh",
82
+ "vw",
83
+ "vh",
84
+ "vmin",
85
+ "vmax",
82
86
  ];
83
- let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`;
87
+ let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`;
84
88
  function length(value) {
85
89
  return value.split(UNDERSCORE).every((part)=>{
86
- return part === '0' || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part)
87
- );
90
+ return part === "0" || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part));
88
91
  });
89
92
  }
90
93
  let lineWidths = new Set([
91
- 'thin',
92
- 'medium',
93
- 'thick'
94
+ "thin",
95
+ "medium",
96
+ "thick"
94
97
  ]);
95
98
  function lineWidth(value) {
96
99
  return lineWidths.has(value);
@@ -108,8 +111,10 @@ function color(value) {
108
111
  let colors = 0;
109
112
  let result = value.split(UNDERSCORE).every((part)=>{
110
113
  part = normalize(part);
111
- if (part.startsWith('var(')) return true;
112
- if ((0, _color).parseColor(part) !== null) return colors++, true;
114
+ if (part.startsWith("var(")) return true;
115
+ if ((0, _color).parseColor(part, {
116
+ loose: true
117
+ }) !== null) return colors++, true;
113
118
  return false;
114
119
  });
115
120
  if (!result) return false;
@@ -119,14 +124,13 @@ function image(value) {
119
124
  let images = 0;
120
125
  let result = value.split(COMMA).every((part)=>{
121
126
  part = normalize(part);
122
- if (part.startsWith('var(')) return true;
127
+ if (part.startsWith("var(")) return true;
123
128
  if (url(part) || gradient(part) || [
124
- 'element(',
125
- 'image(',
126
- 'cross-fade(',
127
- 'image-set('
128
- ].some((fn)=>part.startsWith(fn)
129
- )) {
129
+ "element(",
130
+ "image(",
131
+ "cross-fade(",
132
+ "image-set("
133
+ ].some((fn)=>part.startsWith(fn))) {
130
134
  images++;
131
135
  return true;
132
136
  }
@@ -136,11 +140,11 @@ function image(value) {
136
140
  return images > 0;
137
141
  }
138
142
  let gradientTypes = new Set([
139
- 'linear-gradient',
140
- 'radial-gradient',
141
- 'repeating-linear-gradient',
142
- 'repeating-radial-gradient',
143
- 'conic-gradient',
143
+ "linear-gradient",
144
+ "radial-gradient",
145
+ "repeating-linear-gradient",
146
+ "repeating-radial-gradient",
147
+ "conic-gradient",
144
148
  ]);
145
149
  function gradient(value) {
146
150
  value = normalize(value);
@@ -152,17 +156,17 @@ function gradient(value) {
152
156
  return false;
153
157
  }
154
158
  let validPositions = new Set([
155
- 'center',
156
- 'top',
157
- 'right',
158
- 'bottom',
159
- 'left'
159
+ "center",
160
+ "top",
161
+ "right",
162
+ "bottom",
163
+ "left"
160
164
  ]);
161
165
  function position(value) {
162
166
  let positions = 0;
163
167
  let result = value.split(UNDERSCORE).every((part)=>{
164
168
  part = normalize(part);
165
- if (part.startsWith('var(')) return true;
169
+ if (part.startsWith("var(")) return true;
166
170
  if (validPositions.has(part) || length(part) || percentage(part)) {
167
171
  positions++;
168
172
  return true;
@@ -176,9 +180,9 @@ function familyName(value) {
176
180
  let fonts = 0;
177
181
  let result = value.split(COMMA).every((part)=>{
178
182
  part = normalize(part);
179
- if (part.startsWith('var(')) return true;
183
+ if (part.startsWith("var(")) return true;
180
184
  // If it contains spaces, then it should be quoted
181
- if (part.includes(' ')) {
185
+ if (part.includes(" ")) {
182
186
  if (!/(['"])([^"']+)\1/g.test(part)) {
183
187
  return false;
184
188
  }
@@ -194,39 +198,39 @@ function familyName(value) {
194
198
  return fonts > 0;
195
199
  }
196
200
  let genericNames = new Set([
197
- 'serif',
198
- 'sans-serif',
199
- 'monospace',
200
- 'cursive',
201
- 'fantasy',
202
- 'system-ui',
203
- 'ui-serif',
204
- 'ui-sans-serif',
205
- 'ui-monospace',
206
- 'ui-rounded',
207
- 'math',
208
- 'emoji',
209
- 'fangsong',
201
+ "serif",
202
+ "sans-serif",
203
+ "monospace",
204
+ "cursive",
205
+ "fantasy",
206
+ "system-ui",
207
+ "ui-serif",
208
+ "ui-sans-serif",
209
+ "ui-monospace",
210
+ "ui-rounded",
211
+ "math",
212
+ "emoji",
213
+ "fangsong",
210
214
  ]);
211
215
  function genericName(value) {
212
216
  return genericNames.has(value);
213
217
  }
214
218
  let absoluteSizes = new Set([
215
- 'xx-small',
216
- 'x-small',
217
- 'small',
218
- 'medium',
219
- 'large',
220
- 'x-large',
221
- 'x-large',
222
- 'xxx-large',
219
+ "xx-small",
220
+ "x-small",
221
+ "small",
222
+ "medium",
223
+ "large",
224
+ "x-large",
225
+ "x-large",
226
+ "xxx-large",
223
227
  ]);
224
228
  function absoluteSize(value) {
225
229
  return absoluteSizes.has(value);
226
230
  }
227
231
  let relativeSizes = new Set([
228
- 'larger',
229
- 'smaller'
232
+ "larger",
233
+ "smaller"
230
234
  ]);
231
235
  function relativeSize(value) {
232
236
  return relativeSizes.has(value);
@@ -5,11 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  exports.default = escapeClassName;
6
6
  var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
7
7
  var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
11
- };
12
- }
13
8
  function escapeClassName(className) {
14
9
  var ref;
15
10
  let node = _postcssSelectorParser.default.className();
@@ -17,3 +12,8 @@ function escapeClassName(className) {
17
12
  var ref1;
18
13
  return (0, _escapeCommas).default((ref1 = node === null || node === void 0 ? void 0 : (ref = node.raws) === null || ref === void 0 ? void 0 : ref.value) !== null && ref1 !== void 0 ? ref1 : node.value);
19
14
  }
15
+ function _interopRequireDefault(obj) {
16
+ return obj && obj.__esModule ? obj : {
17
+ default: obj
18
+ };
19
+ }
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  exports.default = escapeCommas;
6
6
  function escapeCommas(className) {
7
- return className.replace(/\\,/g, '\\2c ');
7
+ return className.replace(/\\,/g, "\\2c ");
8
8
  }
@@ -3,15 +3,12 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.default = void 0;
6
- 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])=>({
7
- [color + (number === 'DEFAULT' ? '' : `-${number}`)]: hex
8
- })
9
- ) : [
6
+ 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])=>({
7
+ [color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
8
+ })) : [
10
9
  {
11
10
  [`${color}`]: values
12
11
  }
13
- ]
14
- ))
15
- ;
12
+ ]));
16
13
  var _default = flattenColorPalette;
17
14
  exports.default = _default;