tailwindcss 0.0.0-insiders.eebf529 → 0.0.0-insiders.ef2ebb2

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 (227) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +15 -7
  3. package/colors.d.ts +3 -0
  4. package/defaultConfig.d.ts +3 -0
  5. package/defaultTheme.d.ts +4 -0
  6. package/index.css +5 -0
  7. package/lib/cli/build/index.js +57 -0
  8. package/lib/cli/build/plugin.js +433 -0
  9. package/lib/cli/build/utils.js +88 -0
  10. package/lib/cli/build/watching.js +182 -0
  11. package/lib/cli/help/index.js +73 -0
  12. package/lib/cli/index.js +231 -0
  13. package/lib/cli/init/index.js +63 -0
  14. package/lib/cli.js +1 -704
  15. package/lib/corePluginList.js +13 -3
  16. package/lib/corePlugins.js +2399 -1867
  17. package/lib/css/preflight.css +17 -9
  18. package/lib/featureFlags.js +50 -26
  19. package/lib/index.js +1 -31
  20. package/lib/lib/cacheInvalidation.js +92 -0
  21. package/lib/lib/collapseAdjacentRules.js +30 -10
  22. package/lib/lib/collapseDuplicateDeclarations.js +60 -4
  23. package/lib/lib/content.js +207 -0
  24. package/lib/lib/defaultExtractor.js +243 -0
  25. package/lib/lib/detectNesting.js +21 -10
  26. package/lib/lib/evaluateTailwindFunctions.js +117 -50
  27. package/lib/lib/expandApplyAtRules.js +467 -161
  28. package/lib/lib/expandTailwindAtRules.js +200 -133
  29. package/lib/lib/findAtConfigPath.js +46 -0
  30. package/lib/lib/generateRules.js +550 -200
  31. package/lib/lib/getModuleDependencies.js +88 -37
  32. package/lib/lib/handleImportAtRules.js +50 -0
  33. package/lib/lib/load-config.js +42 -0
  34. package/lib/lib/normalizeTailwindDirectives.js +36 -38
  35. package/lib/lib/offsets.js +306 -0
  36. package/lib/lib/partitionApplyAtRules.js +58 -0
  37. package/lib/lib/regex.js +74 -0
  38. package/lib/lib/remap-bitfield.js +89 -0
  39. package/lib/lib/resolveDefaultsAtRules.js +98 -58
  40. package/lib/lib/setupContextUtils.js +767 -325
  41. package/lib/lib/setupTrackingContext.js +71 -75
  42. package/lib/lib/sharedState.js +70 -10
  43. package/lib/lib/substituteScreenAtRules.js +14 -10
  44. package/lib/plugin.js +166 -0
  45. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  46. package/lib/postcss-plugins/nesting/index.js +21 -0
  47. package/lib/postcss-plugins/nesting/plugin.js +89 -0
  48. package/lib/processTailwindFeatures.js +39 -26
  49. package/lib/public/colors.js +272 -246
  50. package/lib/public/create-plugin.js +9 -5
  51. package/lib/public/default-config.js +10 -6
  52. package/lib/public/default-theme.js +10 -6
  53. package/lib/public/load-config.js +12 -0
  54. package/lib/public/resolve-config.js +11 -6
  55. package/lib/util/applyImportantSelector.js +36 -0
  56. package/lib/util/bigSign.js +6 -1
  57. package/lib/util/buildMediaQuery.js +13 -6
  58. package/lib/util/cloneDeep.js +9 -6
  59. package/lib/util/cloneNodes.js +23 -3
  60. package/lib/util/color.js +70 -38
  61. package/lib/util/colorNames.js +752 -0
  62. package/lib/util/configurePlugins.js +7 -2
  63. package/lib/util/createPlugin.js +8 -6
  64. package/lib/util/createUtilityPlugin.js +16 -16
  65. package/lib/util/dataTypes.js +182 -111
  66. package/lib/util/defaults.js +14 -3
  67. package/lib/util/escapeClassName.js +13 -8
  68. package/lib/util/escapeCommas.js +7 -2
  69. package/lib/util/flattenColorPalette.js +11 -12
  70. package/lib/util/formatVariantSelector.js +228 -151
  71. package/lib/util/getAllConfigs.js +33 -12
  72. package/lib/util/hashConfig.js +9 -4
  73. package/lib/util/isKeyframeRule.js +7 -2
  74. package/lib/util/isPlainObject.js +7 -2
  75. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
  76. package/lib/util/log.js +44 -13
  77. package/lib/util/nameClass.js +27 -10
  78. package/lib/util/negateValue.js +25 -8
  79. package/lib/util/normalizeConfig.js +167 -67
  80. package/lib/util/normalizeScreens.js +128 -11
  81. package/lib/util/parseAnimationValue.js +44 -40
  82. package/lib/util/parseBoxShadowValue.js +34 -23
  83. package/lib/util/parseDependency.js +39 -55
  84. package/lib/util/parseGlob.js +36 -0
  85. package/lib/util/parseObjectStyles.js +15 -10
  86. package/lib/util/pluginUtils.js +157 -69
  87. package/lib/util/prefixSelector.js +30 -12
  88. package/lib/util/pseudoElements.js +209 -0
  89. package/lib/util/removeAlphaVariables.js +31 -0
  90. package/lib/util/resolveConfig.js +101 -79
  91. package/lib/util/resolveConfigPath.js +30 -12
  92. package/lib/util/responsive.js +11 -6
  93. package/lib/util/splitAtTopLevelOnly.js +51 -0
  94. package/lib/util/tap.js +6 -1
  95. package/lib/util/toColorValue.js +7 -3
  96. package/lib/util/toPath.js +26 -3
  97. package/lib/util/transformThemeValue.js +40 -30
  98. package/lib/util/validateConfig.js +48 -0
  99. package/lib/util/validateFormalSyntax.js +26 -0
  100. package/lib/util/withAlphaVariable.js +27 -15
  101. package/lib/value-parser/LICENSE +22 -0
  102. package/lib/value-parser/README.md +3 -0
  103. package/lib/value-parser/index.d.js +2 -0
  104. package/lib/value-parser/index.js +22 -0
  105. package/lib/value-parser/parse.js +259 -0
  106. package/lib/value-parser/stringify.js +38 -0
  107. package/lib/value-parser/unit.js +86 -0
  108. package/lib/value-parser/walk.js +16 -0
  109. package/loadConfig.d.ts +4 -0
  110. package/loadConfig.js +2 -0
  111. package/nesting/index.js +2 -12
  112. package/package.json +63 -62
  113. package/plugin.d.ts +11 -0
  114. package/resolveConfig.d.ts +12 -0
  115. package/scripts/generate-types.js +105 -0
  116. package/scripts/release-channel.js +18 -0
  117. package/scripts/release-notes.js +21 -0
  118. package/scripts/type-utils.js +27 -0
  119. package/src/cli/build/index.js +53 -0
  120. package/src/cli/build/plugin.js +476 -0
  121. package/src/cli/build/utils.js +76 -0
  122. package/src/cli/build/watching.js +229 -0
  123. package/src/cli/help/index.js +70 -0
  124. package/src/cli/index.js +217 -0
  125. package/src/cli/init/index.js +79 -0
  126. package/src/cli.js +1 -766
  127. package/src/corePluginList.js +1 -1
  128. package/src/corePlugins.js +800 -296
  129. package/src/css/preflight.css +17 -9
  130. package/src/featureFlags.js +20 -6
  131. package/src/index.js +1 -34
  132. package/src/lib/cacheInvalidation.js +52 -0
  133. package/src/lib/collapseAdjacentRules.js +21 -2
  134. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  135. package/src/lib/content.js +240 -0
  136. package/src/lib/defaultExtractor.js +217 -0
  137. package/src/lib/detectNesting.js +9 -1
  138. package/src/lib/evaluateTailwindFunctions.js +83 -9
  139. package/src/lib/expandApplyAtRules.js +515 -153
  140. package/src/lib/expandTailwindAtRules.js +147 -86
  141. package/src/lib/findAtConfigPath.js +48 -0
  142. package/src/lib/generateRules.js +541 -147
  143. package/src/lib/getModuleDependencies.js +70 -30
  144. package/src/lib/handleImportAtRules.js +34 -0
  145. package/src/lib/load-config.ts +31 -0
  146. package/src/lib/normalizeTailwindDirectives.js +5 -26
  147. package/src/lib/offsets.js +373 -0
  148. package/src/lib/partitionApplyAtRules.js +52 -0
  149. package/src/lib/regex.js +74 -0
  150. package/src/lib/remap-bitfield.js +82 -0
  151. package/src/lib/resolveDefaultsAtRules.js +59 -17
  152. package/src/lib/setupContextUtils.js +693 -176
  153. package/src/lib/setupTrackingContext.js +52 -65
  154. package/src/lib/sharedState.js +54 -7
  155. package/src/plugin.js +141 -0
  156. package/src/postcss-plugins/nesting/README.md +42 -0
  157. package/src/postcss-plugins/nesting/index.js +13 -0
  158. package/src/postcss-plugins/nesting/plugin.js +80 -0
  159. package/src/processTailwindFeatures.js +12 -2
  160. package/src/public/colors.js +22 -0
  161. package/src/public/default-config.js +1 -1
  162. package/src/public/default-theme.js +2 -2
  163. package/src/public/load-config.js +2 -0
  164. package/src/util/applyImportantSelector.js +27 -0
  165. package/src/util/buildMediaQuery.js +5 -3
  166. package/src/util/cloneNodes.js +19 -2
  167. package/src/util/color.js +44 -12
  168. package/src/util/colorNames.js +150 -0
  169. package/src/util/dataTypes.js +67 -23
  170. package/src/util/defaults.js +6 -0
  171. package/src/util/formatVariantSelector.js +264 -144
  172. package/src/util/getAllConfigs.js +21 -2
  173. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  174. package/src/util/log.js +35 -7
  175. package/src/util/nameClass.js +4 -0
  176. package/src/util/negateValue.js +11 -3
  177. package/src/util/normalizeConfig.js +86 -7
  178. package/src/util/normalizeScreens.js +99 -4
  179. package/src/util/parseBoxShadowValue.js +4 -3
  180. package/src/util/parseDependency.js +37 -42
  181. package/src/util/parseGlob.js +24 -0
  182. package/src/util/pluginUtils.js +118 -23
  183. package/src/util/prefixSelector.js +30 -10
  184. package/src/util/pseudoElements.js +167 -0
  185. package/src/util/removeAlphaVariables.js +24 -0
  186. package/src/util/resolveConfig.js +74 -26
  187. package/src/util/resolveConfigPath.js +12 -1
  188. package/src/util/splitAtTopLevelOnly.js +52 -0
  189. package/src/util/toPath.js +23 -1
  190. package/src/util/transformThemeValue.js +13 -3
  191. package/src/util/validateConfig.js +36 -0
  192. package/src/util/validateFormalSyntax.js +34 -0
  193. package/src/util/withAlphaVariable.js +1 -1
  194. package/src/value-parser/LICENSE +22 -0
  195. package/src/value-parser/README.md +3 -0
  196. package/src/value-parser/index.d.ts +177 -0
  197. package/src/value-parser/index.js +28 -0
  198. package/src/value-parser/parse.js +303 -0
  199. package/src/value-parser/stringify.js +41 -0
  200. package/src/value-parser/unit.js +118 -0
  201. package/src/value-parser/walk.js +18 -0
  202. package/stubs/.gitignore +1 -0
  203. package/stubs/.prettierrc.json +6 -0
  204. package/stubs/{defaultConfig.stub.js → config.full.js} +220 -167
  205. package/stubs/{simpleConfig.stub.js → config.simple.js} +1 -1
  206. package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -1
  207. package/stubs/postcss.config.js +5 -0
  208. package/stubs/tailwind.config.cjs +2 -0
  209. package/stubs/tailwind.config.js +2 -0
  210. package/stubs/tailwind.config.ts +3 -0
  211. package/types/config.d.ts +369 -0
  212. package/types/generated/.gitkeep +0 -0
  213. package/types/generated/colors.d.ts +298 -0
  214. package/types/generated/corePluginList.d.ts +1 -0
  215. package/types/generated/default-theme.d.ts +372 -0
  216. package/types/index.d.ts +7 -0
  217. package/CHANGELOG.md +0 -1853
  218. package/lib/cli-peer-dependencies.js +0 -15
  219. package/lib/constants.js +0 -37
  220. package/lib/lib/setupWatchingContext.js +0 -288
  221. package/nesting/plugin.js +0 -41
  222. package/peers/index.js +0 -76107
  223. package/scripts/install-integrations.js +0 -27
  224. package/scripts/rebuildFixtures.js +0 -68
  225. package/src/cli-peer-dependencies.js +0 -9
  226. package/src/constants.js +0 -17
  227. package/src/lib/setupWatchingContext.js +0 -311
@@ -2,59 +2,65 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.default = _default;
6
- var _dlv = _interopRequireDefault(require("dlv"));
7
- var _didyoumean = _interopRequireDefault(require("didyoumean"));
8
- var _transformThemeValue = _interopRequireDefault(require("../util/transformThemeValue"));
9
- var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
10
- var _normalizeScreens = require("../util/normalizeScreens");
11
- var _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery"));
12
- var _toPath = require("../util/toPath");
13
- function _interopRequireDefault(obj) {
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv"));
12
+ const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean"));
13
+ const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue"));
14
+ const _index = /*#__PURE__*/ _interop_require_default(require("../value-parser/index"));
15
+ const _normalizeScreens = require("../util/normalizeScreens");
16
+ const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
17
+ const _toPath = require("../util/toPath");
18
+ const _withAlphaVariable = require("../util/withAlphaVariable");
19
+ const _pluginUtils = require("../util/pluginUtils");
20
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
21
+ function _interop_require_default(obj) {
14
22
  return obj && obj.__esModule ? obj : {
15
23
  default: obj
16
24
  };
17
25
  }
18
26
  function isObject(input) {
19
- return typeof input === 'object' && input !== null;
27
+ return typeof input === "object" && input !== null;
20
28
  }
21
29
  function findClosestExistingPath(theme, path) {
22
- let parts = (0, _toPath).toPath(path);
30
+ let parts = (0, _toPath.toPath)(path);
23
31
  do {
24
32
  parts.pop();
25
- if ((0, _dlv).default(theme, parts) !== undefined) break;
26
- }while (parts.length)
33
+ if ((0, _dlv.default)(theme, parts) !== undefined) break;
34
+ }while (parts.length);
27
35
  return parts.length ? parts : undefined;
28
36
  }
29
37
  function pathToString(path) {
30
- if (typeof path === 'string') return path;
38
+ if (typeof path === "string") return path;
31
39
  return path.reduce((acc, cur, i)=>{
32
- if (cur.includes('.')) return `${acc}[${cur}]`;
40
+ if (cur.includes(".")) return `${acc}[${cur}]`;
33
41
  return i === 0 ? cur : `${acc}.${cur}`;
34
- }, '');
42
+ }, "");
35
43
  }
36
44
  function list(items) {
37
- return items.map((key)=>`'${key}'`
38
- ).join(', ');
45
+ return items.map((key)=>`'${key}'`).join(", ");
39
46
  }
40
47
  function listKeys(obj) {
41
48
  return list(Object.keys(obj));
42
49
  }
43
- function validatePath(config, path, defaultValue) {
44
- const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+/g, '').replace(/['"]+$/g, '');
45
- const pathSegments = Array.isArray(path) ? path : (0, _toPath).toPath(pathString);
46
- const value = (0, _dlv).default(config.theme, pathString, defaultValue);
50
+ function validatePath(config, path, defaultValue, themeOpts = {}) {
51
+ const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, "");
52
+ const pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString);
53
+ const value = (0, _dlv.default)(config.theme, pathSegments, defaultValue);
47
54
  if (value === undefined) {
48
55
  let error = `'${pathString}' does not exist in your theme config.`;
49
56
  const parentSegments = pathSegments.slice(0, -1);
50
- const parentValue = (0, _dlv).default(config.theme, parentSegments);
57
+ const parentValue = (0, _dlv.default)(config.theme, parentSegments);
51
58
  if (isObject(parentValue)) {
52
59
  const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [
53
60
  ...parentSegments,
54
61
  key
55
- ]).isValid
56
- );
57
- const suggestion = (0, _didyoumean).default(pathSegments[pathSegments.length - 1], validKeys);
62
+ ]).isValid);
63
+ const suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys);
58
64
  if (suggestion) {
59
65
  error += ` Did you mean '${pathToString([
60
66
  ...parentSegments,
@@ -66,7 +72,7 @@ function validatePath(config, path, defaultValue) {
66
72
  } else {
67
73
  const closestPath = findClosestExistingPath(config.theme, pathString);
68
74
  if (closestPath) {
69
- const closestValue = (0, _dlv).default(config.theme, closestPath);
75
+ const closestValue = (0, _dlv.default)(config.theme, closestPath);
70
76
  if (isObject(closestValue)) {
71
77
  error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`;
72
78
  } else {
@@ -81,14 +87,13 @@ function validatePath(config, path, defaultValue) {
81
87
  error
82
88
  };
83
89
  }
84
- if (!(typeof value === 'string' || typeof value === 'number' || typeof value === 'function' || value instanceof String || value instanceof Number || Array.isArray(value))) {
90
+ if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) {
85
91
  let error = `'${pathString}' was found but does not resolve to a string.`;
86
92
  if (isObject(value)) {
87
93
  let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
88
94
  ...pathSegments,
89
95
  key
90
- ]).isValid
91
- );
96
+ ]).isValid);
92
97
  if (validKeys.length) {
93
98
  error += ` Did you mean something like '${pathToString([
94
99
  ...pathSegments,
@@ -104,59 +109,121 @@ function validatePath(config, path, defaultValue) {
104
109
  const [themeSection] = pathSegments;
105
110
  return {
106
111
  isValid: true,
107
- value: (0, _transformThemeValue).default(themeSection)(value)
112
+ value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts)
108
113
  };
109
114
  }
110
115
  function extractArgs(node, vNodes, functions) {
111
- vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions)
112
- );
116
+ vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions));
113
117
  let args = [
114
- ''
118
+ ""
115
119
  ];
116
- for (let vNode1 of vNodes){
117
- if (vNode1.type === 'div' && vNode1.value === ',') {
118
- args.push('');
120
+ for (let vNode of vNodes){
121
+ if (vNode.type === "div" && vNode.value === ",") {
122
+ args.push("");
119
123
  } else {
120
- args[args.length - 1] += _postcssValueParser.default.stringify(vNode1);
124
+ args[args.length - 1] += _index.default.stringify(vNode);
121
125
  }
122
126
  }
123
127
  return args;
124
128
  }
125
129
  function resolveVNode(node, vNode, functions) {
126
- if (vNode.type === 'function' && functions[vNode.value] !== undefined) {
130
+ if (vNode.type === "function" && functions[vNode.value] !== undefined) {
127
131
  let args = extractArgs(node, vNode.nodes, functions);
128
- vNode.type = 'word';
132
+ vNode.type = "word";
129
133
  vNode.value = functions[vNode.value](node, ...args);
130
134
  }
131
135
  return vNode;
132
136
  }
133
137
  function resolveFunctions(node, input, functions) {
134
- return (0, _postcssValueParser).default(input).walk((vNode)=>{
138
+ let hasAnyFn = Object.keys(functions).some((fn)=>input.includes(`${fn}(`));
139
+ if (!hasAnyFn) return input;
140
+ return (0, _index.default)(input).walk((vNode)=>{
135
141
  resolveVNode(node, vNode, functions);
136
142
  }).toString();
137
143
  }
138
144
  let nodeTypePropertyMap = {
139
- atrule: 'params',
140
- decl: 'value'
145
+ atrule: "params",
146
+ decl: "value"
141
147
  };
142
- function _default({ tailwindConfig: config }) {
148
+ /**
149
+ * @param {string} path
150
+ * @returns {Iterable<[path: string, alpha: string|undefined]>}
151
+ */ function* toPaths(path) {
152
+ // Strip quotes from beginning and end of string
153
+ // This allows the alpha value to be present inside of quotes
154
+ path = path.replace(/^['"]+|['"]+$/g, "");
155
+ let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/);
156
+ let alpha = undefined;
157
+ yield [
158
+ path,
159
+ undefined
160
+ ];
161
+ if (matches) {
162
+ path = matches[1];
163
+ alpha = matches[2];
164
+ yield [
165
+ path,
166
+ alpha
167
+ ];
168
+ }
169
+ }
170
+ /**
171
+ *
172
+ * @param {any} config
173
+ * @param {string} path
174
+ * @param {any} defaultValue
175
+ */ function resolvePath(config, path, defaultValue) {
176
+ const results = Array.from(toPaths(path)).map(([path, alpha])=>{
177
+ return Object.assign(validatePath(config, path, defaultValue, {
178
+ opacityValue: alpha
179
+ }), {
180
+ resolvedPath: path,
181
+ alpha
182
+ });
183
+ });
184
+ var _results_find;
185
+ return (_results_find = results.find((result)=>result.isValid)) !== null && _results_find !== void 0 ? _results_find : results[0];
186
+ }
187
+ function _default(context) {
188
+ let config = context.tailwindConfig;
143
189
  let functions = {
144
190
  theme: (node, path, ...defaultValue)=>{
145
- const { isValid , value , error } = validatePath(config, path, defaultValue.length ? defaultValue : undefined);
191
+ let { isValid , value , error , alpha } = resolvePath(config, path, defaultValue.length ? defaultValue : undefined);
146
192
  if (!isValid) {
193
+ var _parentNode_raws_tailwind;
194
+ let parentNode = node.parent;
195
+ let candidate = (_parentNode_raws_tailwind = parentNode === null || parentNode === void 0 ? void 0 : parentNode.raws.tailwind) === null || _parentNode_raws_tailwind === void 0 ? void 0 : _parentNode_raws_tailwind.candidate;
196
+ if (parentNode && candidate !== undefined) {
197
+ // Remove this utility from any caches
198
+ context.markInvalidUtilityNode(parentNode);
199
+ // Remove the CSS node from the markup
200
+ parentNode.remove();
201
+ // Show a warning
202
+ _log.default.warn("invalid-theme-key-in-class", [
203
+ `The utility \`${candidate}\` contains an invalid theme value and was not generated.`
204
+ ]);
205
+ return;
206
+ }
147
207
  throw node.error(error);
148
208
  }
209
+ let maybeColor = (0, _pluginUtils.parseColorFormat)(value);
210
+ let isColorFunction = maybeColor !== undefined && typeof maybeColor === "function";
211
+ if (alpha !== undefined || isColorFunction) {
212
+ if (alpha === undefined) {
213
+ alpha = 1.0;
214
+ }
215
+ value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor);
216
+ }
149
217
  return value;
150
218
  },
151
219
  screen: (node, screen)=>{
152
- screen = screen.replace(/^['"]+/g, '').replace(/['"]+$/g, '');
153
- let screens = (0, _normalizeScreens).normalizeScreens(config.theme.screens);
154
- let screenDefinition = screens.find(({ name })=>name === screen
155
- );
220
+ screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, "");
221
+ let screens = (0, _normalizeScreens.normalizeScreens)(config.theme.screens);
222
+ let screenDefinition = screens.find(({ name })=>name === screen);
156
223
  if (!screenDefinition) {
157
224
  throw node.error(`The '${screen}' screen does not exist in your theme.`);
158
225
  }
159
- return (0, _buildMediaQuery).default(screenDefinition);
226
+ return (0, _buildMediaQuery.default)(screenDefinition);
160
227
  }
161
228
  };
162
229
  return (root)=>{