material-theme-builder 2.1.2 → 3.0.0
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.
- package/README.md +22 -4
- package/dist/cli.js +783 -444
- package/dist/index.d.ts +77 -104
- package/dist/index.js +761 -570
- package/dist/react.d.ts +195 -0
- package/dist/react.js +4604 -0
- package/dist/tailwind.css +0 -2
- package/package.json +26 -4
- package/src/tailwind.css +0 -2
package/dist/react.js
ADDED
|
@@ -0,0 +1,4604 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
4
|
+
function r(e) {
|
|
5
|
+
var t, f, n = "";
|
|
6
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
7
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
8
|
+
var o = e.length;
|
|
9
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
10
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
function clsx() {
|
|
14
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
19
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
20
|
+
var cx = clsx;
|
|
21
|
+
var cva = (base, config) => (props) => {
|
|
22
|
+
var _config_compoundVariants;
|
|
23
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
24
|
+
const { variants, defaultVariants } = config;
|
|
25
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
26
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
27
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
28
|
+
if (variantProp === null) return null;
|
|
29
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
30
|
+
return variants[variant][variantKey];
|
|
31
|
+
});
|
|
32
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
33
|
+
let [key, value] = param;
|
|
34
|
+
if (value === void 0) {
|
|
35
|
+
return acc;
|
|
36
|
+
}
|
|
37
|
+
acc[key] = value;
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
41
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
42
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
43
|
+
let [key, value] = param2;
|
|
44
|
+
return Array.isArray(value) ? value.includes({
|
|
45
|
+
...defaultVariants,
|
|
46
|
+
...propsWithoutUndefined
|
|
47
|
+
}[key]) : {
|
|
48
|
+
...defaultVariants,
|
|
49
|
+
...propsWithoutUndefined
|
|
50
|
+
}[key] === value;
|
|
51
|
+
}) ? [
|
|
52
|
+
...acc,
|
|
53
|
+
cvClass,
|
|
54
|
+
cvClassName
|
|
55
|
+
] : acc;
|
|
56
|
+
}, []);
|
|
57
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/components/m3/Fab.tsx
|
|
61
|
+
import "react";
|
|
62
|
+
|
|
63
|
+
// node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
64
|
+
var concatArrays = (array1, array2) => {
|
|
65
|
+
const combinedArray = new Array(array1.length + array2.length);
|
|
66
|
+
for (let i = 0; i < array1.length; i++) {
|
|
67
|
+
combinedArray[i] = array1[i];
|
|
68
|
+
}
|
|
69
|
+
for (let i = 0; i < array2.length; i++) {
|
|
70
|
+
combinedArray[array1.length + i] = array2[i];
|
|
71
|
+
}
|
|
72
|
+
return combinedArray;
|
|
73
|
+
};
|
|
74
|
+
var createClassValidatorObject = (classGroupId, validator) => ({
|
|
75
|
+
classGroupId,
|
|
76
|
+
validator
|
|
77
|
+
});
|
|
78
|
+
var createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
|
|
79
|
+
nextPart,
|
|
80
|
+
validators,
|
|
81
|
+
classGroupId
|
|
82
|
+
});
|
|
83
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
84
|
+
var EMPTY_CONFLICTS = [];
|
|
85
|
+
var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
86
|
+
var createClassGroupUtils = (config) => {
|
|
87
|
+
const classMap = createClassMap(config);
|
|
88
|
+
const {
|
|
89
|
+
conflictingClassGroups,
|
|
90
|
+
conflictingClassGroupModifiers
|
|
91
|
+
} = config;
|
|
92
|
+
const getClassGroupId = (className) => {
|
|
93
|
+
if (className.startsWith("[") && className.endsWith("]")) {
|
|
94
|
+
return getGroupIdForArbitraryProperty(className);
|
|
95
|
+
}
|
|
96
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
97
|
+
const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
|
|
98
|
+
return getGroupRecursive(classParts, startIndex, classMap);
|
|
99
|
+
};
|
|
100
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
101
|
+
if (hasPostfixModifier) {
|
|
102
|
+
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
103
|
+
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
104
|
+
if (modifierConflicts) {
|
|
105
|
+
if (baseConflicts) {
|
|
106
|
+
return concatArrays(baseConflicts, modifierConflicts);
|
|
107
|
+
}
|
|
108
|
+
return modifierConflicts;
|
|
109
|
+
}
|
|
110
|
+
return baseConflicts || EMPTY_CONFLICTS;
|
|
111
|
+
}
|
|
112
|
+
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
getClassGroupId,
|
|
116
|
+
getConflictingClassGroupIds
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
var getGroupRecursive = (classParts, startIndex, classPartObject) => {
|
|
120
|
+
const classPathsLength = classParts.length - startIndex;
|
|
121
|
+
if (classPathsLength === 0) {
|
|
122
|
+
return classPartObject.classGroupId;
|
|
123
|
+
}
|
|
124
|
+
const currentClassPart = classParts[startIndex];
|
|
125
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
126
|
+
if (nextClassPartObject) {
|
|
127
|
+
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
|
|
128
|
+
if (result) return result;
|
|
129
|
+
}
|
|
130
|
+
const validators = classPartObject.validators;
|
|
131
|
+
if (validators === null) {
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
|
|
135
|
+
const validatorsLength = validators.length;
|
|
136
|
+
for (let i = 0; i < validatorsLength; i++) {
|
|
137
|
+
const validatorObj = validators[i];
|
|
138
|
+
if (validatorObj.validator(classRest)) {
|
|
139
|
+
return validatorObj.classGroupId;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return void 0;
|
|
143
|
+
};
|
|
144
|
+
var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
145
|
+
const content = className.slice(1, -1);
|
|
146
|
+
const colonIndex = content.indexOf(":");
|
|
147
|
+
const property = content.slice(0, colonIndex);
|
|
148
|
+
return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
|
|
149
|
+
})();
|
|
150
|
+
var createClassMap = (config) => {
|
|
151
|
+
const {
|
|
152
|
+
theme,
|
|
153
|
+
classGroups
|
|
154
|
+
} = config;
|
|
155
|
+
return processClassGroups(classGroups, theme);
|
|
156
|
+
};
|
|
157
|
+
var processClassGroups = (classGroups, theme) => {
|
|
158
|
+
const classMap = createClassPartObject();
|
|
159
|
+
for (const classGroupId in classGroups) {
|
|
160
|
+
const group = classGroups[classGroupId];
|
|
161
|
+
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
162
|
+
}
|
|
163
|
+
return classMap;
|
|
164
|
+
};
|
|
165
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
166
|
+
const len = classGroup.length;
|
|
167
|
+
for (let i = 0; i < len; i++) {
|
|
168
|
+
const classDefinition = classGroup[i];
|
|
169
|
+
processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
173
|
+
if (typeof classDefinition === "string") {
|
|
174
|
+
processStringDefinition(classDefinition, classPartObject, classGroupId);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (typeof classDefinition === "function") {
|
|
178
|
+
processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
182
|
+
};
|
|
183
|
+
var processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
|
|
184
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
185
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
186
|
+
};
|
|
187
|
+
var processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
188
|
+
if (isThemeGetter(classDefinition)) {
|
|
189
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (classPartObject.validators === null) {
|
|
193
|
+
classPartObject.validators = [];
|
|
194
|
+
}
|
|
195
|
+
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
196
|
+
};
|
|
197
|
+
var processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
198
|
+
const entries = Object.entries(classDefinition);
|
|
199
|
+
const len = entries.length;
|
|
200
|
+
for (let i = 0; i < len; i++) {
|
|
201
|
+
const [key, value] = entries[i];
|
|
202
|
+
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
var getPart = (classPartObject, path) => {
|
|
206
|
+
let current = classPartObject;
|
|
207
|
+
const parts = path.split(CLASS_PART_SEPARATOR);
|
|
208
|
+
const len = parts.length;
|
|
209
|
+
for (let i = 0; i < len; i++) {
|
|
210
|
+
const part = parts[i];
|
|
211
|
+
let next = current.nextPart.get(part);
|
|
212
|
+
if (!next) {
|
|
213
|
+
next = createClassPartObject();
|
|
214
|
+
current.nextPart.set(part, next);
|
|
215
|
+
}
|
|
216
|
+
current = next;
|
|
217
|
+
}
|
|
218
|
+
return current;
|
|
219
|
+
};
|
|
220
|
+
var isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
|
|
221
|
+
var createLruCache = (maxCacheSize) => {
|
|
222
|
+
if (maxCacheSize < 1) {
|
|
223
|
+
return {
|
|
224
|
+
get: () => void 0,
|
|
225
|
+
set: () => {
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
let cacheSize = 0;
|
|
230
|
+
let cache = /* @__PURE__ */ Object.create(null);
|
|
231
|
+
let previousCache = /* @__PURE__ */ Object.create(null);
|
|
232
|
+
const update = (key, value) => {
|
|
233
|
+
cache[key] = value;
|
|
234
|
+
cacheSize++;
|
|
235
|
+
if (cacheSize > maxCacheSize) {
|
|
236
|
+
cacheSize = 0;
|
|
237
|
+
previousCache = cache;
|
|
238
|
+
cache = /* @__PURE__ */ Object.create(null);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
return {
|
|
242
|
+
get(key) {
|
|
243
|
+
let value = cache[key];
|
|
244
|
+
if (value !== void 0) {
|
|
245
|
+
return value;
|
|
246
|
+
}
|
|
247
|
+
if ((value = previousCache[key]) !== void 0) {
|
|
248
|
+
update(key, value);
|
|
249
|
+
return value;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
set(key, value) {
|
|
253
|
+
if (key in cache) {
|
|
254
|
+
cache[key] = value;
|
|
255
|
+
} else {
|
|
256
|
+
update(key, value);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
var IMPORTANT_MODIFIER = "!";
|
|
262
|
+
var MODIFIER_SEPARATOR = ":";
|
|
263
|
+
var EMPTY_MODIFIERS = [];
|
|
264
|
+
var createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
265
|
+
modifiers,
|
|
266
|
+
hasImportantModifier,
|
|
267
|
+
baseClassName,
|
|
268
|
+
maybePostfixModifierPosition,
|
|
269
|
+
isExternal
|
|
270
|
+
});
|
|
271
|
+
var createParseClassName = (config) => {
|
|
272
|
+
const {
|
|
273
|
+
prefix,
|
|
274
|
+
experimentalParseClassName
|
|
275
|
+
} = config;
|
|
276
|
+
let parseClassName = (className) => {
|
|
277
|
+
const modifiers = [];
|
|
278
|
+
let bracketDepth = 0;
|
|
279
|
+
let parenDepth = 0;
|
|
280
|
+
let modifierStart = 0;
|
|
281
|
+
let postfixModifierPosition;
|
|
282
|
+
const len = className.length;
|
|
283
|
+
for (let index = 0; index < len; index++) {
|
|
284
|
+
const currentCharacter = className[index];
|
|
285
|
+
if (bracketDepth === 0 && parenDepth === 0) {
|
|
286
|
+
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
287
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
288
|
+
modifierStart = index + 1;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (currentCharacter === "/") {
|
|
292
|
+
postfixModifierPosition = index;
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (currentCharacter === "[") bracketDepth++;
|
|
297
|
+
else if (currentCharacter === "]") bracketDepth--;
|
|
298
|
+
else if (currentCharacter === "(") parenDepth++;
|
|
299
|
+
else if (currentCharacter === ")") parenDepth--;
|
|
300
|
+
}
|
|
301
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
|
|
302
|
+
let baseClassName = baseClassNameWithImportantModifier;
|
|
303
|
+
let hasImportantModifier = false;
|
|
304
|
+
if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
|
|
305
|
+
baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
|
|
306
|
+
hasImportantModifier = true;
|
|
307
|
+
} else if (
|
|
308
|
+
/**
|
|
309
|
+
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
310
|
+
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
311
|
+
*/
|
|
312
|
+
baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)
|
|
313
|
+
) {
|
|
314
|
+
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
315
|
+
hasImportantModifier = true;
|
|
316
|
+
}
|
|
317
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
318
|
+
return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
|
|
319
|
+
};
|
|
320
|
+
if (prefix) {
|
|
321
|
+
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
322
|
+
const parseClassNameOriginal = parseClassName;
|
|
323
|
+
parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
|
|
324
|
+
}
|
|
325
|
+
if (experimentalParseClassName) {
|
|
326
|
+
const parseClassNameOriginal = parseClassName;
|
|
327
|
+
parseClassName = (className) => experimentalParseClassName({
|
|
328
|
+
className,
|
|
329
|
+
parseClassName: parseClassNameOriginal
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return parseClassName;
|
|
333
|
+
};
|
|
334
|
+
var createSortModifiers = (config) => {
|
|
335
|
+
const modifierWeights = /* @__PURE__ */ new Map();
|
|
336
|
+
config.orderSensitiveModifiers.forEach((mod, index) => {
|
|
337
|
+
modifierWeights.set(mod, 1e6 + index);
|
|
338
|
+
});
|
|
339
|
+
return (modifiers) => {
|
|
340
|
+
const result = [];
|
|
341
|
+
let currentSegment = [];
|
|
342
|
+
for (let i = 0; i < modifiers.length; i++) {
|
|
343
|
+
const modifier = modifiers[i];
|
|
344
|
+
const isArbitrary = modifier[0] === "[";
|
|
345
|
+
const isOrderSensitive = modifierWeights.has(modifier);
|
|
346
|
+
if (isArbitrary || isOrderSensitive) {
|
|
347
|
+
if (currentSegment.length > 0) {
|
|
348
|
+
currentSegment.sort();
|
|
349
|
+
result.push(...currentSegment);
|
|
350
|
+
currentSegment = [];
|
|
351
|
+
}
|
|
352
|
+
result.push(modifier);
|
|
353
|
+
} else {
|
|
354
|
+
currentSegment.push(modifier);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (currentSegment.length > 0) {
|
|
358
|
+
currentSegment.sort();
|
|
359
|
+
result.push(...currentSegment);
|
|
360
|
+
}
|
|
361
|
+
return result;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
var createConfigUtils = (config) => ({
|
|
365
|
+
cache: createLruCache(config.cacheSize),
|
|
366
|
+
parseClassName: createParseClassName(config),
|
|
367
|
+
sortModifiers: createSortModifiers(config),
|
|
368
|
+
...createClassGroupUtils(config)
|
|
369
|
+
});
|
|
370
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
371
|
+
var mergeClassList = (classList, configUtils) => {
|
|
372
|
+
const {
|
|
373
|
+
parseClassName,
|
|
374
|
+
getClassGroupId,
|
|
375
|
+
getConflictingClassGroupIds,
|
|
376
|
+
sortModifiers
|
|
377
|
+
} = configUtils;
|
|
378
|
+
const classGroupsInConflict = [];
|
|
379
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
380
|
+
let result = "";
|
|
381
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
382
|
+
const originalClassName = classNames[index];
|
|
383
|
+
const {
|
|
384
|
+
isExternal,
|
|
385
|
+
modifiers,
|
|
386
|
+
hasImportantModifier,
|
|
387
|
+
baseClassName,
|
|
388
|
+
maybePostfixModifierPosition
|
|
389
|
+
} = parseClassName(originalClassName);
|
|
390
|
+
if (isExternal) {
|
|
391
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
let hasPostfixModifier = !!maybePostfixModifierPosition;
|
|
395
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
396
|
+
if (!classGroupId) {
|
|
397
|
+
if (!hasPostfixModifier) {
|
|
398
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
402
|
+
if (!classGroupId) {
|
|
403
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
hasPostfixModifier = false;
|
|
407
|
+
}
|
|
408
|
+
const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
|
|
409
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
410
|
+
const classId = modifierId + classGroupId;
|
|
411
|
+
if (classGroupsInConflict.indexOf(classId) > -1) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
classGroupsInConflict.push(classId);
|
|
415
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
416
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
417
|
+
const group = conflictGroups[i];
|
|
418
|
+
classGroupsInConflict.push(modifierId + group);
|
|
419
|
+
}
|
|
420
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
421
|
+
}
|
|
422
|
+
return result;
|
|
423
|
+
};
|
|
424
|
+
var twJoin = (...classLists) => {
|
|
425
|
+
let index = 0;
|
|
426
|
+
let argument;
|
|
427
|
+
let resolvedValue;
|
|
428
|
+
let string = "";
|
|
429
|
+
while (index < classLists.length) {
|
|
430
|
+
if (argument = classLists[index++]) {
|
|
431
|
+
if (resolvedValue = toValue(argument)) {
|
|
432
|
+
string && (string += " ");
|
|
433
|
+
string += resolvedValue;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return string;
|
|
438
|
+
};
|
|
439
|
+
var toValue = (mix) => {
|
|
440
|
+
if (typeof mix === "string") {
|
|
441
|
+
return mix;
|
|
442
|
+
}
|
|
443
|
+
let resolvedValue;
|
|
444
|
+
let string = "";
|
|
445
|
+
for (let k = 0; k < mix.length; k++) {
|
|
446
|
+
if (mix[k]) {
|
|
447
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
448
|
+
string && (string += " ");
|
|
449
|
+
string += resolvedValue;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return string;
|
|
454
|
+
};
|
|
455
|
+
var createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
456
|
+
let configUtils;
|
|
457
|
+
let cacheGet;
|
|
458
|
+
let cacheSet;
|
|
459
|
+
let functionToCall;
|
|
460
|
+
const initTailwindMerge = (classList) => {
|
|
461
|
+
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
462
|
+
configUtils = createConfigUtils(config);
|
|
463
|
+
cacheGet = configUtils.cache.get;
|
|
464
|
+
cacheSet = configUtils.cache.set;
|
|
465
|
+
functionToCall = tailwindMerge;
|
|
466
|
+
return tailwindMerge(classList);
|
|
467
|
+
};
|
|
468
|
+
const tailwindMerge = (classList) => {
|
|
469
|
+
const cachedResult = cacheGet(classList);
|
|
470
|
+
if (cachedResult) {
|
|
471
|
+
return cachedResult;
|
|
472
|
+
}
|
|
473
|
+
const result = mergeClassList(classList, configUtils);
|
|
474
|
+
cacheSet(classList, result);
|
|
475
|
+
return result;
|
|
476
|
+
};
|
|
477
|
+
functionToCall = initTailwindMerge;
|
|
478
|
+
return (...args) => functionToCall(twJoin(...args));
|
|
479
|
+
};
|
|
480
|
+
var fallbackThemeArr = [];
|
|
481
|
+
var fromTheme = (key) => {
|
|
482
|
+
const themeGetter = (theme) => theme[key] || fallbackThemeArr;
|
|
483
|
+
themeGetter.isThemeGetter = true;
|
|
484
|
+
return themeGetter;
|
|
485
|
+
};
|
|
486
|
+
var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
487
|
+
var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
488
|
+
var fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
|
|
489
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
490
|
+
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
491
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
492
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
493
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
494
|
+
var isFraction = (value) => fractionRegex.test(value);
|
|
495
|
+
var isNumber = (value) => !!value && !Number.isNaN(Number(value));
|
|
496
|
+
var isInteger = (value) => !!value && Number.isInteger(Number(value));
|
|
497
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
498
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
499
|
+
var isAny = () => true;
|
|
500
|
+
var isLengthOnly = (value) => (
|
|
501
|
+
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
502
|
+
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
503
|
+
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
504
|
+
lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
|
|
505
|
+
);
|
|
506
|
+
var isNever = () => false;
|
|
507
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
508
|
+
var isImage = (value) => imageRegex.test(value);
|
|
509
|
+
var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
|
|
510
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
|
|
511
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
512
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
513
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
514
|
+
var isArbitraryWeight = (value) => getIsArbitraryValue(value, isLabelWeight, isAny);
|
|
515
|
+
var isArbitraryFamilyName = (value) => getIsArbitraryValue(value, isLabelFamilyName, isNever);
|
|
516
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
517
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
518
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
519
|
+
var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
|
|
520
|
+
var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
|
|
521
|
+
var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
|
|
522
|
+
var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
|
|
523
|
+
var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
|
|
524
|
+
var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
|
|
525
|
+
var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
526
|
+
var isArbitraryVariableWeight = (value) => getIsArbitraryVariable(value, isLabelWeight, true);
|
|
527
|
+
var getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
528
|
+
const result = arbitraryValueRegex.exec(value);
|
|
529
|
+
if (result) {
|
|
530
|
+
if (result[1]) {
|
|
531
|
+
return testLabel(result[1]);
|
|
532
|
+
}
|
|
533
|
+
return testValue(result[2]);
|
|
534
|
+
}
|
|
535
|
+
return false;
|
|
536
|
+
};
|
|
537
|
+
var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
|
|
538
|
+
const result = arbitraryVariableRegex.exec(value);
|
|
539
|
+
if (result) {
|
|
540
|
+
if (result[1]) {
|
|
541
|
+
return testLabel(result[1]);
|
|
542
|
+
}
|
|
543
|
+
return shouldMatchNoLabel;
|
|
544
|
+
}
|
|
545
|
+
return false;
|
|
546
|
+
};
|
|
547
|
+
var isLabelPosition = (label) => label === "position" || label === "percentage";
|
|
548
|
+
var isLabelImage = (label) => label === "image" || label === "url";
|
|
549
|
+
var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
|
|
550
|
+
var isLabelLength = (label) => label === "length";
|
|
551
|
+
var isLabelNumber = (label) => label === "number";
|
|
552
|
+
var isLabelFamilyName = (label) => label === "family-name";
|
|
553
|
+
var isLabelWeight = (label) => label === "number" || label === "weight";
|
|
554
|
+
var isLabelShadow = (label) => label === "shadow";
|
|
555
|
+
var getDefaultConfig = () => {
|
|
556
|
+
const themeColor = fromTheme("color");
|
|
557
|
+
const themeFont = fromTheme("font");
|
|
558
|
+
const themeText = fromTheme("text");
|
|
559
|
+
const themeFontWeight = fromTheme("font-weight");
|
|
560
|
+
const themeTracking = fromTheme("tracking");
|
|
561
|
+
const themeLeading = fromTheme("leading");
|
|
562
|
+
const themeBreakpoint = fromTheme("breakpoint");
|
|
563
|
+
const themeContainer = fromTheme("container");
|
|
564
|
+
const themeSpacing = fromTheme("spacing");
|
|
565
|
+
const themeRadius = fromTheme("radius");
|
|
566
|
+
const themeShadow = fromTheme("shadow");
|
|
567
|
+
const themeInsetShadow = fromTheme("inset-shadow");
|
|
568
|
+
const themeTextShadow = fromTheme("text-shadow");
|
|
569
|
+
const themeDropShadow = fromTheme("drop-shadow");
|
|
570
|
+
const themeBlur = fromTheme("blur");
|
|
571
|
+
const themePerspective = fromTheme("perspective");
|
|
572
|
+
const themeAspect = fromTheme("aspect");
|
|
573
|
+
const themeEase = fromTheme("ease");
|
|
574
|
+
const themeAnimate = fromTheme("animate");
|
|
575
|
+
const scaleBreak = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
|
|
576
|
+
const scalePosition = () => [
|
|
577
|
+
"center",
|
|
578
|
+
"top",
|
|
579
|
+
"bottom",
|
|
580
|
+
"left",
|
|
581
|
+
"right",
|
|
582
|
+
"top-left",
|
|
583
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
584
|
+
"left-top",
|
|
585
|
+
"top-right",
|
|
586
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
587
|
+
"right-top",
|
|
588
|
+
"bottom-right",
|
|
589
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
590
|
+
"right-bottom",
|
|
591
|
+
"bottom-left",
|
|
592
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
593
|
+
"left-bottom"
|
|
594
|
+
];
|
|
595
|
+
const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
|
|
596
|
+
const scaleOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
|
|
597
|
+
const scaleOverscroll = () => ["auto", "contain", "none"];
|
|
598
|
+
const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
|
|
599
|
+
const scaleInset = () => [isFraction, "full", "auto", ...scaleUnambiguousSpacing()];
|
|
600
|
+
const scaleGridTemplateColsRows = () => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue];
|
|
601
|
+
const scaleGridColRowStartAndEnd = () => ["auto", {
|
|
602
|
+
span: ["full", isInteger, isArbitraryVariable, isArbitraryValue]
|
|
603
|
+
}, isInteger, isArbitraryVariable, isArbitraryValue];
|
|
604
|
+
const scaleGridColRowStartOrEnd = () => [isInteger, "auto", isArbitraryVariable, isArbitraryValue];
|
|
605
|
+
const scaleGridAutoColsRows = () => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue];
|
|
606
|
+
const scaleAlignPrimaryAxis = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"];
|
|
607
|
+
const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"];
|
|
608
|
+
const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
|
|
609
|
+
const scaleSizing = () => [isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
|
|
610
|
+
const scaleSizingInline = () => [isFraction, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...scaleUnambiguousSpacing()];
|
|
611
|
+
const scaleSizingBlock = () => [isFraction, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
|
|
612
|
+
const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
|
|
613
|
+
const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
|
|
614
|
+
position: [isArbitraryVariable, isArbitraryValue]
|
|
615
|
+
}];
|
|
616
|
+
const scaleBgRepeat = () => ["no-repeat", {
|
|
617
|
+
repeat: ["", "x", "y", "space", "round"]
|
|
618
|
+
}];
|
|
619
|
+
const scaleBgSize = () => ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, {
|
|
620
|
+
size: [isArbitraryVariable, isArbitraryValue]
|
|
621
|
+
}];
|
|
622
|
+
const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
|
|
623
|
+
const scaleRadius = () => [
|
|
624
|
+
// Deprecated since Tailwind CSS v4.0.0
|
|
625
|
+
"",
|
|
626
|
+
"none",
|
|
627
|
+
"full",
|
|
628
|
+
themeRadius,
|
|
629
|
+
isArbitraryVariable,
|
|
630
|
+
isArbitraryValue
|
|
631
|
+
];
|
|
632
|
+
const scaleBorderWidth = () => ["", isNumber, isArbitraryVariableLength, isArbitraryLength];
|
|
633
|
+
const scaleLineStyle = () => ["solid", "dashed", "dotted", "double"];
|
|
634
|
+
const scaleBlendMode = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
635
|
+
const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
|
|
636
|
+
const scaleBlur = () => [
|
|
637
|
+
// Deprecated since Tailwind CSS v4.0.0
|
|
638
|
+
"",
|
|
639
|
+
"none",
|
|
640
|
+
themeBlur,
|
|
641
|
+
isArbitraryVariable,
|
|
642
|
+
isArbitraryValue
|
|
643
|
+
];
|
|
644
|
+
const scaleRotate = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
|
|
645
|
+
const scaleScale = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
|
|
646
|
+
const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
|
|
647
|
+
const scaleTranslate = () => [isFraction, "full", ...scaleUnambiguousSpacing()];
|
|
648
|
+
return {
|
|
649
|
+
cacheSize: 500,
|
|
650
|
+
theme: {
|
|
651
|
+
animate: ["spin", "ping", "pulse", "bounce"],
|
|
652
|
+
aspect: ["video"],
|
|
653
|
+
blur: [isTshirtSize],
|
|
654
|
+
breakpoint: [isTshirtSize],
|
|
655
|
+
color: [isAny],
|
|
656
|
+
container: [isTshirtSize],
|
|
657
|
+
"drop-shadow": [isTshirtSize],
|
|
658
|
+
ease: ["in", "out", "in-out"],
|
|
659
|
+
font: [isAnyNonArbitrary],
|
|
660
|
+
"font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
|
|
661
|
+
"inset-shadow": [isTshirtSize],
|
|
662
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
|
|
663
|
+
perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"],
|
|
664
|
+
radius: [isTshirtSize],
|
|
665
|
+
shadow: [isTshirtSize],
|
|
666
|
+
spacing: ["px", isNumber],
|
|
667
|
+
text: [isTshirtSize],
|
|
668
|
+
"text-shadow": [isTshirtSize],
|
|
669
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
|
|
670
|
+
},
|
|
671
|
+
classGroups: {
|
|
672
|
+
// --------------
|
|
673
|
+
// --- Layout ---
|
|
674
|
+
// --------------
|
|
675
|
+
/**
|
|
676
|
+
* Aspect Ratio
|
|
677
|
+
* @see https://tailwindcss.com/docs/aspect-ratio
|
|
678
|
+
*/
|
|
679
|
+
aspect: [{
|
|
680
|
+
aspect: ["auto", "square", isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
|
|
681
|
+
}],
|
|
682
|
+
/**
|
|
683
|
+
* Container
|
|
684
|
+
* @see https://tailwindcss.com/docs/container
|
|
685
|
+
* @deprecated since Tailwind CSS v4.0.0
|
|
686
|
+
*/
|
|
687
|
+
container: ["container"],
|
|
688
|
+
/**
|
|
689
|
+
* Columns
|
|
690
|
+
* @see https://tailwindcss.com/docs/columns
|
|
691
|
+
*/
|
|
692
|
+
columns: [{
|
|
693
|
+
columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
|
|
694
|
+
}],
|
|
695
|
+
/**
|
|
696
|
+
* Break After
|
|
697
|
+
* @see https://tailwindcss.com/docs/break-after
|
|
698
|
+
*/
|
|
699
|
+
"break-after": [{
|
|
700
|
+
"break-after": scaleBreak()
|
|
701
|
+
}],
|
|
702
|
+
/**
|
|
703
|
+
* Break Before
|
|
704
|
+
* @see https://tailwindcss.com/docs/break-before
|
|
705
|
+
*/
|
|
706
|
+
"break-before": [{
|
|
707
|
+
"break-before": scaleBreak()
|
|
708
|
+
}],
|
|
709
|
+
/**
|
|
710
|
+
* Break Inside
|
|
711
|
+
* @see https://tailwindcss.com/docs/break-inside
|
|
712
|
+
*/
|
|
713
|
+
"break-inside": [{
|
|
714
|
+
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
|
|
715
|
+
}],
|
|
716
|
+
/**
|
|
717
|
+
* Box Decoration Break
|
|
718
|
+
* @see https://tailwindcss.com/docs/box-decoration-break
|
|
719
|
+
*/
|
|
720
|
+
"box-decoration": [{
|
|
721
|
+
"box-decoration": ["slice", "clone"]
|
|
722
|
+
}],
|
|
723
|
+
/**
|
|
724
|
+
* Box Sizing
|
|
725
|
+
* @see https://tailwindcss.com/docs/box-sizing
|
|
726
|
+
*/
|
|
727
|
+
box: [{
|
|
728
|
+
box: ["border", "content"]
|
|
729
|
+
}],
|
|
730
|
+
/**
|
|
731
|
+
* Display
|
|
732
|
+
* @see https://tailwindcss.com/docs/display
|
|
733
|
+
*/
|
|
734
|
+
display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
|
|
735
|
+
/**
|
|
736
|
+
* Screen Reader Only
|
|
737
|
+
* @see https://tailwindcss.com/docs/display#screen-reader-only
|
|
738
|
+
*/
|
|
739
|
+
sr: ["sr-only", "not-sr-only"],
|
|
740
|
+
/**
|
|
741
|
+
* Floats
|
|
742
|
+
* @see https://tailwindcss.com/docs/float
|
|
743
|
+
*/
|
|
744
|
+
float: [{
|
|
745
|
+
float: ["right", "left", "none", "start", "end"]
|
|
746
|
+
}],
|
|
747
|
+
/**
|
|
748
|
+
* Clear
|
|
749
|
+
* @see https://tailwindcss.com/docs/clear
|
|
750
|
+
*/
|
|
751
|
+
clear: [{
|
|
752
|
+
clear: ["left", "right", "both", "none", "start", "end"]
|
|
753
|
+
}],
|
|
754
|
+
/**
|
|
755
|
+
* Isolation
|
|
756
|
+
* @see https://tailwindcss.com/docs/isolation
|
|
757
|
+
*/
|
|
758
|
+
isolation: ["isolate", "isolation-auto"],
|
|
759
|
+
/**
|
|
760
|
+
* Object Fit
|
|
761
|
+
* @see https://tailwindcss.com/docs/object-fit
|
|
762
|
+
*/
|
|
763
|
+
"object-fit": [{
|
|
764
|
+
object: ["contain", "cover", "fill", "none", "scale-down"]
|
|
765
|
+
}],
|
|
766
|
+
/**
|
|
767
|
+
* Object Position
|
|
768
|
+
* @see https://tailwindcss.com/docs/object-position
|
|
769
|
+
*/
|
|
770
|
+
"object-position": [{
|
|
771
|
+
object: scalePositionWithArbitrary()
|
|
772
|
+
}],
|
|
773
|
+
/**
|
|
774
|
+
* Overflow
|
|
775
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
776
|
+
*/
|
|
777
|
+
overflow: [{
|
|
778
|
+
overflow: scaleOverflow()
|
|
779
|
+
}],
|
|
780
|
+
/**
|
|
781
|
+
* Overflow X
|
|
782
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
783
|
+
*/
|
|
784
|
+
"overflow-x": [{
|
|
785
|
+
"overflow-x": scaleOverflow()
|
|
786
|
+
}],
|
|
787
|
+
/**
|
|
788
|
+
* Overflow Y
|
|
789
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
790
|
+
*/
|
|
791
|
+
"overflow-y": [{
|
|
792
|
+
"overflow-y": scaleOverflow()
|
|
793
|
+
}],
|
|
794
|
+
/**
|
|
795
|
+
* Overscroll Behavior
|
|
796
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
797
|
+
*/
|
|
798
|
+
overscroll: [{
|
|
799
|
+
overscroll: scaleOverscroll()
|
|
800
|
+
}],
|
|
801
|
+
/**
|
|
802
|
+
* Overscroll Behavior X
|
|
803
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
804
|
+
*/
|
|
805
|
+
"overscroll-x": [{
|
|
806
|
+
"overscroll-x": scaleOverscroll()
|
|
807
|
+
}],
|
|
808
|
+
/**
|
|
809
|
+
* Overscroll Behavior Y
|
|
810
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
811
|
+
*/
|
|
812
|
+
"overscroll-y": [{
|
|
813
|
+
"overscroll-y": scaleOverscroll()
|
|
814
|
+
}],
|
|
815
|
+
/**
|
|
816
|
+
* Position
|
|
817
|
+
* @see https://tailwindcss.com/docs/position
|
|
818
|
+
*/
|
|
819
|
+
position: ["static", "fixed", "absolute", "relative", "sticky"],
|
|
820
|
+
/**
|
|
821
|
+
* Inset
|
|
822
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
823
|
+
*/
|
|
824
|
+
inset: [{
|
|
825
|
+
inset: scaleInset()
|
|
826
|
+
}],
|
|
827
|
+
/**
|
|
828
|
+
* Inset Inline
|
|
829
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
830
|
+
*/
|
|
831
|
+
"inset-x": [{
|
|
832
|
+
"inset-x": scaleInset()
|
|
833
|
+
}],
|
|
834
|
+
/**
|
|
835
|
+
* Inset Block
|
|
836
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
837
|
+
*/
|
|
838
|
+
"inset-y": [{
|
|
839
|
+
"inset-y": scaleInset()
|
|
840
|
+
}],
|
|
841
|
+
/**
|
|
842
|
+
* Inset Inline Start
|
|
843
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
844
|
+
* @todo class group will be renamed to `inset-s` in next major release
|
|
845
|
+
*/
|
|
846
|
+
start: [{
|
|
847
|
+
"inset-s": scaleInset(),
|
|
848
|
+
/**
|
|
849
|
+
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-s-*` utilities.
|
|
850
|
+
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
851
|
+
*/
|
|
852
|
+
start: scaleInset()
|
|
853
|
+
}],
|
|
854
|
+
/**
|
|
855
|
+
* Inset Inline End
|
|
856
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
857
|
+
* @todo class group will be renamed to `inset-e` in next major release
|
|
858
|
+
*/
|
|
859
|
+
end: [{
|
|
860
|
+
"inset-e": scaleInset(),
|
|
861
|
+
/**
|
|
862
|
+
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-e-*` utilities.
|
|
863
|
+
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
864
|
+
*/
|
|
865
|
+
end: scaleInset()
|
|
866
|
+
}],
|
|
867
|
+
/**
|
|
868
|
+
* Inset Block Start
|
|
869
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
870
|
+
*/
|
|
871
|
+
"inset-bs": [{
|
|
872
|
+
"inset-bs": scaleInset()
|
|
873
|
+
}],
|
|
874
|
+
/**
|
|
875
|
+
* Inset Block End
|
|
876
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
877
|
+
*/
|
|
878
|
+
"inset-be": [{
|
|
879
|
+
"inset-be": scaleInset()
|
|
880
|
+
}],
|
|
881
|
+
/**
|
|
882
|
+
* Top
|
|
883
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
884
|
+
*/
|
|
885
|
+
top: [{
|
|
886
|
+
top: scaleInset()
|
|
887
|
+
}],
|
|
888
|
+
/**
|
|
889
|
+
* Right
|
|
890
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
891
|
+
*/
|
|
892
|
+
right: [{
|
|
893
|
+
right: scaleInset()
|
|
894
|
+
}],
|
|
895
|
+
/**
|
|
896
|
+
* Bottom
|
|
897
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
898
|
+
*/
|
|
899
|
+
bottom: [{
|
|
900
|
+
bottom: scaleInset()
|
|
901
|
+
}],
|
|
902
|
+
/**
|
|
903
|
+
* Left
|
|
904
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
905
|
+
*/
|
|
906
|
+
left: [{
|
|
907
|
+
left: scaleInset()
|
|
908
|
+
}],
|
|
909
|
+
/**
|
|
910
|
+
* Visibility
|
|
911
|
+
* @see https://tailwindcss.com/docs/visibility
|
|
912
|
+
*/
|
|
913
|
+
visibility: ["visible", "invisible", "collapse"],
|
|
914
|
+
/**
|
|
915
|
+
* Z-Index
|
|
916
|
+
* @see https://tailwindcss.com/docs/z-index
|
|
917
|
+
*/
|
|
918
|
+
z: [{
|
|
919
|
+
z: [isInteger, "auto", isArbitraryVariable, isArbitraryValue]
|
|
920
|
+
}],
|
|
921
|
+
// ------------------------
|
|
922
|
+
// --- Flexbox and Grid ---
|
|
923
|
+
// ------------------------
|
|
924
|
+
/**
|
|
925
|
+
* Flex Basis
|
|
926
|
+
* @see https://tailwindcss.com/docs/flex-basis
|
|
927
|
+
*/
|
|
928
|
+
basis: [{
|
|
929
|
+
basis: [isFraction, "full", "auto", themeContainer, ...scaleUnambiguousSpacing()]
|
|
930
|
+
}],
|
|
931
|
+
/**
|
|
932
|
+
* Flex Direction
|
|
933
|
+
* @see https://tailwindcss.com/docs/flex-direction
|
|
934
|
+
*/
|
|
935
|
+
"flex-direction": [{
|
|
936
|
+
flex: ["row", "row-reverse", "col", "col-reverse"]
|
|
937
|
+
}],
|
|
938
|
+
/**
|
|
939
|
+
* Flex Wrap
|
|
940
|
+
* @see https://tailwindcss.com/docs/flex-wrap
|
|
941
|
+
*/
|
|
942
|
+
"flex-wrap": [{
|
|
943
|
+
flex: ["nowrap", "wrap", "wrap-reverse"]
|
|
944
|
+
}],
|
|
945
|
+
/**
|
|
946
|
+
* Flex
|
|
947
|
+
* @see https://tailwindcss.com/docs/flex
|
|
948
|
+
*/
|
|
949
|
+
flex: [{
|
|
950
|
+
flex: [isNumber, isFraction, "auto", "initial", "none", isArbitraryValue]
|
|
951
|
+
}],
|
|
952
|
+
/**
|
|
953
|
+
* Flex Grow
|
|
954
|
+
* @see https://tailwindcss.com/docs/flex-grow
|
|
955
|
+
*/
|
|
956
|
+
grow: [{
|
|
957
|
+
grow: ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
958
|
+
}],
|
|
959
|
+
/**
|
|
960
|
+
* Flex Shrink
|
|
961
|
+
* @see https://tailwindcss.com/docs/flex-shrink
|
|
962
|
+
*/
|
|
963
|
+
shrink: [{
|
|
964
|
+
shrink: ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
965
|
+
}],
|
|
966
|
+
/**
|
|
967
|
+
* Order
|
|
968
|
+
* @see https://tailwindcss.com/docs/order
|
|
969
|
+
*/
|
|
970
|
+
order: [{
|
|
971
|
+
order: [isInteger, "first", "last", "none", isArbitraryVariable, isArbitraryValue]
|
|
972
|
+
}],
|
|
973
|
+
/**
|
|
974
|
+
* Grid Template Columns
|
|
975
|
+
* @see https://tailwindcss.com/docs/grid-template-columns
|
|
976
|
+
*/
|
|
977
|
+
"grid-cols": [{
|
|
978
|
+
"grid-cols": scaleGridTemplateColsRows()
|
|
979
|
+
}],
|
|
980
|
+
/**
|
|
981
|
+
* Grid Column Start / End
|
|
982
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
983
|
+
*/
|
|
984
|
+
"col-start-end": [{
|
|
985
|
+
col: scaleGridColRowStartAndEnd()
|
|
986
|
+
}],
|
|
987
|
+
/**
|
|
988
|
+
* Grid Column Start
|
|
989
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
990
|
+
*/
|
|
991
|
+
"col-start": [{
|
|
992
|
+
"col-start": scaleGridColRowStartOrEnd()
|
|
993
|
+
}],
|
|
994
|
+
/**
|
|
995
|
+
* Grid Column End
|
|
996
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
997
|
+
*/
|
|
998
|
+
"col-end": [{
|
|
999
|
+
"col-end": scaleGridColRowStartOrEnd()
|
|
1000
|
+
}],
|
|
1001
|
+
/**
|
|
1002
|
+
* Grid Template Rows
|
|
1003
|
+
* @see https://tailwindcss.com/docs/grid-template-rows
|
|
1004
|
+
*/
|
|
1005
|
+
"grid-rows": [{
|
|
1006
|
+
"grid-rows": scaleGridTemplateColsRows()
|
|
1007
|
+
}],
|
|
1008
|
+
/**
|
|
1009
|
+
* Grid Row Start / End
|
|
1010
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1011
|
+
*/
|
|
1012
|
+
"row-start-end": [{
|
|
1013
|
+
row: scaleGridColRowStartAndEnd()
|
|
1014
|
+
}],
|
|
1015
|
+
/**
|
|
1016
|
+
* Grid Row Start
|
|
1017
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1018
|
+
*/
|
|
1019
|
+
"row-start": [{
|
|
1020
|
+
"row-start": scaleGridColRowStartOrEnd()
|
|
1021
|
+
}],
|
|
1022
|
+
/**
|
|
1023
|
+
* Grid Row End
|
|
1024
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1025
|
+
*/
|
|
1026
|
+
"row-end": [{
|
|
1027
|
+
"row-end": scaleGridColRowStartOrEnd()
|
|
1028
|
+
}],
|
|
1029
|
+
/**
|
|
1030
|
+
* Grid Auto Flow
|
|
1031
|
+
* @see https://tailwindcss.com/docs/grid-auto-flow
|
|
1032
|
+
*/
|
|
1033
|
+
"grid-flow": [{
|
|
1034
|
+
"grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
|
|
1035
|
+
}],
|
|
1036
|
+
/**
|
|
1037
|
+
* Grid Auto Columns
|
|
1038
|
+
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
1039
|
+
*/
|
|
1040
|
+
"auto-cols": [{
|
|
1041
|
+
"auto-cols": scaleGridAutoColsRows()
|
|
1042
|
+
}],
|
|
1043
|
+
/**
|
|
1044
|
+
* Grid Auto Rows
|
|
1045
|
+
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
1046
|
+
*/
|
|
1047
|
+
"auto-rows": [{
|
|
1048
|
+
"auto-rows": scaleGridAutoColsRows()
|
|
1049
|
+
}],
|
|
1050
|
+
/**
|
|
1051
|
+
* Gap
|
|
1052
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1053
|
+
*/
|
|
1054
|
+
gap: [{
|
|
1055
|
+
gap: scaleUnambiguousSpacing()
|
|
1056
|
+
}],
|
|
1057
|
+
/**
|
|
1058
|
+
* Gap X
|
|
1059
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1060
|
+
*/
|
|
1061
|
+
"gap-x": [{
|
|
1062
|
+
"gap-x": scaleUnambiguousSpacing()
|
|
1063
|
+
}],
|
|
1064
|
+
/**
|
|
1065
|
+
* Gap Y
|
|
1066
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1067
|
+
*/
|
|
1068
|
+
"gap-y": [{
|
|
1069
|
+
"gap-y": scaleUnambiguousSpacing()
|
|
1070
|
+
}],
|
|
1071
|
+
/**
|
|
1072
|
+
* Justify Content
|
|
1073
|
+
* @see https://tailwindcss.com/docs/justify-content
|
|
1074
|
+
*/
|
|
1075
|
+
"justify-content": [{
|
|
1076
|
+
justify: [...scaleAlignPrimaryAxis(), "normal"]
|
|
1077
|
+
}],
|
|
1078
|
+
/**
|
|
1079
|
+
* Justify Items
|
|
1080
|
+
* @see https://tailwindcss.com/docs/justify-items
|
|
1081
|
+
*/
|
|
1082
|
+
"justify-items": [{
|
|
1083
|
+
"justify-items": [...scaleAlignSecondaryAxis(), "normal"]
|
|
1084
|
+
}],
|
|
1085
|
+
/**
|
|
1086
|
+
* Justify Self
|
|
1087
|
+
* @see https://tailwindcss.com/docs/justify-self
|
|
1088
|
+
*/
|
|
1089
|
+
"justify-self": [{
|
|
1090
|
+
"justify-self": ["auto", ...scaleAlignSecondaryAxis()]
|
|
1091
|
+
}],
|
|
1092
|
+
/**
|
|
1093
|
+
* Align Content
|
|
1094
|
+
* @see https://tailwindcss.com/docs/align-content
|
|
1095
|
+
*/
|
|
1096
|
+
"align-content": [{
|
|
1097
|
+
content: ["normal", ...scaleAlignPrimaryAxis()]
|
|
1098
|
+
}],
|
|
1099
|
+
/**
|
|
1100
|
+
* Align Items
|
|
1101
|
+
* @see https://tailwindcss.com/docs/align-items
|
|
1102
|
+
*/
|
|
1103
|
+
"align-items": [{
|
|
1104
|
+
items: [...scaleAlignSecondaryAxis(), {
|
|
1105
|
+
baseline: ["", "last"]
|
|
1106
|
+
}]
|
|
1107
|
+
}],
|
|
1108
|
+
/**
|
|
1109
|
+
* Align Self
|
|
1110
|
+
* @see https://tailwindcss.com/docs/align-self
|
|
1111
|
+
*/
|
|
1112
|
+
"align-self": [{
|
|
1113
|
+
self: ["auto", ...scaleAlignSecondaryAxis(), {
|
|
1114
|
+
baseline: ["", "last"]
|
|
1115
|
+
}]
|
|
1116
|
+
}],
|
|
1117
|
+
/**
|
|
1118
|
+
* Place Content
|
|
1119
|
+
* @see https://tailwindcss.com/docs/place-content
|
|
1120
|
+
*/
|
|
1121
|
+
"place-content": [{
|
|
1122
|
+
"place-content": scaleAlignPrimaryAxis()
|
|
1123
|
+
}],
|
|
1124
|
+
/**
|
|
1125
|
+
* Place Items
|
|
1126
|
+
* @see https://tailwindcss.com/docs/place-items
|
|
1127
|
+
*/
|
|
1128
|
+
"place-items": [{
|
|
1129
|
+
"place-items": [...scaleAlignSecondaryAxis(), "baseline"]
|
|
1130
|
+
}],
|
|
1131
|
+
/**
|
|
1132
|
+
* Place Self
|
|
1133
|
+
* @see https://tailwindcss.com/docs/place-self
|
|
1134
|
+
*/
|
|
1135
|
+
"place-self": [{
|
|
1136
|
+
"place-self": ["auto", ...scaleAlignSecondaryAxis()]
|
|
1137
|
+
}],
|
|
1138
|
+
// Spacing
|
|
1139
|
+
/**
|
|
1140
|
+
* Padding
|
|
1141
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1142
|
+
*/
|
|
1143
|
+
p: [{
|
|
1144
|
+
p: scaleUnambiguousSpacing()
|
|
1145
|
+
}],
|
|
1146
|
+
/**
|
|
1147
|
+
* Padding Inline
|
|
1148
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1149
|
+
*/
|
|
1150
|
+
px: [{
|
|
1151
|
+
px: scaleUnambiguousSpacing()
|
|
1152
|
+
}],
|
|
1153
|
+
/**
|
|
1154
|
+
* Padding Block
|
|
1155
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1156
|
+
*/
|
|
1157
|
+
py: [{
|
|
1158
|
+
py: scaleUnambiguousSpacing()
|
|
1159
|
+
}],
|
|
1160
|
+
/**
|
|
1161
|
+
* Padding Inline Start
|
|
1162
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1163
|
+
*/
|
|
1164
|
+
ps: [{
|
|
1165
|
+
ps: scaleUnambiguousSpacing()
|
|
1166
|
+
}],
|
|
1167
|
+
/**
|
|
1168
|
+
* Padding Inline End
|
|
1169
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1170
|
+
*/
|
|
1171
|
+
pe: [{
|
|
1172
|
+
pe: scaleUnambiguousSpacing()
|
|
1173
|
+
}],
|
|
1174
|
+
/**
|
|
1175
|
+
* Padding Block Start
|
|
1176
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1177
|
+
*/
|
|
1178
|
+
pbs: [{
|
|
1179
|
+
pbs: scaleUnambiguousSpacing()
|
|
1180
|
+
}],
|
|
1181
|
+
/**
|
|
1182
|
+
* Padding Block End
|
|
1183
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1184
|
+
*/
|
|
1185
|
+
pbe: [{
|
|
1186
|
+
pbe: scaleUnambiguousSpacing()
|
|
1187
|
+
}],
|
|
1188
|
+
/**
|
|
1189
|
+
* Padding Top
|
|
1190
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1191
|
+
*/
|
|
1192
|
+
pt: [{
|
|
1193
|
+
pt: scaleUnambiguousSpacing()
|
|
1194
|
+
}],
|
|
1195
|
+
/**
|
|
1196
|
+
* Padding Right
|
|
1197
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1198
|
+
*/
|
|
1199
|
+
pr: [{
|
|
1200
|
+
pr: scaleUnambiguousSpacing()
|
|
1201
|
+
}],
|
|
1202
|
+
/**
|
|
1203
|
+
* Padding Bottom
|
|
1204
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1205
|
+
*/
|
|
1206
|
+
pb: [{
|
|
1207
|
+
pb: scaleUnambiguousSpacing()
|
|
1208
|
+
}],
|
|
1209
|
+
/**
|
|
1210
|
+
* Padding Left
|
|
1211
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1212
|
+
*/
|
|
1213
|
+
pl: [{
|
|
1214
|
+
pl: scaleUnambiguousSpacing()
|
|
1215
|
+
}],
|
|
1216
|
+
/**
|
|
1217
|
+
* Margin
|
|
1218
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1219
|
+
*/
|
|
1220
|
+
m: [{
|
|
1221
|
+
m: scaleMargin()
|
|
1222
|
+
}],
|
|
1223
|
+
/**
|
|
1224
|
+
* Margin Inline
|
|
1225
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1226
|
+
*/
|
|
1227
|
+
mx: [{
|
|
1228
|
+
mx: scaleMargin()
|
|
1229
|
+
}],
|
|
1230
|
+
/**
|
|
1231
|
+
* Margin Block
|
|
1232
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1233
|
+
*/
|
|
1234
|
+
my: [{
|
|
1235
|
+
my: scaleMargin()
|
|
1236
|
+
}],
|
|
1237
|
+
/**
|
|
1238
|
+
* Margin Inline Start
|
|
1239
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1240
|
+
*/
|
|
1241
|
+
ms: [{
|
|
1242
|
+
ms: scaleMargin()
|
|
1243
|
+
}],
|
|
1244
|
+
/**
|
|
1245
|
+
* Margin Inline End
|
|
1246
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1247
|
+
*/
|
|
1248
|
+
me: [{
|
|
1249
|
+
me: scaleMargin()
|
|
1250
|
+
}],
|
|
1251
|
+
/**
|
|
1252
|
+
* Margin Block Start
|
|
1253
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1254
|
+
*/
|
|
1255
|
+
mbs: [{
|
|
1256
|
+
mbs: scaleMargin()
|
|
1257
|
+
}],
|
|
1258
|
+
/**
|
|
1259
|
+
* Margin Block End
|
|
1260
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1261
|
+
*/
|
|
1262
|
+
mbe: [{
|
|
1263
|
+
mbe: scaleMargin()
|
|
1264
|
+
}],
|
|
1265
|
+
/**
|
|
1266
|
+
* Margin Top
|
|
1267
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1268
|
+
*/
|
|
1269
|
+
mt: [{
|
|
1270
|
+
mt: scaleMargin()
|
|
1271
|
+
}],
|
|
1272
|
+
/**
|
|
1273
|
+
* Margin Right
|
|
1274
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1275
|
+
*/
|
|
1276
|
+
mr: [{
|
|
1277
|
+
mr: scaleMargin()
|
|
1278
|
+
}],
|
|
1279
|
+
/**
|
|
1280
|
+
* Margin Bottom
|
|
1281
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1282
|
+
*/
|
|
1283
|
+
mb: [{
|
|
1284
|
+
mb: scaleMargin()
|
|
1285
|
+
}],
|
|
1286
|
+
/**
|
|
1287
|
+
* Margin Left
|
|
1288
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1289
|
+
*/
|
|
1290
|
+
ml: [{
|
|
1291
|
+
ml: scaleMargin()
|
|
1292
|
+
}],
|
|
1293
|
+
/**
|
|
1294
|
+
* Space Between X
|
|
1295
|
+
* @see https://tailwindcss.com/docs/margin#adding-space-between-children
|
|
1296
|
+
*/
|
|
1297
|
+
"space-x": [{
|
|
1298
|
+
"space-x": scaleUnambiguousSpacing()
|
|
1299
|
+
}],
|
|
1300
|
+
/**
|
|
1301
|
+
* Space Between X Reverse
|
|
1302
|
+
* @see https://tailwindcss.com/docs/margin#adding-space-between-children
|
|
1303
|
+
*/
|
|
1304
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
1305
|
+
/**
|
|
1306
|
+
* Space Between Y
|
|
1307
|
+
* @see https://tailwindcss.com/docs/margin#adding-space-between-children
|
|
1308
|
+
*/
|
|
1309
|
+
"space-y": [{
|
|
1310
|
+
"space-y": scaleUnambiguousSpacing()
|
|
1311
|
+
}],
|
|
1312
|
+
/**
|
|
1313
|
+
* Space Between Y Reverse
|
|
1314
|
+
* @see https://tailwindcss.com/docs/margin#adding-space-between-children
|
|
1315
|
+
*/
|
|
1316
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
1317
|
+
// --------------
|
|
1318
|
+
// --- Sizing ---
|
|
1319
|
+
// --------------
|
|
1320
|
+
/**
|
|
1321
|
+
* Size
|
|
1322
|
+
* @see https://tailwindcss.com/docs/width#setting-both-width-and-height
|
|
1323
|
+
*/
|
|
1324
|
+
size: [{
|
|
1325
|
+
size: scaleSizing()
|
|
1326
|
+
}],
|
|
1327
|
+
/**
|
|
1328
|
+
* Inline Size
|
|
1329
|
+
* @see https://tailwindcss.com/docs/width
|
|
1330
|
+
*/
|
|
1331
|
+
"inline-size": [{
|
|
1332
|
+
inline: ["auto", ...scaleSizingInline()]
|
|
1333
|
+
}],
|
|
1334
|
+
/**
|
|
1335
|
+
* Min-Inline Size
|
|
1336
|
+
* @see https://tailwindcss.com/docs/min-width
|
|
1337
|
+
*/
|
|
1338
|
+
"min-inline-size": [{
|
|
1339
|
+
"min-inline": ["auto", ...scaleSizingInline()]
|
|
1340
|
+
}],
|
|
1341
|
+
/**
|
|
1342
|
+
* Max-Inline Size
|
|
1343
|
+
* @see https://tailwindcss.com/docs/max-width
|
|
1344
|
+
*/
|
|
1345
|
+
"max-inline-size": [{
|
|
1346
|
+
"max-inline": ["none", ...scaleSizingInline()]
|
|
1347
|
+
}],
|
|
1348
|
+
/**
|
|
1349
|
+
* Block Size
|
|
1350
|
+
* @see https://tailwindcss.com/docs/height
|
|
1351
|
+
*/
|
|
1352
|
+
"block-size": [{
|
|
1353
|
+
block: ["auto", ...scaleSizingBlock()]
|
|
1354
|
+
}],
|
|
1355
|
+
/**
|
|
1356
|
+
* Min-Block Size
|
|
1357
|
+
* @see https://tailwindcss.com/docs/min-height
|
|
1358
|
+
*/
|
|
1359
|
+
"min-block-size": [{
|
|
1360
|
+
"min-block": ["auto", ...scaleSizingBlock()]
|
|
1361
|
+
}],
|
|
1362
|
+
/**
|
|
1363
|
+
* Max-Block Size
|
|
1364
|
+
* @see https://tailwindcss.com/docs/max-height
|
|
1365
|
+
*/
|
|
1366
|
+
"max-block-size": [{
|
|
1367
|
+
"max-block": ["none", ...scaleSizingBlock()]
|
|
1368
|
+
}],
|
|
1369
|
+
/**
|
|
1370
|
+
* Width
|
|
1371
|
+
* @see https://tailwindcss.com/docs/width
|
|
1372
|
+
*/
|
|
1373
|
+
w: [{
|
|
1374
|
+
w: [themeContainer, "screen", ...scaleSizing()]
|
|
1375
|
+
}],
|
|
1376
|
+
/**
|
|
1377
|
+
* Min-Width
|
|
1378
|
+
* @see https://tailwindcss.com/docs/min-width
|
|
1379
|
+
*/
|
|
1380
|
+
"min-w": [{
|
|
1381
|
+
"min-w": [
|
|
1382
|
+
themeContainer,
|
|
1383
|
+
"screen",
|
|
1384
|
+
/** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
1385
|
+
"none",
|
|
1386
|
+
...scaleSizing()
|
|
1387
|
+
]
|
|
1388
|
+
}],
|
|
1389
|
+
/**
|
|
1390
|
+
* Max-Width
|
|
1391
|
+
* @see https://tailwindcss.com/docs/max-width
|
|
1392
|
+
*/
|
|
1393
|
+
"max-w": [{
|
|
1394
|
+
"max-w": [
|
|
1395
|
+
themeContainer,
|
|
1396
|
+
"screen",
|
|
1397
|
+
"none",
|
|
1398
|
+
/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
1399
|
+
"prose",
|
|
1400
|
+
/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
1401
|
+
{
|
|
1402
|
+
screen: [themeBreakpoint]
|
|
1403
|
+
},
|
|
1404
|
+
...scaleSizing()
|
|
1405
|
+
]
|
|
1406
|
+
}],
|
|
1407
|
+
/**
|
|
1408
|
+
* Height
|
|
1409
|
+
* @see https://tailwindcss.com/docs/height
|
|
1410
|
+
*/
|
|
1411
|
+
h: [{
|
|
1412
|
+
h: ["screen", "lh", ...scaleSizing()]
|
|
1413
|
+
}],
|
|
1414
|
+
/**
|
|
1415
|
+
* Min-Height
|
|
1416
|
+
* @see https://tailwindcss.com/docs/min-height
|
|
1417
|
+
*/
|
|
1418
|
+
"min-h": [{
|
|
1419
|
+
"min-h": ["screen", "lh", "none", ...scaleSizing()]
|
|
1420
|
+
}],
|
|
1421
|
+
/**
|
|
1422
|
+
* Max-Height
|
|
1423
|
+
* @see https://tailwindcss.com/docs/max-height
|
|
1424
|
+
*/
|
|
1425
|
+
"max-h": [{
|
|
1426
|
+
"max-h": ["screen", "lh", ...scaleSizing()]
|
|
1427
|
+
}],
|
|
1428
|
+
// ------------------
|
|
1429
|
+
// --- Typography ---
|
|
1430
|
+
// ------------------
|
|
1431
|
+
/**
|
|
1432
|
+
* Font Size
|
|
1433
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
1434
|
+
*/
|
|
1435
|
+
"font-size": [{
|
|
1436
|
+
text: ["base", themeText, isArbitraryVariableLength, isArbitraryLength]
|
|
1437
|
+
}],
|
|
1438
|
+
/**
|
|
1439
|
+
* Font Smoothing
|
|
1440
|
+
* @see https://tailwindcss.com/docs/font-smoothing
|
|
1441
|
+
*/
|
|
1442
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1443
|
+
/**
|
|
1444
|
+
* Font Style
|
|
1445
|
+
* @see https://tailwindcss.com/docs/font-style
|
|
1446
|
+
*/
|
|
1447
|
+
"font-style": ["italic", "not-italic"],
|
|
1448
|
+
/**
|
|
1449
|
+
* Font Weight
|
|
1450
|
+
* @see https://tailwindcss.com/docs/font-weight
|
|
1451
|
+
*/
|
|
1452
|
+
"font-weight": [{
|
|
1453
|
+
font: [themeFontWeight, isArbitraryVariableWeight, isArbitraryWeight]
|
|
1454
|
+
}],
|
|
1455
|
+
/**
|
|
1456
|
+
* Font Stretch
|
|
1457
|
+
* @see https://tailwindcss.com/docs/font-stretch
|
|
1458
|
+
*/
|
|
1459
|
+
"font-stretch": [{
|
|
1460
|
+
"font-stretch": ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", isPercent, isArbitraryValue]
|
|
1461
|
+
}],
|
|
1462
|
+
/**
|
|
1463
|
+
* Font Family
|
|
1464
|
+
* @see https://tailwindcss.com/docs/font-family
|
|
1465
|
+
*/
|
|
1466
|
+
"font-family": [{
|
|
1467
|
+
font: [isArbitraryVariableFamilyName, isArbitraryFamilyName, themeFont]
|
|
1468
|
+
}],
|
|
1469
|
+
/**
|
|
1470
|
+
* Font Feature Settings
|
|
1471
|
+
* @see https://tailwindcss.com/docs/font-feature-settings
|
|
1472
|
+
*/
|
|
1473
|
+
"font-features": [{
|
|
1474
|
+
"font-features": [isArbitraryValue]
|
|
1475
|
+
}],
|
|
1476
|
+
/**
|
|
1477
|
+
* Font Variant Numeric
|
|
1478
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1479
|
+
*/
|
|
1480
|
+
"fvn-normal": ["normal-nums"],
|
|
1481
|
+
/**
|
|
1482
|
+
* Font Variant Numeric
|
|
1483
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1484
|
+
*/
|
|
1485
|
+
"fvn-ordinal": ["ordinal"],
|
|
1486
|
+
/**
|
|
1487
|
+
* Font Variant Numeric
|
|
1488
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1489
|
+
*/
|
|
1490
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1491
|
+
/**
|
|
1492
|
+
* Font Variant Numeric
|
|
1493
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1494
|
+
*/
|
|
1495
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1496
|
+
/**
|
|
1497
|
+
* Font Variant Numeric
|
|
1498
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1499
|
+
*/
|
|
1500
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1501
|
+
/**
|
|
1502
|
+
* Font Variant Numeric
|
|
1503
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1504
|
+
*/
|
|
1505
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1506
|
+
/**
|
|
1507
|
+
* Letter Spacing
|
|
1508
|
+
* @see https://tailwindcss.com/docs/letter-spacing
|
|
1509
|
+
*/
|
|
1510
|
+
tracking: [{
|
|
1511
|
+
tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
|
|
1512
|
+
}],
|
|
1513
|
+
/**
|
|
1514
|
+
* Line Clamp
|
|
1515
|
+
* @see https://tailwindcss.com/docs/line-clamp
|
|
1516
|
+
*/
|
|
1517
|
+
"line-clamp": [{
|
|
1518
|
+
"line-clamp": [isNumber, "none", isArbitraryVariable, isArbitraryNumber]
|
|
1519
|
+
}],
|
|
1520
|
+
/**
|
|
1521
|
+
* Line Height
|
|
1522
|
+
* @see https://tailwindcss.com/docs/line-height
|
|
1523
|
+
*/
|
|
1524
|
+
leading: [{
|
|
1525
|
+
leading: [
|
|
1526
|
+
/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
1527
|
+
themeLeading,
|
|
1528
|
+
...scaleUnambiguousSpacing()
|
|
1529
|
+
]
|
|
1530
|
+
}],
|
|
1531
|
+
/**
|
|
1532
|
+
* List Style Image
|
|
1533
|
+
* @see https://tailwindcss.com/docs/list-style-image
|
|
1534
|
+
*/
|
|
1535
|
+
"list-image": [{
|
|
1536
|
+
"list-image": ["none", isArbitraryVariable, isArbitraryValue]
|
|
1537
|
+
}],
|
|
1538
|
+
/**
|
|
1539
|
+
* List Style Position
|
|
1540
|
+
* @see https://tailwindcss.com/docs/list-style-position
|
|
1541
|
+
*/
|
|
1542
|
+
"list-style-position": [{
|
|
1543
|
+
list: ["inside", "outside"]
|
|
1544
|
+
}],
|
|
1545
|
+
/**
|
|
1546
|
+
* List Style Type
|
|
1547
|
+
* @see https://tailwindcss.com/docs/list-style-type
|
|
1548
|
+
*/
|
|
1549
|
+
"list-style-type": [{
|
|
1550
|
+
list: ["disc", "decimal", "none", isArbitraryVariable, isArbitraryValue]
|
|
1551
|
+
}],
|
|
1552
|
+
/**
|
|
1553
|
+
* Text Alignment
|
|
1554
|
+
* @see https://tailwindcss.com/docs/text-align
|
|
1555
|
+
*/
|
|
1556
|
+
"text-alignment": [{
|
|
1557
|
+
text: ["left", "center", "right", "justify", "start", "end"]
|
|
1558
|
+
}],
|
|
1559
|
+
/**
|
|
1560
|
+
* Placeholder Color
|
|
1561
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1562
|
+
* @see https://v3.tailwindcss.com/docs/placeholder-color
|
|
1563
|
+
*/
|
|
1564
|
+
"placeholder-color": [{
|
|
1565
|
+
placeholder: scaleColor()
|
|
1566
|
+
}],
|
|
1567
|
+
/**
|
|
1568
|
+
* Text Color
|
|
1569
|
+
* @see https://tailwindcss.com/docs/text-color
|
|
1570
|
+
*/
|
|
1571
|
+
"text-color": [{
|
|
1572
|
+
text: scaleColor()
|
|
1573
|
+
}],
|
|
1574
|
+
/**
|
|
1575
|
+
* Text Decoration
|
|
1576
|
+
* @see https://tailwindcss.com/docs/text-decoration
|
|
1577
|
+
*/
|
|
1578
|
+
"text-decoration": ["underline", "overline", "line-through", "no-underline"],
|
|
1579
|
+
/**
|
|
1580
|
+
* Text Decoration Style
|
|
1581
|
+
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
1582
|
+
*/
|
|
1583
|
+
"text-decoration-style": [{
|
|
1584
|
+
decoration: [...scaleLineStyle(), "wavy"]
|
|
1585
|
+
}],
|
|
1586
|
+
/**
|
|
1587
|
+
* Text Decoration Thickness
|
|
1588
|
+
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
1589
|
+
*/
|
|
1590
|
+
"text-decoration-thickness": [{
|
|
1591
|
+
decoration: [isNumber, "from-font", "auto", isArbitraryVariable, isArbitraryLength]
|
|
1592
|
+
}],
|
|
1593
|
+
/**
|
|
1594
|
+
* Text Decoration Color
|
|
1595
|
+
* @see https://tailwindcss.com/docs/text-decoration-color
|
|
1596
|
+
*/
|
|
1597
|
+
"text-decoration-color": [{
|
|
1598
|
+
decoration: scaleColor()
|
|
1599
|
+
}],
|
|
1600
|
+
/**
|
|
1601
|
+
* Text Underline Offset
|
|
1602
|
+
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
1603
|
+
*/
|
|
1604
|
+
"underline-offset": [{
|
|
1605
|
+
"underline-offset": [isNumber, "auto", isArbitraryVariable, isArbitraryValue]
|
|
1606
|
+
}],
|
|
1607
|
+
/**
|
|
1608
|
+
* Text Transform
|
|
1609
|
+
* @see https://tailwindcss.com/docs/text-transform
|
|
1610
|
+
*/
|
|
1611
|
+
"text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
|
|
1612
|
+
/**
|
|
1613
|
+
* Text Overflow
|
|
1614
|
+
* @see https://tailwindcss.com/docs/text-overflow
|
|
1615
|
+
*/
|
|
1616
|
+
"text-overflow": ["truncate", "text-ellipsis", "text-clip"],
|
|
1617
|
+
/**
|
|
1618
|
+
* Text Wrap
|
|
1619
|
+
* @see https://tailwindcss.com/docs/text-wrap
|
|
1620
|
+
*/
|
|
1621
|
+
"text-wrap": [{
|
|
1622
|
+
text: ["wrap", "nowrap", "balance", "pretty"]
|
|
1623
|
+
}],
|
|
1624
|
+
/**
|
|
1625
|
+
* Text Indent
|
|
1626
|
+
* @see https://tailwindcss.com/docs/text-indent
|
|
1627
|
+
*/
|
|
1628
|
+
indent: [{
|
|
1629
|
+
indent: scaleUnambiguousSpacing()
|
|
1630
|
+
}],
|
|
1631
|
+
/**
|
|
1632
|
+
* Vertical Alignment
|
|
1633
|
+
* @see https://tailwindcss.com/docs/vertical-align
|
|
1634
|
+
*/
|
|
1635
|
+
"vertical-align": [{
|
|
1636
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryVariable, isArbitraryValue]
|
|
1637
|
+
}],
|
|
1638
|
+
/**
|
|
1639
|
+
* Whitespace
|
|
1640
|
+
* @see https://tailwindcss.com/docs/whitespace
|
|
1641
|
+
*/
|
|
1642
|
+
whitespace: [{
|
|
1643
|
+
whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
|
|
1644
|
+
}],
|
|
1645
|
+
/**
|
|
1646
|
+
* Word Break
|
|
1647
|
+
* @see https://tailwindcss.com/docs/word-break
|
|
1648
|
+
*/
|
|
1649
|
+
break: [{
|
|
1650
|
+
break: ["normal", "words", "all", "keep"]
|
|
1651
|
+
}],
|
|
1652
|
+
/**
|
|
1653
|
+
* Overflow Wrap
|
|
1654
|
+
* @see https://tailwindcss.com/docs/overflow-wrap
|
|
1655
|
+
*/
|
|
1656
|
+
wrap: [{
|
|
1657
|
+
wrap: ["break-word", "anywhere", "normal"]
|
|
1658
|
+
}],
|
|
1659
|
+
/**
|
|
1660
|
+
* Hyphens
|
|
1661
|
+
* @see https://tailwindcss.com/docs/hyphens
|
|
1662
|
+
*/
|
|
1663
|
+
hyphens: [{
|
|
1664
|
+
hyphens: ["none", "manual", "auto"]
|
|
1665
|
+
}],
|
|
1666
|
+
/**
|
|
1667
|
+
* Content
|
|
1668
|
+
* @see https://tailwindcss.com/docs/content
|
|
1669
|
+
*/
|
|
1670
|
+
content: [{
|
|
1671
|
+
content: ["none", isArbitraryVariable, isArbitraryValue]
|
|
1672
|
+
}],
|
|
1673
|
+
// -------------------
|
|
1674
|
+
// --- Backgrounds ---
|
|
1675
|
+
// -------------------
|
|
1676
|
+
/**
|
|
1677
|
+
* Background Attachment
|
|
1678
|
+
* @see https://tailwindcss.com/docs/background-attachment
|
|
1679
|
+
*/
|
|
1680
|
+
"bg-attachment": [{
|
|
1681
|
+
bg: ["fixed", "local", "scroll"]
|
|
1682
|
+
}],
|
|
1683
|
+
/**
|
|
1684
|
+
* Background Clip
|
|
1685
|
+
* @see https://tailwindcss.com/docs/background-clip
|
|
1686
|
+
*/
|
|
1687
|
+
"bg-clip": [{
|
|
1688
|
+
"bg-clip": ["border", "padding", "content", "text"]
|
|
1689
|
+
}],
|
|
1690
|
+
/**
|
|
1691
|
+
* Background Origin
|
|
1692
|
+
* @see https://tailwindcss.com/docs/background-origin
|
|
1693
|
+
*/
|
|
1694
|
+
"bg-origin": [{
|
|
1695
|
+
"bg-origin": ["border", "padding", "content"]
|
|
1696
|
+
}],
|
|
1697
|
+
/**
|
|
1698
|
+
* Background Position
|
|
1699
|
+
* @see https://tailwindcss.com/docs/background-position
|
|
1700
|
+
*/
|
|
1701
|
+
"bg-position": [{
|
|
1702
|
+
bg: scaleBgPosition()
|
|
1703
|
+
}],
|
|
1704
|
+
/**
|
|
1705
|
+
* Background Repeat
|
|
1706
|
+
* @see https://tailwindcss.com/docs/background-repeat
|
|
1707
|
+
*/
|
|
1708
|
+
"bg-repeat": [{
|
|
1709
|
+
bg: scaleBgRepeat()
|
|
1710
|
+
}],
|
|
1711
|
+
/**
|
|
1712
|
+
* Background Size
|
|
1713
|
+
* @see https://tailwindcss.com/docs/background-size
|
|
1714
|
+
*/
|
|
1715
|
+
"bg-size": [{
|
|
1716
|
+
bg: scaleBgSize()
|
|
1717
|
+
}],
|
|
1718
|
+
/**
|
|
1719
|
+
* Background Image
|
|
1720
|
+
* @see https://tailwindcss.com/docs/background-image
|
|
1721
|
+
*/
|
|
1722
|
+
"bg-image": [{
|
|
1723
|
+
bg: ["none", {
|
|
1724
|
+
linear: [{
|
|
1725
|
+
to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
1726
|
+
}, isInteger, isArbitraryVariable, isArbitraryValue],
|
|
1727
|
+
radial: ["", isArbitraryVariable, isArbitraryValue],
|
|
1728
|
+
conic: [isInteger, isArbitraryVariable, isArbitraryValue]
|
|
1729
|
+
}, isArbitraryVariableImage, isArbitraryImage]
|
|
1730
|
+
}],
|
|
1731
|
+
/**
|
|
1732
|
+
* Background Color
|
|
1733
|
+
* @see https://tailwindcss.com/docs/background-color
|
|
1734
|
+
*/
|
|
1735
|
+
"bg-color": [{
|
|
1736
|
+
bg: scaleColor()
|
|
1737
|
+
}],
|
|
1738
|
+
/**
|
|
1739
|
+
* Gradient Color Stops From Position
|
|
1740
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1741
|
+
*/
|
|
1742
|
+
"gradient-from-pos": [{
|
|
1743
|
+
from: scaleGradientStopPosition()
|
|
1744
|
+
}],
|
|
1745
|
+
/**
|
|
1746
|
+
* Gradient Color Stops Via Position
|
|
1747
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1748
|
+
*/
|
|
1749
|
+
"gradient-via-pos": [{
|
|
1750
|
+
via: scaleGradientStopPosition()
|
|
1751
|
+
}],
|
|
1752
|
+
/**
|
|
1753
|
+
* Gradient Color Stops To Position
|
|
1754
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1755
|
+
*/
|
|
1756
|
+
"gradient-to-pos": [{
|
|
1757
|
+
to: scaleGradientStopPosition()
|
|
1758
|
+
}],
|
|
1759
|
+
/**
|
|
1760
|
+
* Gradient Color Stops From
|
|
1761
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1762
|
+
*/
|
|
1763
|
+
"gradient-from": [{
|
|
1764
|
+
from: scaleColor()
|
|
1765
|
+
}],
|
|
1766
|
+
/**
|
|
1767
|
+
* Gradient Color Stops Via
|
|
1768
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1769
|
+
*/
|
|
1770
|
+
"gradient-via": [{
|
|
1771
|
+
via: scaleColor()
|
|
1772
|
+
}],
|
|
1773
|
+
/**
|
|
1774
|
+
* Gradient Color Stops To
|
|
1775
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1776
|
+
*/
|
|
1777
|
+
"gradient-to": [{
|
|
1778
|
+
to: scaleColor()
|
|
1779
|
+
}],
|
|
1780
|
+
// ---------------
|
|
1781
|
+
// --- Borders ---
|
|
1782
|
+
// ---------------
|
|
1783
|
+
/**
|
|
1784
|
+
* Border Radius
|
|
1785
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1786
|
+
*/
|
|
1787
|
+
rounded: [{
|
|
1788
|
+
rounded: scaleRadius()
|
|
1789
|
+
}],
|
|
1790
|
+
/**
|
|
1791
|
+
* Border Radius Start
|
|
1792
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1793
|
+
*/
|
|
1794
|
+
"rounded-s": [{
|
|
1795
|
+
"rounded-s": scaleRadius()
|
|
1796
|
+
}],
|
|
1797
|
+
/**
|
|
1798
|
+
* Border Radius End
|
|
1799
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1800
|
+
*/
|
|
1801
|
+
"rounded-e": [{
|
|
1802
|
+
"rounded-e": scaleRadius()
|
|
1803
|
+
}],
|
|
1804
|
+
/**
|
|
1805
|
+
* Border Radius Top
|
|
1806
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1807
|
+
*/
|
|
1808
|
+
"rounded-t": [{
|
|
1809
|
+
"rounded-t": scaleRadius()
|
|
1810
|
+
}],
|
|
1811
|
+
/**
|
|
1812
|
+
* Border Radius Right
|
|
1813
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1814
|
+
*/
|
|
1815
|
+
"rounded-r": [{
|
|
1816
|
+
"rounded-r": scaleRadius()
|
|
1817
|
+
}],
|
|
1818
|
+
/**
|
|
1819
|
+
* Border Radius Bottom
|
|
1820
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1821
|
+
*/
|
|
1822
|
+
"rounded-b": [{
|
|
1823
|
+
"rounded-b": scaleRadius()
|
|
1824
|
+
}],
|
|
1825
|
+
/**
|
|
1826
|
+
* Border Radius Left
|
|
1827
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1828
|
+
*/
|
|
1829
|
+
"rounded-l": [{
|
|
1830
|
+
"rounded-l": scaleRadius()
|
|
1831
|
+
}],
|
|
1832
|
+
/**
|
|
1833
|
+
* Border Radius Start Start
|
|
1834
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1835
|
+
*/
|
|
1836
|
+
"rounded-ss": [{
|
|
1837
|
+
"rounded-ss": scaleRadius()
|
|
1838
|
+
}],
|
|
1839
|
+
/**
|
|
1840
|
+
* Border Radius Start End
|
|
1841
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1842
|
+
*/
|
|
1843
|
+
"rounded-se": [{
|
|
1844
|
+
"rounded-se": scaleRadius()
|
|
1845
|
+
}],
|
|
1846
|
+
/**
|
|
1847
|
+
* Border Radius End End
|
|
1848
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1849
|
+
*/
|
|
1850
|
+
"rounded-ee": [{
|
|
1851
|
+
"rounded-ee": scaleRadius()
|
|
1852
|
+
}],
|
|
1853
|
+
/**
|
|
1854
|
+
* Border Radius End Start
|
|
1855
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1856
|
+
*/
|
|
1857
|
+
"rounded-es": [{
|
|
1858
|
+
"rounded-es": scaleRadius()
|
|
1859
|
+
}],
|
|
1860
|
+
/**
|
|
1861
|
+
* Border Radius Top Left
|
|
1862
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1863
|
+
*/
|
|
1864
|
+
"rounded-tl": [{
|
|
1865
|
+
"rounded-tl": scaleRadius()
|
|
1866
|
+
}],
|
|
1867
|
+
/**
|
|
1868
|
+
* Border Radius Top Right
|
|
1869
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1870
|
+
*/
|
|
1871
|
+
"rounded-tr": [{
|
|
1872
|
+
"rounded-tr": scaleRadius()
|
|
1873
|
+
}],
|
|
1874
|
+
/**
|
|
1875
|
+
* Border Radius Bottom Right
|
|
1876
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1877
|
+
*/
|
|
1878
|
+
"rounded-br": [{
|
|
1879
|
+
"rounded-br": scaleRadius()
|
|
1880
|
+
}],
|
|
1881
|
+
/**
|
|
1882
|
+
* Border Radius Bottom Left
|
|
1883
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1884
|
+
*/
|
|
1885
|
+
"rounded-bl": [{
|
|
1886
|
+
"rounded-bl": scaleRadius()
|
|
1887
|
+
}],
|
|
1888
|
+
/**
|
|
1889
|
+
* Border Width
|
|
1890
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1891
|
+
*/
|
|
1892
|
+
"border-w": [{
|
|
1893
|
+
border: scaleBorderWidth()
|
|
1894
|
+
}],
|
|
1895
|
+
/**
|
|
1896
|
+
* Border Width Inline
|
|
1897
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1898
|
+
*/
|
|
1899
|
+
"border-w-x": [{
|
|
1900
|
+
"border-x": scaleBorderWidth()
|
|
1901
|
+
}],
|
|
1902
|
+
/**
|
|
1903
|
+
* Border Width Block
|
|
1904
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1905
|
+
*/
|
|
1906
|
+
"border-w-y": [{
|
|
1907
|
+
"border-y": scaleBorderWidth()
|
|
1908
|
+
}],
|
|
1909
|
+
/**
|
|
1910
|
+
* Border Width Inline Start
|
|
1911
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1912
|
+
*/
|
|
1913
|
+
"border-w-s": [{
|
|
1914
|
+
"border-s": scaleBorderWidth()
|
|
1915
|
+
}],
|
|
1916
|
+
/**
|
|
1917
|
+
* Border Width Inline End
|
|
1918
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1919
|
+
*/
|
|
1920
|
+
"border-w-e": [{
|
|
1921
|
+
"border-e": scaleBorderWidth()
|
|
1922
|
+
}],
|
|
1923
|
+
/**
|
|
1924
|
+
* Border Width Block Start
|
|
1925
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1926
|
+
*/
|
|
1927
|
+
"border-w-bs": [{
|
|
1928
|
+
"border-bs": scaleBorderWidth()
|
|
1929
|
+
}],
|
|
1930
|
+
/**
|
|
1931
|
+
* Border Width Block End
|
|
1932
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1933
|
+
*/
|
|
1934
|
+
"border-w-be": [{
|
|
1935
|
+
"border-be": scaleBorderWidth()
|
|
1936
|
+
}],
|
|
1937
|
+
/**
|
|
1938
|
+
* Border Width Top
|
|
1939
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1940
|
+
*/
|
|
1941
|
+
"border-w-t": [{
|
|
1942
|
+
"border-t": scaleBorderWidth()
|
|
1943
|
+
}],
|
|
1944
|
+
/**
|
|
1945
|
+
* Border Width Right
|
|
1946
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1947
|
+
*/
|
|
1948
|
+
"border-w-r": [{
|
|
1949
|
+
"border-r": scaleBorderWidth()
|
|
1950
|
+
}],
|
|
1951
|
+
/**
|
|
1952
|
+
* Border Width Bottom
|
|
1953
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1954
|
+
*/
|
|
1955
|
+
"border-w-b": [{
|
|
1956
|
+
"border-b": scaleBorderWidth()
|
|
1957
|
+
}],
|
|
1958
|
+
/**
|
|
1959
|
+
* Border Width Left
|
|
1960
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1961
|
+
*/
|
|
1962
|
+
"border-w-l": [{
|
|
1963
|
+
"border-l": scaleBorderWidth()
|
|
1964
|
+
}],
|
|
1965
|
+
/**
|
|
1966
|
+
* Divide Width X
|
|
1967
|
+
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1968
|
+
*/
|
|
1969
|
+
"divide-x": [{
|
|
1970
|
+
"divide-x": scaleBorderWidth()
|
|
1971
|
+
}],
|
|
1972
|
+
/**
|
|
1973
|
+
* Divide Width X Reverse
|
|
1974
|
+
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1975
|
+
*/
|
|
1976
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
1977
|
+
/**
|
|
1978
|
+
* Divide Width Y
|
|
1979
|
+
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1980
|
+
*/
|
|
1981
|
+
"divide-y": [{
|
|
1982
|
+
"divide-y": scaleBorderWidth()
|
|
1983
|
+
}],
|
|
1984
|
+
/**
|
|
1985
|
+
* Divide Width Y Reverse
|
|
1986
|
+
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1987
|
+
*/
|
|
1988
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
1989
|
+
/**
|
|
1990
|
+
* Border Style
|
|
1991
|
+
* @see https://tailwindcss.com/docs/border-style
|
|
1992
|
+
*/
|
|
1993
|
+
"border-style": [{
|
|
1994
|
+
border: [...scaleLineStyle(), "hidden", "none"]
|
|
1995
|
+
}],
|
|
1996
|
+
/**
|
|
1997
|
+
* Divide Style
|
|
1998
|
+
* @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
|
|
1999
|
+
*/
|
|
2000
|
+
"divide-style": [{
|
|
2001
|
+
divide: [...scaleLineStyle(), "hidden", "none"]
|
|
2002
|
+
}],
|
|
2003
|
+
/**
|
|
2004
|
+
* Border Color
|
|
2005
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2006
|
+
*/
|
|
2007
|
+
"border-color": [{
|
|
2008
|
+
border: scaleColor()
|
|
2009
|
+
}],
|
|
2010
|
+
/**
|
|
2011
|
+
* Border Color Inline
|
|
2012
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2013
|
+
*/
|
|
2014
|
+
"border-color-x": [{
|
|
2015
|
+
"border-x": scaleColor()
|
|
2016
|
+
}],
|
|
2017
|
+
/**
|
|
2018
|
+
* Border Color Block
|
|
2019
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2020
|
+
*/
|
|
2021
|
+
"border-color-y": [{
|
|
2022
|
+
"border-y": scaleColor()
|
|
2023
|
+
}],
|
|
2024
|
+
/**
|
|
2025
|
+
* Border Color Inline Start
|
|
2026
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2027
|
+
*/
|
|
2028
|
+
"border-color-s": [{
|
|
2029
|
+
"border-s": scaleColor()
|
|
2030
|
+
}],
|
|
2031
|
+
/**
|
|
2032
|
+
* Border Color Inline End
|
|
2033
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2034
|
+
*/
|
|
2035
|
+
"border-color-e": [{
|
|
2036
|
+
"border-e": scaleColor()
|
|
2037
|
+
}],
|
|
2038
|
+
/**
|
|
2039
|
+
* Border Color Block Start
|
|
2040
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2041
|
+
*/
|
|
2042
|
+
"border-color-bs": [{
|
|
2043
|
+
"border-bs": scaleColor()
|
|
2044
|
+
}],
|
|
2045
|
+
/**
|
|
2046
|
+
* Border Color Block End
|
|
2047
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2048
|
+
*/
|
|
2049
|
+
"border-color-be": [{
|
|
2050
|
+
"border-be": scaleColor()
|
|
2051
|
+
}],
|
|
2052
|
+
/**
|
|
2053
|
+
* Border Color Top
|
|
2054
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2055
|
+
*/
|
|
2056
|
+
"border-color-t": [{
|
|
2057
|
+
"border-t": scaleColor()
|
|
2058
|
+
}],
|
|
2059
|
+
/**
|
|
2060
|
+
* Border Color Right
|
|
2061
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2062
|
+
*/
|
|
2063
|
+
"border-color-r": [{
|
|
2064
|
+
"border-r": scaleColor()
|
|
2065
|
+
}],
|
|
2066
|
+
/**
|
|
2067
|
+
* Border Color Bottom
|
|
2068
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2069
|
+
*/
|
|
2070
|
+
"border-color-b": [{
|
|
2071
|
+
"border-b": scaleColor()
|
|
2072
|
+
}],
|
|
2073
|
+
/**
|
|
2074
|
+
* Border Color Left
|
|
2075
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2076
|
+
*/
|
|
2077
|
+
"border-color-l": [{
|
|
2078
|
+
"border-l": scaleColor()
|
|
2079
|
+
}],
|
|
2080
|
+
/**
|
|
2081
|
+
* Divide Color
|
|
2082
|
+
* @see https://tailwindcss.com/docs/divide-color
|
|
2083
|
+
*/
|
|
2084
|
+
"divide-color": [{
|
|
2085
|
+
divide: scaleColor()
|
|
2086
|
+
}],
|
|
2087
|
+
/**
|
|
2088
|
+
* Outline Style
|
|
2089
|
+
* @see https://tailwindcss.com/docs/outline-style
|
|
2090
|
+
*/
|
|
2091
|
+
"outline-style": [{
|
|
2092
|
+
outline: [...scaleLineStyle(), "none", "hidden"]
|
|
2093
|
+
}],
|
|
2094
|
+
/**
|
|
2095
|
+
* Outline Offset
|
|
2096
|
+
* @see https://tailwindcss.com/docs/outline-offset
|
|
2097
|
+
*/
|
|
2098
|
+
"outline-offset": [{
|
|
2099
|
+
"outline-offset": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2100
|
+
}],
|
|
2101
|
+
/**
|
|
2102
|
+
* Outline Width
|
|
2103
|
+
* @see https://tailwindcss.com/docs/outline-width
|
|
2104
|
+
*/
|
|
2105
|
+
"outline-w": [{
|
|
2106
|
+
outline: ["", isNumber, isArbitraryVariableLength, isArbitraryLength]
|
|
2107
|
+
}],
|
|
2108
|
+
/**
|
|
2109
|
+
* Outline Color
|
|
2110
|
+
* @see https://tailwindcss.com/docs/outline-color
|
|
2111
|
+
*/
|
|
2112
|
+
"outline-color": [{
|
|
2113
|
+
outline: scaleColor()
|
|
2114
|
+
}],
|
|
2115
|
+
// ---------------
|
|
2116
|
+
// --- Effects ---
|
|
2117
|
+
// ---------------
|
|
2118
|
+
/**
|
|
2119
|
+
* Box Shadow
|
|
2120
|
+
* @see https://tailwindcss.com/docs/box-shadow
|
|
2121
|
+
*/
|
|
2122
|
+
shadow: [{
|
|
2123
|
+
shadow: [
|
|
2124
|
+
// Deprecated since Tailwind CSS v4.0.0
|
|
2125
|
+
"",
|
|
2126
|
+
"none",
|
|
2127
|
+
themeShadow,
|
|
2128
|
+
isArbitraryVariableShadow,
|
|
2129
|
+
isArbitraryShadow
|
|
2130
|
+
]
|
|
2131
|
+
}],
|
|
2132
|
+
/**
|
|
2133
|
+
* Box Shadow Color
|
|
2134
|
+
* @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
|
|
2135
|
+
*/
|
|
2136
|
+
"shadow-color": [{
|
|
2137
|
+
shadow: scaleColor()
|
|
2138
|
+
}],
|
|
2139
|
+
/**
|
|
2140
|
+
* Inset Box Shadow
|
|
2141
|
+
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
|
|
2142
|
+
*/
|
|
2143
|
+
"inset-shadow": [{
|
|
2144
|
+
"inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
|
|
2145
|
+
}],
|
|
2146
|
+
/**
|
|
2147
|
+
* Inset Box Shadow Color
|
|
2148
|
+
* @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
|
|
2149
|
+
*/
|
|
2150
|
+
"inset-shadow-color": [{
|
|
2151
|
+
"inset-shadow": scaleColor()
|
|
2152
|
+
}],
|
|
2153
|
+
/**
|
|
2154
|
+
* Ring Width
|
|
2155
|
+
* @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
|
|
2156
|
+
*/
|
|
2157
|
+
"ring-w": [{
|
|
2158
|
+
ring: scaleBorderWidth()
|
|
2159
|
+
}],
|
|
2160
|
+
/**
|
|
2161
|
+
* Ring Width Inset
|
|
2162
|
+
* @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
|
|
2163
|
+
* @deprecated since Tailwind CSS v4.0.0
|
|
2164
|
+
* @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
|
|
2165
|
+
*/
|
|
2166
|
+
"ring-w-inset": ["ring-inset"],
|
|
2167
|
+
/**
|
|
2168
|
+
* Ring Color
|
|
2169
|
+
* @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
|
|
2170
|
+
*/
|
|
2171
|
+
"ring-color": [{
|
|
2172
|
+
ring: scaleColor()
|
|
2173
|
+
}],
|
|
2174
|
+
/**
|
|
2175
|
+
* Ring Offset Width
|
|
2176
|
+
* @see https://v3.tailwindcss.com/docs/ring-offset-width
|
|
2177
|
+
* @deprecated since Tailwind CSS v4.0.0
|
|
2178
|
+
* @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
|
|
2179
|
+
*/
|
|
2180
|
+
"ring-offset-w": [{
|
|
2181
|
+
"ring-offset": [isNumber, isArbitraryLength]
|
|
2182
|
+
}],
|
|
2183
|
+
/**
|
|
2184
|
+
* Ring Offset Color
|
|
2185
|
+
* @see https://v3.tailwindcss.com/docs/ring-offset-color
|
|
2186
|
+
* @deprecated since Tailwind CSS v4.0.0
|
|
2187
|
+
* @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
|
|
2188
|
+
*/
|
|
2189
|
+
"ring-offset-color": [{
|
|
2190
|
+
"ring-offset": scaleColor()
|
|
2191
|
+
}],
|
|
2192
|
+
/**
|
|
2193
|
+
* Inset Ring Width
|
|
2194
|
+
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
|
|
2195
|
+
*/
|
|
2196
|
+
"inset-ring-w": [{
|
|
2197
|
+
"inset-ring": scaleBorderWidth()
|
|
2198
|
+
}],
|
|
2199
|
+
/**
|
|
2200
|
+
* Inset Ring Color
|
|
2201
|
+
* @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
|
|
2202
|
+
*/
|
|
2203
|
+
"inset-ring-color": [{
|
|
2204
|
+
"inset-ring": scaleColor()
|
|
2205
|
+
}],
|
|
2206
|
+
/**
|
|
2207
|
+
* Text Shadow
|
|
2208
|
+
* @see https://tailwindcss.com/docs/text-shadow
|
|
2209
|
+
*/
|
|
2210
|
+
"text-shadow": [{
|
|
2211
|
+
"text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
|
|
2212
|
+
}],
|
|
2213
|
+
/**
|
|
2214
|
+
* Text Shadow Color
|
|
2215
|
+
* @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
|
|
2216
|
+
*/
|
|
2217
|
+
"text-shadow-color": [{
|
|
2218
|
+
"text-shadow": scaleColor()
|
|
2219
|
+
}],
|
|
2220
|
+
/**
|
|
2221
|
+
* Opacity
|
|
2222
|
+
* @see https://tailwindcss.com/docs/opacity
|
|
2223
|
+
*/
|
|
2224
|
+
opacity: [{
|
|
2225
|
+
opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2226
|
+
}],
|
|
2227
|
+
/**
|
|
2228
|
+
* Mix Blend Mode
|
|
2229
|
+
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
2230
|
+
*/
|
|
2231
|
+
"mix-blend": [{
|
|
2232
|
+
"mix-blend": [...scaleBlendMode(), "plus-darker", "plus-lighter"]
|
|
2233
|
+
}],
|
|
2234
|
+
/**
|
|
2235
|
+
* Background Blend Mode
|
|
2236
|
+
* @see https://tailwindcss.com/docs/background-blend-mode
|
|
2237
|
+
*/
|
|
2238
|
+
"bg-blend": [{
|
|
2239
|
+
"bg-blend": scaleBlendMode()
|
|
2240
|
+
}],
|
|
2241
|
+
/**
|
|
2242
|
+
* Mask Clip
|
|
2243
|
+
* @see https://tailwindcss.com/docs/mask-clip
|
|
2244
|
+
*/
|
|
2245
|
+
"mask-clip": [{
|
|
2246
|
+
"mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
|
|
2247
|
+
}, "mask-no-clip"],
|
|
2248
|
+
/**
|
|
2249
|
+
* Mask Composite
|
|
2250
|
+
* @see https://tailwindcss.com/docs/mask-composite
|
|
2251
|
+
*/
|
|
2252
|
+
"mask-composite": [{
|
|
2253
|
+
mask: ["add", "subtract", "intersect", "exclude"]
|
|
2254
|
+
}],
|
|
2255
|
+
/**
|
|
2256
|
+
* Mask Image
|
|
2257
|
+
* @see https://tailwindcss.com/docs/mask-image
|
|
2258
|
+
*/
|
|
2259
|
+
"mask-image-linear-pos": [{
|
|
2260
|
+
"mask-linear": [isNumber]
|
|
2261
|
+
}],
|
|
2262
|
+
"mask-image-linear-from-pos": [{
|
|
2263
|
+
"mask-linear-from": scaleMaskImagePosition()
|
|
2264
|
+
}],
|
|
2265
|
+
"mask-image-linear-to-pos": [{
|
|
2266
|
+
"mask-linear-to": scaleMaskImagePosition()
|
|
2267
|
+
}],
|
|
2268
|
+
"mask-image-linear-from-color": [{
|
|
2269
|
+
"mask-linear-from": scaleColor()
|
|
2270
|
+
}],
|
|
2271
|
+
"mask-image-linear-to-color": [{
|
|
2272
|
+
"mask-linear-to": scaleColor()
|
|
2273
|
+
}],
|
|
2274
|
+
"mask-image-t-from-pos": [{
|
|
2275
|
+
"mask-t-from": scaleMaskImagePosition()
|
|
2276
|
+
}],
|
|
2277
|
+
"mask-image-t-to-pos": [{
|
|
2278
|
+
"mask-t-to": scaleMaskImagePosition()
|
|
2279
|
+
}],
|
|
2280
|
+
"mask-image-t-from-color": [{
|
|
2281
|
+
"mask-t-from": scaleColor()
|
|
2282
|
+
}],
|
|
2283
|
+
"mask-image-t-to-color": [{
|
|
2284
|
+
"mask-t-to": scaleColor()
|
|
2285
|
+
}],
|
|
2286
|
+
"mask-image-r-from-pos": [{
|
|
2287
|
+
"mask-r-from": scaleMaskImagePosition()
|
|
2288
|
+
}],
|
|
2289
|
+
"mask-image-r-to-pos": [{
|
|
2290
|
+
"mask-r-to": scaleMaskImagePosition()
|
|
2291
|
+
}],
|
|
2292
|
+
"mask-image-r-from-color": [{
|
|
2293
|
+
"mask-r-from": scaleColor()
|
|
2294
|
+
}],
|
|
2295
|
+
"mask-image-r-to-color": [{
|
|
2296
|
+
"mask-r-to": scaleColor()
|
|
2297
|
+
}],
|
|
2298
|
+
"mask-image-b-from-pos": [{
|
|
2299
|
+
"mask-b-from": scaleMaskImagePosition()
|
|
2300
|
+
}],
|
|
2301
|
+
"mask-image-b-to-pos": [{
|
|
2302
|
+
"mask-b-to": scaleMaskImagePosition()
|
|
2303
|
+
}],
|
|
2304
|
+
"mask-image-b-from-color": [{
|
|
2305
|
+
"mask-b-from": scaleColor()
|
|
2306
|
+
}],
|
|
2307
|
+
"mask-image-b-to-color": [{
|
|
2308
|
+
"mask-b-to": scaleColor()
|
|
2309
|
+
}],
|
|
2310
|
+
"mask-image-l-from-pos": [{
|
|
2311
|
+
"mask-l-from": scaleMaskImagePosition()
|
|
2312
|
+
}],
|
|
2313
|
+
"mask-image-l-to-pos": [{
|
|
2314
|
+
"mask-l-to": scaleMaskImagePosition()
|
|
2315
|
+
}],
|
|
2316
|
+
"mask-image-l-from-color": [{
|
|
2317
|
+
"mask-l-from": scaleColor()
|
|
2318
|
+
}],
|
|
2319
|
+
"mask-image-l-to-color": [{
|
|
2320
|
+
"mask-l-to": scaleColor()
|
|
2321
|
+
}],
|
|
2322
|
+
"mask-image-x-from-pos": [{
|
|
2323
|
+
"mask-x-from": scaleMaskImagePosition()
|
|
2324
|
+
}],
|
|
2325
|
+
"mask-image-x-to-pos": [{
|
|
2326
|
+
"mask-x-to": scaleMaskImagePosition()
|
|
2327
|
+
}],
|
|
2328
|
+
"mask-image-x-from-color": [{
|
|
2329
|
+
"mask-x-from": scaleColor()
|
|
2330
|
+
}],
|
|
2331
|
+
"mask-image-x-to-color": [{
|
|
2332
|
+
"mask-x-to": scaleColor()
|
|
2333
|
+
}],
|
|
2334
|
+
"mask-image-y-from-pos": [{
|
|
2335
|
+
"mask-y-from": scaleMaskImagePosition()
|
|
2336
|
+
}],
|
|
2337
|
+
"mask-image-y-to-pos": [{
|
|
2338
|
+
"mask-y-to": scaleMaskImagePosition()
|
|
2339
|
+
}],
|
|
2340
|
+
"mask-image-y-from-color": [{
|
|
2341
|
+
"mask-y-from": scaleColor()
|
|
2342
|
+
}],
|
|
2343
|
+
"mask-image-y-to-color": [{
|
|
2344
|
+
"mask-y-to": scaleColor()
|
|
2345
|
+
}],
|
|
2346
|
+
"mask-image-radial": [{
|
|
2347
|
+
"mask-radial": [isArbitraryVariable, isArbitraryValue]
|
|
2348
|
+
}],
|
|
2349
|
+
"mask-image-radial-from-pos": [{
|
|
2350
|
+
"mask-radial-from": scaleMaskImagePosition()
|
|
2351
|
+
}],
|
|
2352
|
+
"mask-image-radial-to-pos": [{
|
|
2353
|
+
"mask-radial-to": scaleMaskImagePosition()
|
|
2354
|
+
}],
|
|
2355
|
+
"mask-image-radial-from-color": [{
|
|
2356
|
+
"mask-radial-from": scaleColor()
|
|
2357
|
+
}],
|
|
2358
|
+
"mask-image-radial-to-color": [{
|
|
2359
|
+
"mask-radial-to": scaleColor()
|
|
2360
|
+
}],
|
|
2361
|
+
"mask-image-radial-shape": [{
|
|
2362
|
+
"mask-radial": ["circle", "ellipse"]
|
|
2363
|
+
}],
|
|
2364
|
+
"mask-image-radial-size": [{
|
|
2365
|
+
"mask-radial": [{
|
|
2366
|
+
closest: ["side", "corner"],
|
|
2367
|
+
farthest: ["side", "corner"]
|
|
2368
|
+
}]
|
|
2369
|
+
}],
|
|
2370
|
+
"mask-image-radial-pos": [{
|
|
2371
|
+
"mask-radial-at": scalePosition()
|
|
2372
|
+
}],
|
|
2373
|
+
"mask-image-conic-pos": [{
|
|
2374
|
+
"mask-conic": [isNumber]
|
|
2375
|
+
}],
|
|
2376
|
+
"mask-image-conic-from-pos": [{
|
|
2377
|
+
"mask-conic-from": scaleMaskImagePosition()
|
|
2378
|
+
}],
|
|
2379
|
+
"mask-image-conic-to-pos": [{
|
|
2380
|
+
"mask-conic-to": scaleMaskImagePosition()
|
|
2381
|
+
}],
|
|
2382
|
+
"mask-image-conic-from-color": [{
|
|
2383
|
+
"mask-conic-from": scaleColor()
|
|
2384
|
+
}],
|
|
2385
|
+
"mask-image-conic-to-color": [{
|
|
2386
|
+
"mask-conic-to": scaleColor()
|
|
2387
|
+
}],
|
|
2388
|
+
/**
|
|
2389
|
+
* Mask Mode
|
|
2390
|
+
* @see https://tailwindcss.com/docs/mask-mode
|
|
2391
|
+
*/
|
|
2392
|
+
"mask-mode": [{
|
|
2393
|
+
mask: ["alpha", "luminance", "match"]
|
|
2394
|
+
}],
|
|
2395
|
+
/**
|
|
2396
|
+
* Mask Origin
|
|
2397
|
+
* @see https://tailwindcss.com/docs/mask-origin
|
|
2398
|
+
*/
|
|
2399
|
+
"mask-origin": [{
|
|
2400
|
+
"mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
|
|
2401
|
+
}],
|
|
2402
|
+
/**
|
|
2403
|
+
* Mask Position
|
|
2404
|
+
* @see https://tailwindcss.com/docs/mask-position
|
|
2405
|
+
*/
|
|
2406
|
+
"mask-position": [{
|
|
2407
|
+
mask: scaleBgPosition()
|
|
2408
|
+
}],
|
|
2409
|
+
/**
|
|
2410
|
+
* Mask Repeat
|
|
2411
|
+
* @see https://tailwindcss.com/docs/mask-repeat
|
|
2412
|
+
*/
|
|
2413
|
+
"mask-repeat": [{
|
|
2414
|
+
mask: scaleBgRepeat()
|
|
2415
|
+
}],
|
|
2416
|
+
/**
|
|
2417
|
+
* Mask Size
|
|
2418
|
+
* @see https://tailwindcss.com/docs/mask-size
|
|
2419
|
+
*/
|
|
2420
|
+
"mask-size": [{
|
|
2421
|
+
mask: scaleBgSize()
|
|
2422
|
+
}],
|
|
2423
|
+
/**
|
|
2424
|
+
* Mask Type
|
|
2425
|
+
* @see https://tailwindcss.com/docs/mask-type
|
|
2426
|
+
*/
|
|
2427
|
+
"mask-type": [{
|
|
2428
|
+
"mask-type": ["alpha", "luminance"]
|
|
2429
|
+
}],
|
|
2430
|
+
/**
|
|
2431
|
+
* Mask Image
|
|
2432
|
+
* @see https://tailwindcss.com/docs/mask-image
|
|
2433
|
+
*/
|
|
2434
|
+
"mask-image": [{
|
|
2435
|
+
mask: ["none", isArbitraryVariable, isArbitraryValue]
|
|
2436
|
+
}],
|
|
2437
|
+
// ---------------
|
|
2438
|
+
// --- Filters ---
|
|
2439
|
+
// ---------------
|
|
2440
|
+
/**
|
|
2441
|
+
* Filter
|
|
2442
|
+
* @see https://tailwindcss.com/docs/filter
|
|
2443
|
+
*/
|
|
2444
|
+
filter: [{
|
|
2445
|
+
filter: [
|
|
2446
|
+
// Deprecated since Tailwind CSS v3.0.0
|
|
2447
|
+
"",
|
|
2448
|
+
"none",
|
|
2449
|
+
isArbitraryVariable,
|
|
2450
|
+
isArbitraryValue
|
|
2451
|
+
]
|
|
2452
|
+
}],
|
|
2453
|
+
/**
|
|
2454
|
+
* Blur
|
|
2455
|
+
* @see https://tailwindcss.com/docs/blur
|
|
2456
|
+
*/
|
|
2457
|
+
blur: [{
|
|
2458
|
+
blur: scaleBlur()
|
|
2459
|
+
}],
|
|
2460
|
+
/**
|
|
2461
|
+
* Brightness
|
|
2462
|
+
* @see https://tailwindcss.com/docs/brightness
|
|
2463
|
+
*/
|
|
2464
|
+
brightness: [{
|
|
2465
|
+
brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2466
|
+
}],
|
|
2467
|
+
/**
|
|
2468
|
+
* Contrast
|
|
2469
|
+
* @see https://tailwindcss.com/docs/contrast
|
|
2470
|
+
*/
|
|
2471
|
+
contrast: [{
|
|
2472
|
+
contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2473
|
+
}],
|
|
2474
|
+
/**
|
|
2475
|
+
* Drop Shadow
|
|
2476
|
+
* @see https://tailwindcss.com/docs/drop-shadow
|
|
2477
|
+
*/
|
|
2478
|
+
"drop-shadow": [{
|
|
2479
|
+
"drop-shadow": [
|
|
2480
|
+
// Deprecated since Tailwind CSS v4.0.0
|
|
2481
|
+
"",
|
|
2482
|
+
"none",
|
|
2483
|
+
themeDropShadow,
|
|
2484
|
+
isArbitraryVariableShadow,
|
|
2485
|
+
isArbitraryShadow
|
|
2486
|
+
]
|
|
2487
|
+
}],
|
|
2488
|
+
/**
|
|
2489
|
+
* Drop Shadow Color
|
|
2490
|
+
* @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
|
|
2491
|
+
*/
|
|
2492
|
+
"drop-shadow-color": [{
|
|
2493
|
+
"drop-shadow": scaleColor()
|
|
2494
|
+
}],
|
|
2495
|
+
/**
|
|
2496
|
+
* Grayscale
|
|
2497
|
+
* @see https://tailwindcss.com/docs/grayscale
|
|
2498
|
+
*/
|
|
2499
|
+
grayscale: [{
|
|
2500
|
+
grayscale: ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2501
|
+
}],
|
|
2502
|
+
/**
|
|
2503
|
+
* Hue Rotate
|
|
2504
|
+
* @see https://tailwindcss.com/docs/hue-rotate
|
|
2505
|
+
*/
|
|
2506
|
+
"hue-rotate": [{
|
|
2507
|
+
"hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2508
|
+
}],
|
|
2509
|
+
/**
|
|
2510
|
+
* Invert
|
|
2511
|
+
* @see https://tailwindcss.com/docs/invert
|
|
2512
|
+
*/
|
|
2513
|
+
invert: [{
|
|
2514
|
+
invert: ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2515
|
+
}],
|
|
2516
|
+
/**
|
|
2517
|
+
* Saturate
|
|
2518
|
+
* @see https://tailwindcss.com/docs/saturate
|
|
2519
|
+
*/
|
|
2520
|
+
saturate: [{
|
|
2521
|
+
saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2522
|
+
}],
|
|
2523
|
+
/**
|
|
2524
|
+
* Sepia
|
|
2525
|
+
* @see https://tailwindcss.com/docs/sepia
|
|
2526
|
+
*/
|
|
2527
|
+
sepia: [{
|
|
2528
|
+
sepia: ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2529
|
+
}],
|
|
2530
|
+
/**
|
|
2531
|
+
* Backdrop Filter
|
|
2532
|
+
* @see https://tailwindcss.com/docs/backdrop-filter
|
|
2533
|
+
*/
|
|
2534
|
+
"backdrop-filter": [{
|
|
2535
|
+
"backdrop-filter": [
|
|
2536
|
+
// Deprecated since Tailwind CSS v3.0.0
|
|
2537
|
+
"",
|
|
2538
|
+
"none",
|
|
2539
|
+
isArbitraryVariable,
|
|
2540
|
+
isArbitraryValue
|
|
2541
|
+
]
|
|
2542
|
+
}],
|
|
2543
|
+
/**
|
|
2544
|
+
* Backdrop Blur
|
|
2545
|
+
* @see https://tailwindcss.com/docs/backdrop-blur
|
|
2546
|
+
*/
|
|
2547
|
+
"backdrop-blur": [{
|
|
2548
|
+
"backdrop-blur": scaleBlur()
|
|
2549
|
+
}],
|
|
2550
|
+
/**
|
|
2551
|
+
* Backdrop Brightness
|
|
2552
|
+
* @see https://tailwindcss.com/docs/backdrop-brightness
|
|
2553
|
+
*/
|
|
2554
|
+
"backdrop-brightness": [{
|
|
2555
|
+
"backdrop-brightness": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2556
|
+
}],
|
|
2557
|
+
/**
|
|
2558
|
+
* Backdrop Contrast
|
|
2559
|
+
* @see https://tailwindcss.com/docs/backdrop-contrast
|
|
2560
|
+
*/
|
|
2561
|
+
"backdrop-contrast": [{
|
|
2562
|
+
"backdrop-contrast": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2563
|
+
}],
|
|
2564
|
+
/**
|
|
2565
|
+
* Backdrop Grayscale
|
|
2566
|
+
* @see https://tailwindcss.com/docs/backdrop-grayscale
|
|
2567
|
+
*/
|
|
2568
|
+
"backdrop-grayscale": [{
|
|
2569
|
+
"backdrop-grayscale": ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2570
|
+
}],
|
|
2571
|
+
/**
|
|
2572
|
+
* Backdrop Hue Rotate
|
|
2573
|
+
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
2574
|
+
*/
|
|
2575
|
+
"backdrop-hue-rotate": [{
|
|
2576
|
+
"backdrop-hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2577
|
+
}],
|
|
2578
|
+
/**
|
|
2579
|
+
* Backdrop Invert
|
|
2580
|
+
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
2581
|
+
*/
|
|
2582
|
+
"backdrop-invert": [{
|
|
2583
|
+
"backdrop-invert": ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2584
|
+
}],
|
|
2585
|
+
/**
|
|
2586
|
+
* Backdrop Opacity
|
|
2587
|
+
* @see https://tailwindcss.com/docs/backdrop-opacity
|
|
2588
|
+
*/
|
|
2589
|
+
"backdrop-opacity": [{
|
|
2590
|
+
"backdrop-opacity": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2591
|
+
}],
|
|
2592
|
+
/**
|
|
2593
|
+
* Backdrop Saturate
|
|
2594
|
+
* @see https://tailwindcss.com/docs/backdrop-saturate
|
|
2595
|
+
*/
|
|
2596
|
+
"backdrop-saturate": [{
|
|
2597
|
+
"backdrop-saturate": [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2598
|
+
}],
|
|
2599
|
+
/**
|
|
2600
|
+
* Backdrop Sepia
|
|
2601
|
+
* @see https://tailwindcss.com/docs/backdrop-sepia
|
|
2602
|
+
*/
|
|
2603
|
+
"backdrop-sepia": [{
|
|
2604
|
+
"backdrop-sepia": ["", isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2605
|
+
}],
|
|
2606
|
+
// --------------
|
|
2607
|
+
// --- Tables ---
|
|
2608
|
+
// --------------
|
|
2609
|
+
/**
|
|
2610
|
+
* Border Collapse
|
|
2611
|
+
* @see https://tailwindcss.com/docs/border-collapse
|
|
2612
|
+
*/
|
|
2613
|
+
"border-collapse": [{
|
|
2614
|
+
border: ["collapse", "separate"]
|
|
2615
|
+
}],
|
|
2616
|
+
/**
|
|
2617
|
+
* Border Spacing
|
|
2618
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2619
|
+
*/
|
|
2620
|
+
"border-spacing": [{
|
|
2621
|
+
"border-spacing": scaleUnambiguousSpacing()
|
|
2622
|
+
}],
|
|
2623
|
+
/**
|
|
2624
|
+
* Border Spacing X
|
|
2625
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2626
|
+
*/
|
|
2627
|
+
"border-spacing-x": [{
|
|
2628
|
+
"border-spacing-x": scaleUnambiguousSpacing()
|
|
2629
|
+
}],
|
|
2630
|
+
/**
|
|
2631
|
+
* Border Spacing Y
|
|
2632
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2633
|
+
*/
|
|
2634
|
+
"border-spacing-y": [{
|
|
2635
|
+
"border-spacing-y": scaleUnambiguousSpacing()
|
|
2636
|
+
}],
|
|
2637
|
+
/**
|
|
2638
|
+
* Table Layout
|
|
2639
|
+
* @see https://tailwindcss.com/docs/table-layout
|
|
2640
|
+
*/
|
|
2641
|
+
"table-layout": [{
|
|
2642
|
+
table: ["auto", "fixed"]
|
|
2643
|
+
}],
|
|
2644
|
+
/**
|
|
2645
|
+
* Caption Side
|
|
2646
|
+
* @see https://tailwindcss.com/docs/caption-side
|
|
2647
|
+
*/
|
|
2648
|
+
caption: [{
|
|
2649
|
+
caption: ["top", "bottom"]
|
|
2650
|
+
}],
|
|
2651
|
+
// ---------------------------------
|
|
2652
|
+
// --- Transitions and Animation ---
|
|
2653
|
+
// ---------------------------------
|
|
2654
|
+
/**
|
|
2655
|
+
* Transition Property
|
|
2656
|
+
* @see https://tailwindcss.com/docs/transition-property
|
|
2657
|
+
*/
|
|
2658
|
+
transition: [{
|
|
2659
|
+
transition: ["", "all", "colors", "opacity", "shadow", "transform", "none", isArbitraryVariable, isArbitraryValue]
|
|
2660
|
+
}],
|
|
2661
|
+
/**
|
|
2662
|
+
* Transition Behavior
|
|
2663
|
+
* @see https://tailwindcss.com/docs/transition-behavior
|
|
2664
|
+
*/
|
|
2665
|
+
"transition-behavior": [{
|
|
2666
|
+
transition: ["normal", "discrete"]
|
|
2667
|
+
}],
|
|
2668
|
+
/**
|
|
2669
|
+
* Transition Duration
|
|
2670
|
+
* @see https://tailwindcss.com/docs/transition-duration
|
|
2671
|
+
*/
|
|
2672
|
+
duration: [{
|
|
2673
|
+
duration: [isNumber, "initial", isArbitraryVariable, isArbitraryValue]
|
|
2674
|
+
}],
|
|
2675
|
+
/**
|
|
2676
|
+
* Transition Timing Function
|
|
2677
|
+
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
2678
|
+
*/
|
|
2679
|
+
ease: [{
|
|
2680
|
+
ease: ["linear", "initial", themeEase, isArbitraryVariable, isArbitraryValue]
|
|
2681
|
+
}],
|
|
2682
|
+
/**
|
|
2683
|
+
* Transition Delay
|
|
2684
|
+
* @see https://tailwindcss.com/docs/transition-delay
|
|
2685
|
+
*/
|
|
2686
|
+
delay: [{
|
|
2687
|
+
delay: [isNumber, isArbitraryVariable, isArbitraryValue]
|
|
2688
|
+
}],
|
|
2689
|
+
/**
|
|
2690
|
+
* Animation
|
|
2691
|
+
* @see https://tailwindcss.com/docs/animation
|
|
2692
|
+
*/
|
|
2693
|
+
animate: [{
|
|
2694
|
+
animate: ["none", themeAnimate, isArbitraryVariable, isArbitraryValue]
|
|
2695
|
+
}],
|
|
2696
|
+
// ------------------
|
|
2697
|
+
// --- Transforms ---
|
|
2698
|
+
// ------------------
|
|
2699
|
+
/**
|
|
2700
|
+
* Backface Visibility
|
|
2701
|
+
* @see https://tailwindcss.com/docs/backface-visibility
|
|
2702
|
+
*/
|
|
2703
|
+
backface: [{
|
|
2704
|
+
backface: ["hidden", "visible"]
|
|
2705
|
+
}],
|
|
2706
|
+
/**
|
|
2707
|
+
* Perspective
|
|
2708
|
+
* @see https://tailwindcss.com/docs/perspective
|
|
2709
|
+
*/
|
|
2710
|
+
perspective: [{
|
|
2711
|
+
perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
|
|
2712
|
+
}],
|
|
2713
|
+
/**
|
|
2714
|
+
* Perspective Origin
|
|
2715
|
+
* @see https://tailwindcss.com/docs/perspective-origin
|
|
2716
|
+
*/
|
|
2717
|
+
"perspective-origin": [{
|
|
2718
|
+
"perspective-origin": scalePositionWithArbitrary()
|
|
2719
|
+
}],
|
|
2720
|
+
/**
|
|
2721
|
+
* Rotate
|
|
2722
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2723
|
+
*/
|
|
2724
|
+
rotate: [{
|
|
2725
|
+
rotate: scaleRotate()
|
|
2726
|
+
}],
|
|
2727
|
+
/**
|
|
2728
|
+
* Rotate X
|
|
2729
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2730
|
+
*/
|
|
2731
|
+
"rotate-x": [{
|
|
2732
|
+
"rotate-x": scaleRotate()
|
|
2733
|
+
}],
|
|
2734
|
+
/**
|
|
2735
|
+
* Rotate Y
|
|
2736
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2737
|
+
*/
|
|
2738
|
+
"rotate-y": [{
|
|
2739
|
+
"rotate-y": scaleRotate()
|
|
2740
|
+
}],
|
|
2741
|
+
/**
|
|
2742
|
+
* Rotate Z
|
|
2743
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2744
|
+
*/
|
|
2745
|
+
"rotate-z": [{
|
|
2746
|
+
"rotate-z": scaleRotate()
|
|
2747
|
+
}],
|
|
2748
|
+
/**
|
|
2749
|
+
* Scale
|
|
2750
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2751
|
+
*/
|
|
2752
|
+
scale: [{
|
|
2753
|
+
scale: scaleScale()
|
|
2754
|
+
}],
|
|
2755
|
+
/**
|
|
2756
|
+
* Scale X
|
|
2757
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2758
|
+
*/
|
|
2759
|
+
"scale-x": [{
|
|
2760
|
+
"scale-x": scaleScale()
|
|
2761
|
+
}],
|
|
2762
|
+
/**
|
|
2763
|
+
* Scale Y
|
|
2764
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2765
|
+
*/
|
|
2766
|
+
"scale-y": [{
|
|
2767
|
+
"scale-y": scaleScale()
|
|
2768
|
+
}],
|
|
2769
|
+
/**
|
|
2770
|
+
* Scale Z
|
|
2771
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2772
|
+
*/
|
|
2773
|
+
"scale-z": [{
|
|
2774
|
+
"scale-z": scaleScale()
|
|
2775
|
+
}],
|
|
2776
|
+
/**
|
|
2777
|
+
* Scale 3D
|
|
2778
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2779
|
+
*/
|
|
2780
|
+
"scale-3d": ["scale-3d"],
|
|
2781
|
+
/**
|
|
2782
|
+
* Skew
|
|
2783
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2784
|
+
*/
|
|
2785
|
+
skew: [{
|
|
2786
|
+
skew: scaleSkew()
|
|
2787
|
+
}],
|
|
2788
|
+
/**
|
|
2789
|
+
* Skew X
|
|
2790
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2791
|
+
*/
|
|
2792
|
+
"skew-x": [{
|
|
2793
|
+
"skew-x": scaleSkew()
|
|
2794
|
+
}],
|
|
2795
|
+
/**
|
|
2796
|
+
* Skew Y
|
|
2797
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2798
|
+
*/
|
|
2799
|
+
"skew-y": [{
|
|
2800
|
+
"skew-y": scaleSkew()
|
|
2801
|
+
}],
|
|
2802
|
+
/**
|
|
2803
|
+
* Transform
|
|
2804
|
+
* @see https://tailwindcss.com/docs/transform
|
|
2805
|
+
*/
|
|
2806
|
+
transform: [{
|
|
2807
|
+
transform: [isArbitraryVariable, isArbitraryValue, "", "none", "gpu", "cpu"]
|
|
2808
|
+
}],
|
|
2809
|
+
/**
|
|
2810
|
+
* Transform Origin
|
|
2811
|
+
* @see https://tailwindcss.com/docs/transform-origin
|
|
2812
|
+
*/
|
|
2813
|
+
"transform-origin": [{
|
|
2814
|
+
origin: scalePositionWithArbitrary()
|
|
2815
|
+
}],
|
|
2816
|
+
/**
|
|
2817
|
+
* Transform Style
|
|
2818
|
+
* @see https://tailwindcss.com/docs/transform-style
|
|
2819
|
+
*/
|
|
2820
|
+
"transform-style": [{
|
|
2821
|
+
transform: ["3d", "flat"]
|
|
2822
|
+
}],
|
|
2823
|
+
/**
|
|
2824
|
+
* Translate
|
|
2825
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2826
|
+
*/
|
|
2827
|
+
translate: [{
|
|
2828
|
+
translate: scaleTranslate()
|
|
2829
|
+
}],
|
|
2830
|
+
/**
|
|
2831
|
+
* Translate X
|
|
2832
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2833
|
+
*/
|
|
2834
|
+
"translate-x": [{
|
|
2835
|
+
"translate-x": scaleTranslate()
|
|
2836
|
+
}],
|
|
2837
|
+
/**
|
|
2838
|
+
* Translate Y
|
|
2839
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2840
|
+
*/
|
|
2841
|
+
"translate-y": [{
|
|
2842
|
+
"translate-y": scaleTranslate()
|
|
2843
|
+
}],
|
|
2844
|
+
/**
|
|
2845
|
+
* Translate Z
|
|
2846
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2847
|
+
*/
|
|
2848
|
+
"translate-z": [{
|
|
2849
|
+
"translate-z": scaleTranslate()
|
|
2850
|
+
}],
|
|
2851
|
+
/**
|
|
2852
|
+
* Translate None
|
|
2853
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2854
|
+
*/
|
|
2855
|
+
"translate-none": ["translate-none"],
|
|
2856
|
+
// ---------------------
|
|
2857
|
+
// --- Interactivity ---
|
|
2858
|
+
// ---------------------
|
|
2859
|
+
/**
|
|
2860
|
+
* Accent Color
|
|
2861
|
+
* @see https://tailwindcss.com/docs/accent-color
|
|
2862
|
+
*/
|
|
2863
|
+
accent: [{
|
|
2864
|
+
accent: scaleColor()
|
|
2865
|
+
}],
|
|
2866
|
+
/**
|
|
2867
|
+
* Appearance
|
|
2868
|
+
* @see https://tailwindcss.com/docs/appearance
|
|
2869
|
+
*/
|
|
2870
|
+
appearance: [{
|
|
2871
|
+
appearance: ["none", "auto"]
|
|
2872
|
+
}],
|
|
2873
|
+
/**
|
|
2874
|
+
* Caret Color
|
|
2875
|
+
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
|
|
2876
|
+
*/
|
|
2877
|
+
"caret-color": [{
|
|
2878
|
+
caret: scaleColor()
|
|
2879
|
+
}],
|
|
2880
|
+
/**
|
|
2881
|
+
* Color Scheme
|
|
2882
|
+
* @see https://tailwindcss.com/docs/color-scheme
|
|
2883
|
+
*/
|
|
2884
|
+
"color-scheme": [{
|
|
2885
|
+
scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"]
|
|
2886
|
+
}],
|
|
2887
|
+
/**
|
|
2888
|
+
* Cursor
|
|
2889
|
+
* @see https://tailwindcss.com/docs/cursor
|
|
2890
|
+
*/
|
|
2891
|
+
cursor: [{
|
|
2892
|
+
cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryVariable, isArbitraryValue]
|
|
2893
|
+
}],
|
|
2894
|
+
/**
|
|
2895
|
+
* Field Sizing
|
|
2896
|
+
* @see https://tailwindcss.com/docs/field-sizing
|
|
2897
|
+
*/
|
|
2898
|
+
"field-sizing": [{
|
|
2899
|
+
"field-sizing": ["fixed", "content"]
|
|
2900
|
+
}],
|
|
2901
|
+
/**
|
|
2902
|
+
* Pointer Events
|
|
2903
|
+
* @see https://tailwindcss.com/docs/pointer-events
|
|
2904
|
+
*/
|
|
2905
|
+
"pointer-events": [{
|
|
2906
|
+
"pointer-events": ["auto", "none"]
|
|
2907
|
+
}],
|
|
2908
|
+
/**
|
|
2909
|
+
* Resize
|
|
2910
|
+
* @see https://tailwindcss.com/docs/resize
|
|
2911
|
+
*/
|
|
2912
|
+
resize: [{
|
|
2913
|
+
resize: ["none", "", "y", "x"]
|
|
2914
|
+
}],
|
|
2915
|
+
/**
|
|
2916
|
+
* Scroll Behavior
|
|
2917
|
+
* @see https://tailwindcss.com/docs/scroll-behavior
|
|
2918
|
+
*/
|
|
2919
|
+
"scroll-behavior": [{
|
|
2920
|
+
scroll: ["auto", "smooth"]
|
|
2921
|
+
}],
|
|
2922
|
+
/**
|
|
2923
|
+
* Scroll Margin
|
|
2924
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2925
|
+
*/
|
|
2926
|
+
"scroll-m": [{
|
|
2927
|
+
"scroll-m": scaleUnambiguousSpacing()
|
|
2928
|
+
}],
|
|
2929
|
+
/**
|
|
2930
|
+
* Scroll Margin Inline
|
|
2931
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2932
|
+
*/
|
|
2933
|
+
"scroll-mx": [{
|
|
2934
|
+
"scroll-mx": scaleUnambiguousSpacing()
|
|
2935
|
+
}],
|
|
2936
|
+
/**
|
|
2937
|
+
* Scroll Margin Block
|
|
2938
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2939
|
+
*/
|
|
2940
|
+
"scroll-my": [{
|
|
2941
|
+
"scroll-my": scaleUnambiguousSpacing()
|
|
2942
|
+
}],
|
|
2943
|
+
/**
|
|
2944
|
+
* Scroll Margin Inline Start
|
|
2945
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2946
|
+
*/
|
|
2947
|
+
"scroll-ms": [{
|
|
2948
|
+
"scroll-ms": scaleUnambiguousSpacing()
|
|
2949
|
+
}],
|
|
2950
|
+
/**
|
|
2951
|
+
* Scroll Margin Inline End
|
|
2952
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2953
|
+
*/
|
|
2954
|
+
"scroll-me": [{
|
|
2955
|
+
"scroll-me": scaleUnambiguousSpacing()
|
|
2956
|
+
}],
|
|
2957
|
+
/**
|
|
2958
|
+
* Scroll Margin Block Start
|
|
2959
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2960
|
+
*/
|
|
2961
|
+
"scroll-mbs": [{
|
|
2962
|
+
"scroll-mbs": scaleUnambiguousSpacing()
|
|
2963
|
+
}],
|
|
2964
|
+
/**
|
|
2965
|
+
* Scroll Margin Block End
|
|
2966
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2967
|
+
*/
|
|
2968
|
+
"scroll-mbe": [{
|
|
2969
|
+
"scroll-mbe": scaleUnambiguousSpacing()
|
|
2970
|
+
}],
|
|
2971
|
+
/**
|
|
2972
|
+
* Scroll Margin Top
|
|
2973
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2974
|
+
*/
|
|
2975
|
+
"scroll-mt": [{
|
|
2976
|
+
"scroll-mt": scaleUnambiguousSpacing()
|
|
2977
|
+
}],
|
|
2978
|
+
/**
|
|
2979
|
+
* Scroll Margin Right
|
|
2980
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2981
|
+
*/
|
|
2982
|
+
"scroll-mr": [{
|
|
2983
|
+
"scroll-mr": scaleUnambiguousSpacing()
|
|
2984
|
+
}],
|
|
2985
|
+
/**
|
|
2986
|
+
* Scroll Margin Bottom
|
|
2987
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2988
|
+
*/
|
|
2989
|
+
"scroll-mb": [{
|
|
2990
|
+
"scroll-mb": scaleUnambiguousSpacing()
|
|
2991
|
+
}],
|
|
2992
|
+
/**
|
|
2993
|
+
* Scroll Margin Left
|
|
2994
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2995
|
+
*/
|
|
2996
|
+
"scroll-ml": [{
|
|
2997
|
+
"scroll-ml": scaleUnambiguousSpacing()
|
|
2998
|
+
}],
|
|
2999
|
+
/**
|
|
3000
|
+
* Scroll Padding
|
|
3001
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3002
|
+
*/
|
|
3003
|
+
"scroll-p": [{
|
|
3004
|
+
"scroll-p": scaleUnambiguousSpacing()
|
|
3005
|
+
}],
|
|
3006
|
+
/**
|
|
3007
|
+
* Scroll Padding Inline
|
|
3008
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3009
|
+
*/
|
|
3010
|
+
"scroll-px": [{
|
|
3011
|
+
"scroll-px": scaleUnambiguousSpacing()
|
|
3012
|
+
}],
|
|
3013
|
+
/**
|
|
3014
|
+
* Scroll Padding Block
|
|
3015
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3016
|
+
*/
|
|
3017
|
+
"scroll-py": [{
|
|
3018
|
+
"scroll-py": scaleUnambiguousSpacing()
|
|
3019
|
+
}],
|
|
3020
|
+
/**
|
|
3021
|
+
* Scroll Padding Inline Start
|
|
3022
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3023
|
+
*/
|
|
3024
|
+
"scroll-ps": [{
|
|
3025
|
+
"scroll-ps": scaleUnambiguousSpacing()
|
|
3026
|
+
}],
|
|
3027
|
+
/**
|
|
3028
|
+
* Scroll Padding Inline End
|
|
3029
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3030
|
+
*/
|
|
3031
|
+
"scroll-pe": [{
|
|
3032
|
+
"scroll-pe": scaleUnambiguousSpacing()
|
|
3033
|
+
}],
|
|
3034
|
+
/**
|
|
3035
|
+
* Scroll Padding Block Start
|
|
3036
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3037
|
+
*/
|
|
3038
|
+
"scroll-pbs": [{
|
|
3039
|
+
"scroll-pbs": scaleUnambiguousSpacing()
|
|
3040
|
+
}],
|
|
3041
|
+
/**
|
|
3042
|
+
* Scroll Padding Block End
|
|
3043
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3044
|
+
*/
|
|
3045
|
+
"scroll-pbe": [{
|
|
3046
|
+
"scroll-pbe": scaleUnambiguousSpacing()
|
|
3047
|
+
}],
|
|
3048
|
+
/**
|
|
3049
|
+
* Scroll Padding Top
|
|
3050
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3051
|
+
*/
|
|
3052
|
+
"scroll-pt": [{
|
|
3053
|
+
"scroll-pt": scaleUnambiguousSpacing()
|
|
3054
|
+
}],
|
|
3055
|
+
/**
|
|
3056
|
+
* Scroll Padding Right
|
|
3057
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3058
|
+
*/
|
|
3059
|
+
"scroll-pr": [{
|
|
3060
|
+
"scroll-pr": scaleUnambiguousSpacing()
|
|
3061
|
+
}],
|
|
3062
|
+
/**
|
|
3063
|
+
* Scroll Padding Bottom
|
|
3064
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3065
|
+
*/
|
|
3066
|
+
"scroll-pb": [{
|
|
3067
|
+
"scroll-pb": scaleUnambiguousSpacing()
|
|
3068
|
+
}],
|
|
3069
|
+
/**
|
|
3070
|
+
* Scroll Padding Left
|
|
3071
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3072
|
+
*/
|
|
3073
|
+
"scroll-pl": [{
|
|
3074
|
+
"scroll-pl": scaleUnambiguousSpacing()
|
|
3075
|
+
}],
|
|
3076
|
+
/**
|
|
3077
|
+
* Scroll Snap Align
|
|
3078
|
+
* @see https://tailwindcss.com/docs/scroll-snap-align
|
|
3079
|
+
*/
|
|
3080
|
+
"snap-align": [{
|
|
3081
|
+
snap: ["start", "end", "center", "align-none"]
|
|
3082
|
+
}],
|
|
3083
|
+
/**
|
|
3084
|
+
* Scroll Snap Stop
|
|
3085
|
+
* @see https://tailwindcss.com/docs/scroll-snap-stop
|
|
3086
|
+
*/
|
|
3087
|
+
"snap-stop": [{
|
|
3088
|
+
snap: ["normal", "always"]
|
|
3089
|
+
}],
|
|
3090
|
+
/**
|
|
3091
|
+
* Scroll Snap Type
|
|
3092
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
3093
|
+
*/
|
|
3094
|
+
"snap-type": [{
|
|
3095
|
+
snap: ["none", "x", "y", "both"]
|
|
3096
|
+
}],
|
|
3097
|
+
/**
|
|
3098
|
+
* Scroll Snap Type Strictness
|
|
3099
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
3100
|
+
*/
|
|
3101
|
+
"snap-strictness": [{
|
|
3102
|
+
snap: ["mandatory", "proximity"]
|
|
3103
|
+
}],
|
|
3104
|
+
/**
|
|
3105
|
+
* Touch Action
|
|
3106
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3107
|
+
*/
|
|
3108
|
+
touch: [{
|
|
3109
|
+
touch: ["auto", "none", "manipulation"]
|
|
3110
|
+
}],
|
|
3111
|
+
/**
|
|
3112
|
+
* Touch Action X
|
|
3113
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3114
|
+
*/
|
|
3115
|
+
"touch-x": [{
|
|
3116
|
+
"touch-pan": ["x", "left", "right"]
|
|
3117
|
+
}],
|
|
3118
|
+
/**
|
|
3119
|
+
* Touch Action Y
|
|
3120
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3121
|
+
*/
|
|
3122
|
+
"touch-y": [{
|
|
3123
|
+
"touch-pan": ["y", "up", "down"]
|
|
3124
|
+
}],
|
|
3125
|
+
/**
|
|
3126
|
+
* Touch Action Pinch Zoom
|
|
3127
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3128
|
+
*/
|
|
3129
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
3130
|
+
/**
|
|
3131
|
+
* User Select
|
|
3132
|
+
* @see https://tailwindcss.com/docs/user-select
|
|
3133
|
+
*/
|
|
3134
|
+
select: [{
|
|
3135
|
+
select: ["none", "text", "all", "auto"]
|
|
3136
|
+
}],
|
|
3137
|
+
/**
|
|
3138
|
+
* Will Change
|
|
3139
|
+
* @see https://tailwindcss.com/docs/will-change
|
|
3140
|
+
*/
|
|
3141
|
+
"will-change": [{
|
|
3142
|
+
"will-change": ["auto", "scroll", "contents", "transform", isArbitraryVariable, isArbitraryValue]
|
|
3143
|
+
}],
|
|
3144
|
+
// -----------
|
|
3145
|
+
// --- SVG ---
|
|
3146
|
+
// -----------
|
|
3147
|
+
/**
|
|
3148
|
+
* Fill
|
|
3149
|
+
* @see https://tailwindcss.com/docs/fill
|
|
3150
|
+
*/
|
|
3151
|
+
fill: [{
|
|
3152
|
+
fill: ["none", ...scaleColor()]
|
|
3153
|
+
}],
|
|
3154
|
+
/**
|
|
3155
|
+
* Stroke Width
|
|
3156
|
+
* @see https://tailwindcss.com/docs/stroke-width
|
|
3157
|
+
*/
|
|
3158
|
+
"stroke-w": [{
|
|
3159
|
+
stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
|
|
3160
|
+
}],
|
|
3161
|
+
/**
|
|
3162
|
+
* Stroke
|
|
3163
|
+
* @see https://tailwindcss.com/docs/stroke
|
|
3164
|
+
*/
|
|
3165
|
+
stroke: [{
|
|
3166
|
+
stroke: ["none", ...scaleColor()]
|
|
3167
|
+
}],
|
|
3168
|
+
// ---------------------
|
|
3169
|
+
// --- Accessibility ---
|
|
3170
|
+
// ---------------------
|
|
3171
|
+
/**
|
|
3172
|
+
* Forced Color Adjust
|
|
3173
|
+
* @see https://tailwindcss.com/docs/forced-color-adjust
|
|
3174
|
+
*/
|
|
3175
|
+
"forced-color-adjust": [{
|
|
3176
|
+
"forced-color-adjust": ["auto", "none"]
|
|
3177
|
+
}]
|
|
3178
|
+
},
|
|
3179
|
+
conflictingClassGroups: {
|
|
3180
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
3181
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
3182
|
+
inset: ["inset-x", "inset-y", "inset-bs", "inset-be", "start", "end", "top", "right", "bottom", "left"],
|
|
3183
|
+
"inset-x": ["right", "left"],
|
|
3184
|
+
"inset-y": ["top", "bottom"],
|
|
3185
|
+
flex: ["basis", "grow", "shrink"],
|
|
3186
|
+
gap: ["gap-x", "gap-y"],
|
|
3187
|
+
p: ["px", "py", "ps", "pe", "pbs", "pbe", "pt", "pr", "pb", "pl"],
|
|
3188
|
+
px: ["pr", "pl"],
|
|
3189
|
+
py: ["pt", "pb"],
|
|
3190
|
+
m: ["mx", "my", "ms", "me", "mbs", "mbe", "mt", "mr", "mb", "ml"],
|
|
3191
|
+
mx: ["mr", "ml"],
|
|
3192
|
+
my: ["mt", "mb"],
|
|
3193
|
+
size: ["w", "h"],
|
|
3194
|
+
"font-size": ["leading"],
|
|
3195
|
+
"fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
|
|
3196
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
3197
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
3198
|
+
"fvn-figure": ["fvn-normal"],
|
|
3199
|
+
"fvn-spacing": ["fvn-normal"],
|
|
3200
|
+
"fvn-fraction": ["fvn-normal"],
|
|
3201
|
+
"line-clamp": ["display", "overflow"],
|
|
3202
|
+
rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
|
|
3203
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
3204
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
3205
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
3206
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
3207
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
3208
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
3209
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
3210
|
+
"border-w": ["border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-bs", "border-w-be", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
|
|
3211
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
3212
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
3213
|
+
"border-color": ["border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-bs", "border-color-be", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
3214
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
3215
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
3216
|
+
translate: ["translate-x", "translate-y", "translate-none"],
|
|
3217
|
+
"translate-none": ["translate", "translate-x", "translate-y", "translate-z"],
|
|
3218
|
+
"scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mbs", "scroll-mbe", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
|
|
3219
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
3220
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
3221
|
+
"scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pbs", "scroll-pbe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
|
|
3222
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
3223
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
3224
|
+
touch: ["touch-x", "touch-y", "touch-pz"],
|
|
3225
|
+
"touch-x": ["touch"],
|
|
3226
|
+
"touch-y": ["touch"],
|
|
3227
|
+
"touch-pz": ["touch"]
|
|
3228
|
+
},
|
|
3229
|
+
conflictingClassGroupModifiers: {
|
|
3230
|
+
"font-size": ["leading"]
|
|
3231
|
+
},
|
|
3232
|
+
orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
|
|
3233
|
+
};
|
|
3234
|
+
};
|
|
3235
|
+
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
3236
|
+
|
|
3237
|
+
// src/lib/utils.ts
|
|
3238
|
+
function cn(...inputs) {
|
|
3239
|
+
return twMerge(clsx(inputs));
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3242
|
+
// src/components/m3/state-layer.ts
|
|
3243
|
+
var stateLayer = cva(
|
|
3244
|
+
[
|
|
3245
|
+
"relative overflow-hidden",
|
|
3246
|
+
// Pseudo-element state layer
|
|
3247
|
+
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity"
|
|
3248
|
+
],
|
|
3249
|
+
{
|
|
3250
|
+
variants: {
|
|
3251
|
+
/**
|
|
3252
|
+
* Interaction mode — determines which states apply
|
|
3253
|
+
*/
|
|
3254
|
+
interaction: {
|
|
3255
|
+
/** Hover 8%, focus 10%, pressed 10% */
|
|
3256
|
+
default: "hover:before:opacity-8 focus-visible:before:opacity-10 active:before:opacity-10",
|
|
3257
|
+
/** Dragged 16% */
|
|
3258
|
+
dragged: "before:opacity-16"
|
|
3259
|
+
}
|
|
3260
|
+
},
|
|
3261
|
+
defaultVariants: {
|
|
3262
|
+
interaction: "default"
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
);
|
|
3266
|
+
|
|
3267
|
+
// src/components/m3/Fab.tsx
|
|
3268
|
+
import { jsx } from "react/jsx-runtime";
|
|
3269
|
+
var fabVariants = cva(
|
|
3270
|
+
[
|
|
3271
|
+
"flex items-center justify-center cursor-pointer",
|
|
3272
|
+
// Elevation
|
|
3273
|
+
"shadow-lg hover:shadow-xl active:shadow-md transition-shadow",
|
|
3274
|
+
// Focus ring
|
|
3275
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-current/50"
|
|
3276
|
+
],
|
|
3277
|
+
{
|
|
3278
|
+
variants: {
|
|
3279
|
+
/**
|
|
3280
|
+
* FAB size — controls container dimensions and corner radius
|
|
3281
|
+
* @see https://m3.material.io/components/floating-action-button/specs#:~:text=Copy%20link-,Variants,-link
|
|
3282
|
+
*/
|
|
3283
|
+
size: {
|
|
3284
|
+
default: "size-14 rounded-2xl",
|
|
3285
|
+
// 56dp
|
|
3286
|
+
medium: "size-20 rounded-3xl",
|
|
3287
|
+
// 80dp
|
|
3288
|
+
large: "size-24 rounded-[28px]"
|
|
3289
|
+
// 96dp
|
|
3290
|
+
},
|
|
3291
|
+
/**
|
|
3292
|
+
* FAB color style — container & icon color mapping
|
|
3293
|
+
* @see https://m3.material.io/components/floating-action-button/specs#:~:text=Copy%20link-,Color,-Color%20values%20are
|
|
3294
|
+
*/
|
|
3295
|
+
color: {
|
|
3296
|
+
"primary-container": "bg-primary-container text-on-primary-container",
|
|
3297
|
+
"secondary-container": "bg-secondary-container text-on-secondary-container",
|
|
3298
|
+
"tertiary-container": "bg-tertiary-container text-on-tertiary-container",
|
|
3299
|
+
primary: "bg-primary text-on-primary",
|
|
3300
|
+
secondary: "bg-secondary text-on-secondary",
|
|
3301
|
+
tertiary: "bg-tertiary text-on-tertiary"
|
|
3302
|
+
}
|
|
3303
|
+
},
|
|
3304
|
+
defaultVariants: {
|
|
3305
|
+
size: "default",
|
|
3306
|
+
color: "primary-container"
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
);
|
|
3310
|
+
function Fab({ className, size, color, children, ...props }) {
|
|
3311
|
+
return /* @__PURE__ */ jsx(
|
|
3312
|
+
"button",
|
|
3313
|
+
{
|
|
3314
|
+
className: cn(stateLayer(), fabVariants({ size, color }), className),
|
|
3315
|
+
...props,
|
|
3316
|
+
children
|
|
3317
|
+
}
|
|
3318
|
+
);
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
// src/lib/builder.ts
|
|
3322
|
+
import {
|
|
3323
|
+
argbFromHex as argbFromHex2,
|
|
3324
|
+
Blend,
|
|
3325
|
+
DynamicColor,
|
|
3326
|
+
DynamicScheme as DynamicScheme2,
|
|
3327
|
+
Hct as Hct2,
|
|
3328
|
+
MaterialDynamicColors as MaterialDynamicColors2,
|
|
3329
|
+
SchemeContent,
|
|
3330
|
+
SchemeExpressive,
|
|
3331
|
+
SchemeFidelity,
|
|
3332
|
+
SchemeMonochrome,
|
|
3333
|
+
SchemeNeutral,
|
|
3334
|
+
SchemeTonalSpot,
|
|
3335
|
+
SchemeVibrant,
|
|
3336
|
+
TonalPalette as TonalPalette2
|
|
3337
|
+
} from "@material/material-color-utilities";
|
|
3338
|
+
import { kebabCase as kebabCase4, upperFirst as upperFirst2 } from "lodash-es";
|
|
3339
|
+
|
|
3340
|
+
// src/lib/builder.css.ts
|
|
3341
|
+
import {
|
|
3342
|
+
hexFromArgb
|
|
3343
|
+
} from "@material/material-color-utilities";
|
|
3344
|
+
import { kebabCase } from "lodash-es";
|
|
3345
|
+
function buildCss(ctx) {
|
|
3346
|
+
const {
|
|
3347
|
+
prefix,
|
|
3348
|
+
allPalettes,
|
|
3349
|
+
mergedColorsLight,
|
|
3350
|
+
mergedColorsDark,
|
|
3351
|
+
tokenToPalette,
|
|
3352
|
+
allPaletteNamesKebab
|
|
3353
|
+
} = ctx;
|
|
3354
|
+
function buildRefPaletteLookup() {
|
|
3355
|
+
const lookup = {};
|
|
3356
|
+
for (const [name, palette] of Object.entries(allPalettes)) {
|
|
3357
|
+
const paletteName = kebabCase(name);
|
|
3358
|
+
for (const tone of STANDARD_TONES) {
|
|
3359
|
+
const hex = hexFromArgb(palette.tone(tone));
|
|
3360
|
+
if (!lookup[hex]) lookup[hex] = [];
|
|
3361
|
+
lookup[hex].push({ paletteName, tone });
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
return lookup;
|
|
3365
|
+
}
|
|
3366
|
+
function sysColorVar(colorName, colorValue, lookup) {
|
|
3367
|
+
const name = `--${prefix}-sys-color-${kebabCase(colorName)}`;
|
|
3368
|
+
const hex = hexFromArgb(colorValue);
|
|
3369
|
+
const matches = lookup[hex];
|
|
3370
|
+
if (matches && matches.length > 0) {
|
|
3371
|
+
const preferred = tokenToPalette[colorName] ?? deriveCustomPaletteName(colorName, allPaletteNamesKebab);
|
|
3372
|
+
const match = (preferred ? matches.find((m) => m.paletteName === preferred) : void 0) ?? matches[0];
|
|
3373
|
+
if (match) {
|
|
3374
|
+
return `${name}:var(--${prefix}-ref-palette-${match.paletteName}-${match.tone});`;
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
return `${name}:${hex};`;
|
|
3378
|
+
}
|
|
3379
|
+
function toCssVars(mergedColors, lookup) {
|
|
3380
|
+
return Object.entries(mergedColors).map(([name, value]) => sysColorVar(name, value, lookup)).join(" ");
|
|
3381
|
+
}
|
|
3382
|
+
function refPaletteVar(paletteName, tone, colorValue) {
|
|
3383
|
+
const name = `--${prefix}-ref-palette-${paletteName}-${tone}`;
|
|
3384
|
+
const value = hexFromArgb(colorValue);
|
|
3385
|
+
return `${name}:${value};`;
|
|
3386
|
+
}
|
|
3387
|
+
function generateTonalPaletteVars(paletteName, palette) {
|
|
3388
|
+
return STANDARD_TONES.map((tone) => {
|
|
3389
|
+
const color = palette.tone(tone);
|
|
3390
|
+
return refPaletteVar(paletteName, tone, color);
|
|
3391
|
+
}).join(" ");
|
|
3392
|
+
}
|
|
3393
|
+
function generateTonalVars() {
|
|
3394
|
+
return Object.entries(allPalettes).map(
|
|
3395
|
+
([name, palette]) => generateTonalPaletteVars(kebabCase(name), palette)
|
|
3396
|
+
).join(" ");
|
|
3397
|
+
}
|
|
3398
|
+
const refPaletteLookup = buildRefPaletteLookup();
|
|
3399
|
+
const lightVars = toCssVars(mergedColorsLight, refPaletteLookup);
|
|
3400
|
+
const darkVars = toCssVars(mergedColorsDark, refPaletteLookup);
|
|
3401
|
+
const tonalVars = generateTonalVars();
|
|
3402
|
+
return `
|
|
3403
|
+
:root { ${lightVars} ${tonalVars} }
|
|
3404
|
+
.dark { ${darkVars} ${tonalVars} }
|
|
3405
|
+
`;
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
// src/lib/builder.figma.ts
|
|
3409
|
+
import {
|
|
3410
|
+
blueFromArgb,
|
|
3411
|
+
greenFromArgb,
|
|
3412
|
+
hexFromArgb as hexFromArgb2,
|
|
3413
|
+
redFromArgb
|
|
3414
|
+
} from "@material/material-color-utilities";
|
|
3415
|
+
import { kebabCase as kebabCase2, startCase } from "lodash-es";
|
|
3416
|
+
function buildFigmaVariables(ctx) {
|
|
3417
|
+
const {
|
|
3418
|
+
allPalettes,
|
|
3419
|
+
mergedColorsLight,
|
|
3420
|
+
mergedColorsDark,
|
|
3421
|
+
tokenToPalette,
|
|
3422
|
+
allPaletteNamesKebab
|
|
3423
|
+
} = ctx;
|
|
3424
|
+
const variables = [];
|
|
3425
|
+
const paletteHexMap = {};
|
|
3426
|
+
for (const [name, palette] of Object.entries(allPalettes)) {
|
|
3427
|
+
const paletteName = startCase(name);
|
|
3428
|
+
paletteHexMap[paletteName] = {};
|
|
3429
|
+
for (const tone of STANDARD_TONES) {
|
|
3430
|
+
const argb = palette.tone(tone);
|
|
3431
|
+
const path = `ref/palette/${paletteName}/${tone}`;
|
|
3432
|
+
const hex = hexFromArgb2(argb).toUpperCase();
|
|
3433
|
+
paletteHexMap[paletteName][hex] = path;
|
|
3434
|
+
const color = {
|
|
3435
|
+
r: redFromArgb(argb) / 255,
|
|
3436
|
+
g: greenFromArgb(argb) / 255,
|
|
3437
|
+
b: blueFromArgb(argb) / 255,
|
|
3438
|
+
a: 1
|
|
3439
|
+
};
|
|
3440
|
+
variables.push({
|
|
3441
|
+
path,
|
|
3442
|
+
scopes: ["ALL_SCOPES"],
|
|
3443
|
+
values: { Light: color, Dark: color }
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
function findAlias(hex, tokenName) {
|
|
3448
|
+
const preferredKebab = tokenToPalette[tokenName] ?? deriveCustomPaletteName(tokenName, allPaletteNamesKebab);
|
|
3449
|
+
const preferred = preferredKebab ? startCase(preferredKebab) : void 0;
|
|
3450
|
+
if (preferred && paletteHexMap[preferred]?.[hex]) {
|
|
3451
|
+
return paletteHexMap[preferred][hex];
|
|
3452
|
+
}
|
|
3453
|
+
for (const palHexes of Object.values(paletteHexMap)) {
|
|
3454
|
+
if (palHexes[hex]) return palHexes[hex];
|
|
3455
|
+
}
|
|
3456
|
+
return null;
|
|
3457
|
+
}
|
|
3458
|
+
function resolveValue(argb, tokenName) {
|
|
3459
|
+
const hex = hexFromArgb2(argb).toUpperCase();
|
|
3460
|
+
const aliasPath = findAlias(hex, tokenName);
|
|
3461
|
+
if (aliasPath) return { alias: aliasPath };
|
|
3462
|
+
return {
|
|
3463
|
+
r: redFromArgb(argb) / 255,
|
|
3464
|
+
g: greenFromArgb(argb) / 255,
|
|
3465
|
+
b: blueFromArgb(argb) / 255,
|
|
3466
|
+
a: 1
|
|
3467
|
+
};
|
|
3468
|
+
}
|
|
3469
|
+
for (const [name, lightArgb] of Object.entries(mergedColorsLight)) {
|
|
3470
|
+
const darkArgb = mergedColorsDark[name] ?? lightArgb;
|
|
3471
|
+
const description = isTokenName(name) ? tokenDescriptions[name] : void 0;
|
|
3472
|
+
variables.push({
|
|
3473
|
+
path: `sys/color/${startCase(name)}`,
|
|
3474
|
+
...description ? { description } : {},
|
|
3475
|
+
scopes: ["ALL_SCOPES"],
|
|
3476
|
+
values: {
|
|
3477
|
+
Light: resolveValue(lightArgb, name),
|
|
3478
|
+
Dark: resolveValue(darkArgb, name)
|
|
3479
|
+
}
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
return variables;
|
|
3483
|
+
}
|
|
3484
|
+
function buildFigmaTokens(ctx) {
|
|
3485
|
+
const { prefix } = ctx;
|
|
3486
|
+
const variables = buildFigmaVariables(ctx);
|
|
3487
|
+
function rgbToHex(r2, g, b) {
|
|
3488
|
+
const toHex = (c) => Math.round(c * 255).toString(16).padStart(2, "0");
|
|
3489
|
+
return `#${toHex(r2)}${toHex(g)}${toHex(b)}`.toUpperCase();
|
|
3490
|
+
}
|
|
3491
|
+
function toDtcgValue(modeValue) {
|
|
3492
|
+
if ("alias" in modeValue) {
|
|
3493
|
+
return `{${modeValue.alias.replaceAll("/", ".")}}`;
|
|
3494
|
+
}
|
|
3495
|
+
return {
|
|
3496
|
+
colorSpace: "srgb",
|
|
3497
|
+
components: [modeValue.r, modeValue.g, modeValue.b],
|
|
3498
|
+
alpha: modeValue.a,
|
|
3499
|
+
hex: rgbToHex(modeValue.r, modeValue.g, modeValue.b)
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
function toDtcgExtensions(v) {
|
|
3503
|
+
if (v.path.startsWith("ref/palette/")) {
|
|
3504
|
+
return {
|
|
3505
|
+
"com.figma.scopes": v.scopes ?? ["ALL_SCOPES"],
|
|
3506
|
+
"com.figma.isOverride": true
|
|
3507
|
+
};
|
|
3508
|
+
}
|
|
3509
|
+
const lastSegment = v.path.split("/").at(-1);
|
|
3510
|
+
if (!lastSegment) return { "com.figma.scopes": v.scopes ?? ["ALL_SCOPES"] };
|
|
3511
|
+
const tokenName = kebabCase2(lastSegment);
|
|
3512
|
+
return {
|
|
3513
|
+
"com.figma.scopes": v.scopes ?? ["ALL_SCOPES"],
|
|
3514
|
+
"css.variable": `--${prefix}-sys-color-${tokenName}`
|
|
3515
|
+
};
|
|
3516
|
+
}
|
|
3517
|
+
function buildToken(v, modeValue) {
|
|
3518
|
+
return {
|
|
3519
|
+
$type: "color",
|
|
3520
|
+
$value: toDtcgValue(modeValue),
|
|
3521
|
+
...v.description ? { $description: v.description } : {},
|
|
3522
|
+
$extensions: toDtcgExtensions(v)
|
|
3523
|
+
};
|
|
3524
|
+
}
|
|
3525
|
+
function parsePath(path) {
|
|
3526
|
+
const parts = path.split("/");
|
|
3527
|
+
if (parts[0] === "ref" && parts[1] === "palette" && parts[2] && parts[3]) {
|
|
3528
|
+
return {
|
|
3529
|
+
kind: "palette",
|
|
3530
|
+
paletteName: parts[2],
|
|
3531
|
+
tone: parts[3]
|
|
3532
|
+
};
|
|
3533
|
+
}
|
|
3534
|
+
if (parts[0] === "sys" && parts[1] === "color" && parts[2]) {
|
|
3535
|
+
return { kind: "color", tokenName: parts[2] };
|
|
3536
|
+
}
|
|
3537
|
+
return null;
|
|
3538
|
+
}
|
|
3539
|
+
function buildModeFile(modeName) {
|
|
3540
|
+
const palette = {};
|
|
3541
|
+
const color = {};
|
|
3542
|
+
for (const v of variables) {
|
|
3543
|
+
const modeValue = v.values[modeName];
|
|
3544
|
+
if (!modeValue) continue;
|
|
3545
|
+
const parsed = parsePath(v.path);
|
|
3546
|
+
if (!parsed) continue;
|
|
3547
|
+
if (parsed.kind === "palette") {
|
|
3548
|
+
const group = palette[parsed.paletteName] ??= {};
|
|
3549
|
+
group[parsed.tone] = buildToken(v, modeValue);
|
|
3550
|
+
} else {
|
|
3551
|
+
color[parsed.tokenName] = buildToken(v, modeValue);
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
return {
|
|
3555
|
+
$extensions: { "com.figma.modeName": modeName },
|
|
3556
|
+
ref: { palette },
|
|
3557
|
+
sys: { color }
|
|
3558
|
+
};
|
|
3559
|
+
}
|
|
3560
|
+
return {
|
|
3561
|
+
"Light.tokens.json": buildModeFile("Light"),
|
|
3562
|
+
"Dark.tokens.json": buildModeFile("Dark")
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
// src/lib/builder.flutter.ts
|
|
3567
|
+
import { hexFromArgb as hexFromArgb3 } from "@material/material-color-utilities";
|
|
3568
|
+
import { upperFirst } from "lodash-es";
|
|
3569
|
+
var FLUTTER_PROPERTIES = [
|
|
3570
|
+
"primary",
|
|
3571
|
+
"surfaceTint",
|
|
3572
|
+
"onPrimary",
|
|
3573
|
+
"primaryContainer",
|
|
3574
|
+
"onPrimaryContainer",
|
|
3575
|
+
"secondary",
|
|
3576
|
+
"onSecondary",
|
|
3577
|
+
"secondaryContainer",
|
|
3578
|
+
"onSecondaryContainer",
|
|
3579
|
+
"tertiary",
|
|
3580
|
+
"onTertiary",
|
|
3581
|
+
"tertiaryContainer",
|
|
3582
|
+
"onTertiaryContainer",
|
|
3583
|
+
"error",
|
|
3584
|
+
"onError",
|
|
3585
|
+
"errorContainer",
|
|
3586
|
+
"onErrorContainer",
|
|
3587
|
+
"background",
|
|
3588
|
+
"onBackground",
|
|
3589
|
+
"surface",
|
|
3590
|
+
"onSurface",
|
|
3591
|
+
"surfaceVariant",
|
|
3592
|
+
"onSurfaceVariant",
|
|
3593
|
+
"outline",
|
|
3594
|
+
"outlineVariant",
|
|
3595
|
+
"shadow",
|
|
3596
|
+
"scrim",
|
|
3597
|
+
"inverseSurface",
|
|
3598
|
+
"inverseOnSurface",
|
|
3599
|
+
"inversePrimary",
|
|
3600
|
+
"primaryFixed",
|
|
3601
|
+
"onPrimaryFixed",
|
|
3602
|
+
"primaryFixedDim",
|
|
3603
|
+
"onPrimaryFixedVariant",
|
|
3604
|
+
"secondaryFixed",
|
|
3605
|
+
"onSecondaryFixed",
|
|
3606
|
+
"secondaryFixedDim",
|
|
3607
|
+
"onSecondaryFixedVariant",
|
|
3608
|
+
"tertiaryFixed",
|
|
3609
|
+
"onTertiaryFixed",
|
|
3610
|
+
"tertiaryFixedDim",
|
|
3611
|
+
"onTertiaryFixedVariant",
|
|
3612
|
+
"surfaceDim",
|
|
3613
|
+
"surfaceBright",
|
|
3614
|
+
"surfaceContainerLowest",
|
|
3615
|
+
"surfaceContainerLow",
|
|
3616
|
+
"surfaceContainer",
|
|
3617
|
+
"surfaceContainerHigh",
|
|
3618
|
+
"surfaceContainerHighest"
|
|
3619
|
+
];
|
|
3620
|
+
var TOKEN_TO_FLUTTER = {
|
|
3621
|
+
inverseOnSurface: "onInverseSurface"
|
|
3622
|
+
};
|
|
3623
|
+
function toFlutterColor(argb) {
|
|
3624
|
+
const hex = hexFromArgb3(argb).replace("#", "").toUpperCase();
|
|
3625
|
+
return `Color(0xFF${hex})`;
|
|
3626
|
+
}
|
|
3627
|
+
function flutterPropName(m3Token) {
|
|
3628
|
+
return TOKEN_TO_FLUTTER[m3Token] ?? m3Token;
|
|
3629
|
+
}
|
|
3630
|
+
function buildFlutter(ctx) {
|
|
3631
|
+
const { mergedColorsLight, mergedColorsDark, hexCustomColors } = ctx;
|
|
3632
|
+
function buildColorScheme(name, brightness, colors) {
|
|
3633
|
+
const lines = [];
|
|
3634
|
+
lines.push(`const ${name} = ColorScheme(`);
|
|
3635
|
+
lines.push(` brightness: Brightness.${brightness},`);
|
|
3636
|
+
for (const token of FLUTTER_PROPERTIES) {
|
|
3637
|
+
const argb = colors[token];
|
|
3638
|
+
if (argb === void 0) continue;
|
|
3639
|
+
lines.push(` ${flutterPropName(token)}: ${toFlutterColor(argb)},`);
|
|
3640
|
+
}
|
|
3641
|
+
lines.push(");");
|
|
3642
|
+
return lines.join("\n");
|
|
3643
|
+
}
|
|
3644
|
+
function buildCustomColors() {
|
|
3645
|
+
if (hexCustomColors.length === 0) return "";
|
|
3646
|
+
const sections = [];
|
|
3647
|
+
for (const cc of hexCustomColors) {
|
|
3648
|
+
const ccName = cc.name;
|
|
3649
|
+
const tokens = [
|
|
3650
|
+
ccName,
|
|
3651
|
+
`on${upperFirst(ccName)}`,
|
|
3652
|
+
`${ccName}Container`,
|
|
3653
|
+
`on${upperFirst(ccName)}Container`
|
|
3654
|
+
];
|
|
3655
|
+
const lightLines = [];
|
|
3656
|
+
const darkLines = [];
|
|
3657
|
+
for (const token of tokens) {
|
|
3658
|
+
const lightArgb = mergedColorsLight[token];
|
|
3659
|
+
const darkArgb = mergedColorsDark[token];
|
|
3660
|
+
if (lightArgb !== void 0) {
|
|
3661
|
+
lightLines.push(
|
|
3662
|
+
`const light${upperFirst(token)} = ${toFlutterColor(lightArgb)};`
|
|
3663
|
+
);
|
|
3664
|
+
}
|
|
3665
|
+
if (darkArgb !== void 0) {
|
|
3666
|
+
darkLines.push(
|
|
3667
|
+
`const dark${upperFirst(token)} = ${toFlutterColor(darkArgb)};`
|
|
3668
|
+
);
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3671
|
+
sections.push([...lightLines, ...darkLines].join("\n"));
|
|
3672
|
+
}
|
|
3673
|
+
return "\n\n" + sections.join("\n\n");
|
|
3674
|
+
}
|
|
3675
|
+
const header = "import 'package:flutter/material.dart';";
|
|
3676
|
+
const light = buildColorScheme(
|
|
3677
|
+
"lightColorScheme",
|
|
3678
|
+
"light",
|
|
3679
|
+
mergedColorsLight
|
|
3680
|
+
);
|
|
3681
|
+
const dark = buildColorScheme("darkColorScheme", "dark", mergedColorsDark);
|
|
3682
|
+
const custom = buildCustomColors();
|
|
3683
|
+
return `${header}
|
|
3684
|
+
|
|
3685
|
+
${light}
|
|
3686
|
+
|
|
3687
|
+
${dark}${custom}
|
|
3688
|
+
`;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
// src/lib/builder.json.ts
|
|
3692
|
+
import {
|
|
3693
|
+
argbFromHex,
|
|
3694
|
+
DynamicScheme,
|
|
3695
|
+
Hct,
|
|
3696
|
+
hexFromArgb as hexFromArgb4,
|
|
3697
|
+
MaterialDynamicColors,
|
|
3698
|
+
TonalPalette
|
|
3699
|
+
} from "@material/material-color-utilities";
|
|
3700
|
+
var MTB_TONES = [
|
|
3701
|
+
0,
|
|
3702
|
+
5,
|
|
3703
|
+
10,
|
|
3704
|
+
15,
|
|
3705
|
+
20,
|
|
3706
|
+
25,
|
|
3707
|
+
30,
|
|
3708
|
+
35,
|
|
3709
|
+
40,
|
|
3710
|
+
50,
|
|
3711
|
+
60,
|
|
3712
|
+
70,
|
|
3713
|
+
80,
|
|
3714
|
+
90,
|
|
3715
|
+
95,
|
|
3716
|
+
98,
|
|
3717
|
+
99,
|
|
3718
|
+
100
|
|
3719
|
+
];
|
|
3720
|
+
var FIXTURE_TOKEN_ORDER = [
|
|
3721
|
+
"primary",
|
|
3722
|
+
"surfaceTint",
|
|
3723
|
+
"onPrimary",
|
|
3724
|
+
"primaryContainer",
|
|
3725
|
+
"onPrimaryContainer",
|
|
3726
|
+
"secondary",
|
|
3727
|
+
"onSecondary",
|
|
3728
|
+
"secondaryContainer",
|
|
3729
|
+
"onSecondaryContainer",
|
|
3730
|
+
"tertiary",
|
|
3731
|
+
"onTertiary",
|
|
3732
|
+
"tertiaryContainer",
|
|
3733
|
+
"onTertiaryContainer",
|
|
3734
|
+
"error",
|
|
3735
|
+
"onError",
|
|
3736
|
+
"errorContainer",
|
|
3737
|
+
"onErrorContainer",
|
|
3738
|
+
"background",
|
|
3739
|
+
"onBackground",
|
|
3740
|
+
"surface",
|
|
3741
|
+
"onSurface",
|
|
3742
|
+
"surfaceVariant",
|
|
3743
|
+
"onSurfaceVariant",
|
|
3744
|
+
"outline",
|
|
3745
|
+
"outlineVariant",
|
|
3746
|
+
"shadow",
|
|
3747
|
+
"scrim",
|
|
3748
|
+
"inverseSurface",
|
|
3749
|
+
"inverseOnSurface",
|
|
3750
|
+
"inversePrimary",
|
|
3751
|
+
"primaryFixed",
|
|
3752
|
+
"onPrimaryFixed",
|
|
3753
|
+
"primaryFixedDim",
|
|
3754
|
+
"onPrimaryFixedVariant",
|
|
3755
|
+
"secondaryFixed",
|
|
3756
|
+
"onSecondaryFixed",
|
|
3757
|
+
"secondaryFixedDim",
|
|
3758
|
+
"onSecondaryFixedVariant",
|
|
3759
|
+
"tertiaryFixed",
|
|
3760
|
+
"onTertiaryFixed",
|
|
3761
|
+
"tertiaryFixedDim",
|
|
3762
|
+
"onTertiaryFixedVariant",
|
|
3763
|
+
"surfaceDim",
|
|
3764
|
+
"surfaceBright",
|
|
3765
|
+
"surfaceContainerLowest",
|
|
3766
|
+
"surfaceContainerLow",
|
|
3767
|
+
"surfaceContainer",
|
|
3768
|
+
"surfaceContainerHigh",
|
|
3769
|
+
"surfaceContainerHighest"
|
|
3770
|
+
];
|
|
3771
|
+
function buildJson(ctx) {
|
|
3772
|
+
const {
|
|
3773
|
+
hexSource,
|
|
3774
|
+
sourceHct,
|
|
3775
|
+
effectiveSourceArgb,
|
|
3776
|
+
primaryHct,
|
|
3777
|
+
SchemeClass,
|
|
3778
|
+
scheme,
|
|
3779
|
+
primary,
|
|
3780
|
+
secondary,
|
|
3781
|
+
tertiary,
|
|
3782
|
+
error,
|
|
3783
|
+
neutral,
|
|
3784
|
+
neutralVariant,
|
|
3785
|
+
hexCustomColors
|
|
3786
|
+
} = ctx;
|
|
3787
|
+
const neuHct = neutral ? Hct.fromInt(argbFromHex(neutral)) : sourceHct;
|
|
3788
|
+
const nvHct = neutralVariant ? Hct.fromInt(argbFromHex(neutralVariant)) : sourceHct;
|
|
3789
|
+
const rawPalettes = {
|
|
3790
|
+
primary: TonalPalette.fromInt(effectiveSourceArgb),
|
|
3791
|
+
secondary: secondary ? TonalPalette.fromInt(argbFromHex(secondary)) : TonalPalette.fromHueAndChroma(sourceHct.hue, sourceHct.chroma / 3),
|
|
3792
|
+
tertiary: tertiary ? TonalPalette.fromInt(argbFromHex(tertiary)) : TonalPalette.fromHueAndChroma(
|
|
3793
|
+
(sourceHct.hue + 60) % 360,
|
|
3794
|
+
sourceHct.chroma / 2
|
|
3795
|
+
),
|
|
3796
|
+
neutral: TonalPalette.fromHueAndChroma(
|
|
3797
|
+
neuHct.hue,
|
|
3798
|
+
Math.min(neuHct.chroma / 12, 4)
|
|
3799
|
+
),
|
|
3800
|
+
"neutral-variant": TonalPalette.fromHueAndChroma(
|
|
3801
|
+
nvHct.hue,
|
|
3802
|
+
Math.min(nvHct.chroma / 6, 8)
|
|
3803
|
+
)
|
|
3804
|
+
};
|
|
3805
|
+
function buildJsonSchemes() {
|
|
3806
|
+
function extractSchemeColors(scheme2, backgroundScheme) {
|
|
3807
|
+
const colors = {};
|
|
3808
|
+
for (const tokenName of FIXTURE_TOKEN_ORDER) {
|
|
3809
|
+
const dynamicColor = MaterialDynamicColors[tokenName];
|
|
3810
|
+
const useScheme = backgroundScheme && (tokenName === "background" || tokenName === "onBackground") ? backgroundScheme : scheme2;
|
|
3811
|
+
colors[tokenName] = hexFromArgb4(
|
|
3812
|
+
dynamicColor.getArgb(useScheme)
|
|
3813
|
+
).toUpperCase();
|
|
3814
|
+
}
|
|
3815
|
+
return colors;
|
|
3816
|
+
}
|
|
3817
|
+
function resolveOverridePalette(hex, role) {
|
|
3818
|
+
if (!hex) return null;
|
|
3819
|
+
return new SchemeClass(Hct.fromInt(argbFromHex(hex)), false, 0)[role];
|
|
3820
|
+
}
|
|
3821
|
+
const secPalette = resolveOverridePalette(secondary, "primaryPalette");
|
|
3822
|
+
const terPalette = resolveOverridePalette(tertiary, "primaryPalette");
|
|
3823
|
+
const errPalette = resolveOverridePalette(error, "primaryPalette");
|
|
3824
|
+
const neuPalette = resolveOverridePalette(neutral, "neutralPalette");
|
|
3825
|
+
const nvPalette = resolveOverridePalette(
|
|
3826
|
+
neutralVariant,
|
|
3827
|
+
"neutralVariantPalette"
|
|
3828
|
+
);
|
|
3829
|
+
const jsonSchemes = {};
|
|
3830
|
+
const jsonContrastLevels = [
|
|
3831
|
+
{ name: "light", isDark: false, contrast: 0 },
|
|
3832
|
+
{ name: "light-medium-contrast", isDark: false, contrast: 0.5 },
|
|
3833
|
+
{ name: "light-high-contrast", isDark: false, contrast: 1 },
|
|
3834
|
+
{ name: "dark", isDark: true, contrast: 0 },
|
|
3835
|
+
{ name: "dark-medium-contrast", isDark: true, contrast: 0.5 },
|
|
3836
|
+
{ name: "dark-high-contrast", isDark: true, contrast: 1 }
|
|
3837
|
+
];
|
|
3838
|
+
for (const { name, isDark, contrast } of jsonContrastLevels) {
|
|
3839
|
+
const baseScheme = new SchemeClass(primaryHct, isDark, contrast);
|
|
3840
|
+
const composedScheme = new DynamicScheme({
|
|
3841
|
+
sourceColorArgb: effectiveSourceArgb,
|
|
3842
|
+
variant: schemeToVariant[scheme],
|
|
3843
|
+
contrastLevel: contrast,
|
|
3844
|
+
isDark,
|
|
3845
|
+
primaryPalette: baseScheme.primaryPalette,
|
|
3846
|
+
secondaryPalette: secPalette || baseScheme.secondaryPalette,
|
|
3847
|
+
tertiaryPalette: terPalette || baseScheme.tertiaryPalette,
|
|
3848
|
+
neutralPalette: neuPalette || baseScheme.neutralPalette,
|
|
3849
|
+
neutralVariantPalette: nvPalette || baseScheme.neutralVariantPalette
|
|
3850
|
+
});
|
|
3851
|
+
if (errPalette) composedScheme.errorPalette = errPalette;
|
|
3852
|
+
jsonSchemes[name] = extractSchemeColors(composedScheme, baseScheme);
|
|
3853
|
+
}
|
|
3854
|
+
return jsonSchemes;
|
|
3855
|
+
}
|
|
3856
|
+
function rawPalettesToJson() {
|
|
3857
|
+
const jsonPalettes = {};
|
|
3858
|
+
const RAW_PALETTE_NAMES = [
|
|
3859
|
+
"primary",
|
|
3860
|
+
"secondary",
|
|
3861
|
+
"tertiary",
|
|
3862
|
+
"neutral",
|
|
3863
|
+
"neutral-variant"
|
|
3864
|
+
];
|
|
3865
|
+
for (const name of RAW_PALETTE_NAMES) {
|
|
3866
|
+
const palette = rawPalettes[name];
|
|
3867
|
+
const tones = {};
|
|
3868
|
+
for (const tone of MTB_TONES) {
|
|
3869
|
+
tones[tone.toString()] = hexFromArgb4(palette.tone(tone)).toUpperCase();
|
|
3870
|
+
}
|
|
3871
|
+
jsonPalettes[name] = tones;
|
|
3872
|
+
}
|
|
3873
|
+
return jsonPalettes;
|
|
3874
|
+
}
|
|
3875
|
+
function buildCoreColors(opts) {
|
|
3876
|
+
const colors = { primary: opts.primary };
|
|
3877
|
+
if (opts.secondary) colors.secondary = opts.secondary.toUpperCase();
|
|
3878
|
+
if (opts.tertiary) colors.tertiary = opts.tertiary.toUpperCase();
|
|
3879
|
+
if (opts.error) colors.error = opts.error.toUpperCase();
|
|
3880
|
+
if (opts.neutral) colors.neutral = opts.neutral.toUpperCase();
|
|
3881
|
+
if (opts.neutralVariant)
|
|
3882
|
+
colors.neutralVariant = opts.neutralVariant.toUpperCase();
|
|
3883
|
+
return colors;
|
|
3884
|
+
}
|
|
3885
|
+
const seed = hexSource.toUpperCase();
|
|
3886
|
+
const coreColors = buildCoreColors({
|
|
3887
|
+
primary: (primary || hexSource).toUpperCase(),
|
|
3888
|
+
secondary,
|
|
3889
|
+
tertiary,
|
|
3890
|
+
error,
|
|
3891
|
+
neutral,
|
|
3892
|
+
neutralVariant
|
|
3893
|
+
});
|
|
3894
|
+
const extendedColors = hexCustomColors.map((c) => ({
|
|
3895
|
+
name: c.name,
|
|
3896
|
+
color: c.hex.toUpperCase(),
|
|
3897
|
+
description: "",
|
|
3898
|
+
harmonized: c.blend ?? DEFAULT_BLEND
|
|
3899
|
+
}));
|
|
3900
|
+
return {
|
|
3901
|
+
seed,
|
|
3902
|
+
coreColors,
|
|
3903
|
+
extendedColors,
|
|
3904
|
+
schemes: buildJsonSchemes(),
|
|
3905
|
+
palettes: rawPalettesToJson()
|
|
3906
|
+
};
|
|
3907
|
+
}
|
|
3908
|
+
|
|
3909
|
+
// src/lib/builder.tailwind.ts
|
|
3910
|
+
import { kebabCase as kebabCase3 } from "lodash-es";
|
|
3911
|
+
var SHADE_TO_TONE = [
|
|
3912
|
+
[50, 95],
|
|
3913
|
+
[100, 90],
|
|
3914
|
+
[200, 80],
|
|
3915
|
+
[300, 70],
|
|
3916
|
+
[400, 60],
|
|
3917
|
+
[500, 50],
|
|
3918
|
+
[600, 40],
|
|
3919
|
+
[700, 30],
|
|
3920
|
+
[800, 20],
|
|
3921
|
+
[900, 10],
|
|
3922
|
+
[950, 5]
|
|
3923
|
+
];
|
|
3924
|
+
var CORE_PALETTES = [
|
|
3925
|
+
"primary",
|
|
3926
|
+
"secondary",
|
|
3927
|
+
"tertiary",
|
|
3928
|
+
"error",
|
|
3929
|
+
"neutral",
|
|
3930
|
+
"neutral-variant"
|
|
3931
|
+
];
|
|
3932
|
+
var SHADCN_MAPPING = [
|
|
3933
|
+
["--background", "surface"],
|
|
3934
|
+
["--foreground", "on-surface"],
|
|
3935
|
+
["--card", "surface-container-low"],
|
|
3936
|
+
["--card-foreground", "on-surface"],
|
|
3937
|
+
["--popover", "surface-container-high"],
|
|
3938
|
+
["--popover-foreground", "on-surface"],
|
|
3939
|
+
["--primary", "primary"],
|
|
3940
|
+
["--primary-foreground", "on-primary"],
|
|
3941
|
+
["--secondary", "secondary-container"],
|
|
3942
|
+
["--secondary-foreground", "on-secondary-container"],
|
|
3943
|
+
["--muted", "surface-container-highest"],
|
|
3944
|
+
["--muted-foreground", "on-surface-variant"],
|
|
3945
|
+
["--accent", "secondary-container"],
|
|
3946
|
+
["--accent-foreground", "on-secondary-container"],
|
|
3947
|
+
["--destructive", "error"],
|
|
3948
|
+
["--border", "outline-variant"],
|
|
3949
|
+
["--input", "outline"],
|
|
3950
|
+
["--ring", "primary"],
|
|
3951
|
+
["--chart-1", "primary-fixed"],
|
|
3952
|
+
["--chart-2", "secondary-fixed"],
|
|
3953
|
+
["--chart-3", "tertiary-fixed"],
|
|
3954
|
+
["--chart-4", "primary-fixed-dim"],
|
|
3955
|
+
["--chart-5", "secondary-fixed-dim"],
|
|
3956
|
+
["--sidebar", "surface-container-low"],
|
|
3957
|
+
["--sidebar-foreground", "on-surface"],
|
|
3958
|
+
["--sidebar-primary", "primary"],
|
|
3959
|
+
["--sidebar-primary-foreground", "on-primary"],
|
|
3960
|
+
["--sidebar-accent", "secondary-container"],
|
|
3961
|
+
["--sidebar-accent-foreground", "on-secondary-container"],
|
|
3962
|
+
["--sidebar-border", "outline-variant"],
|
|
3963
|
+
["--sidebar-ring", "primary"]
|
|
3964
|
+
];
|
|
3965
|
+
function buildTailwind(ctx, options) {
|
|
3966
|
+
const { prefix, mergedColorsLight, hexCustomColors } = ctx;
|
|
3967
|
+
const lines = [];
|
|
3968
|
+
for (const name of Object.keys(mergedColorsLight)) {
|
|
3969
|
+
const kebab = kebabCase3(name);
|
|
3970
|
+
lines.push(`--color-${kebab}: var(--${prefix}-sys-color-${kebab});`);
|
|
3971
|
+
}
|
|
3972
|
+
lines.push("");
|
|
3973
|
+
lines.push("/* Shades */");
|
|
3974
|
+
for (const palette of CORE_PALETTES) {
|
|
3975
|
+
lines.push("");
|
|
3976
|
+
for (const [shade, tone] of SHADE_TO_TONE) {
|
|
3977
|
+
lines.push(
|
|
3978
|
+
`--color-${palette}-${shade}: var(--${prefix}-ref-palette-${palette}-${tone});`
|
|
3979
|
+
);
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
if (hexCustomColors.length > 0) {
|
|
3983
|
+
for (const customColor of hexCustomColors) {
|
|
3984
|
+
const kebab = kebabCase3(customColor.name);
|
|
3985
|
+
lines.push("");
|
|
3986
|
+
for (const [shade, tone] of SHADE_TO_TONE) {
|
|
3987
|
+
lines.push(
|
|
3988
|
+
`--color-${kebab}-${shade}: var(--${prefix}-ref-palette-${kebab}-${tone});`
|
|
3989
|
+
);
|
|
3990
|
+
}
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
let output = `@theme inline {
|
|
3994
|
+
${lines.join("\n ")}
|
|
3995
|
+
}
|
|
3996
|
+
`;
|
|
3997
|
+
if (options?.shadcn) {
|
|
3998
|
+
const shadcnLines = SHADCN_MAPPING.map(
|
|
3999
|
+
([shadcnVar, m3Token]) => `${shadcnVar}: var(--${prefix}-sys-color-${m3Token});`
|
|
4000
|
+
);
|
|
4001
|
+
output += `
|
|
4002
|
+
:root,
|
|
4003
|
+
.dark {
|
|
4004
|
+
${shadcnLines.join("\n ")}
|
|
4005
|
+
}
|
|
4006
|
+
`;
|
|
4007
|
+
}
|
|
4008
|
+
return output;
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
// src/lib/builder.ts
|
|
4012
|
+
var schemesMap = {
|
|
4013
|
+
tonalSpot: SchemeTonalSpot,
|
|
4014
|
+
monochrome: SchemeMonochrome,
|
|
4015
|
+
neutral: SchemeNeutral,
|
|
4016
|
+
vibrant: SchemeVibrant,
|
|
4017
|
+
expressive: SchemeExpressive,
|
|
4018
|
+
fidelity: SchemeFidelity,
|
|
4019
|
+
content: SchemeContent
|
|
4020
|
+
};
|
|
4021
|
+
var DEFAULT_SCHEME = "tonalSpot";
|
|
4022
|
+
var DEFAULT_CONTRAST = 0;
|
|
4023
|
+
var DEFAULT_CUSTOM_COLORS = [];
|
|
4024
|
+
var DEFAULT_BLEND = true;
|
|
4025
|
+
var DEFAULT_PREFIX = "md";
|
|
4026
|
+
var STANDARD_TONES = [
|
|
4027
|
+
0,
|
|
4028
|
+
4,
|
|
4029
|
+
5,
|
|
4030
|
+
6,
|
|
4031
|
+
10,
|
|
4032
|
+
12,
|
|
4033
|
+
15,
|
|
4034
|
+
17,
|
|
4035
|
+
20,
|
|
4036
|
+
22,
|
|
4037
|
+
24,
|
|
4038
|
+
25,
|
|
4039
|
+
30,
|
|
4040
|
+
35,
|
|
4041
|
+
40,
|
|
4042
|
+
50,
|
|
4043
|
+
60,
|
|
4044
|
+
70,
|
|
4045
|
+
80,
|
|
4046
|
+
87,
|
|
4047
|
+
90,
|
|
4048
|
+
92,
|
|
4049
|
+
94,
|
|
4050
|
+
95,
|
|
4051
|
+
96,
|
|
4052
|
+
98,
|
|
4053
|
+
99,
|
|
4054
|
+
100
|
|
4055
|
+
];
|
|
4056
|
+
var Variant = {
|
|
4057
|
+
MONOCHROME: 0,
|
|
4058
|
+
NEUTRAL: 1,
|
|
4059
|
+
TONAL_SPOT: 2,
|
|
4060
|
+
VIBRANT: 3,
|
|
4061
|
+
EXPRESSIVE: 4,
|
|
4062
|
+
FIDELITY: 5,
|
|
4063
|
+
CONTENT: 6,
|
|
4064
|
+
RAINBOW: 7,
|
|
4065
|
+
FRUIT_SALAD: 8
|
|
4066
|
+
};
|
|
4067
|
+
var schemeToVariant = {
|
|
4068
|
+
monochrome: Variant.MONOCHROME,
|
|
4069
|
+
neutral: Variant.NEUTRAL,
|
|
4070
|
+
tonalSpot: Variant.TONAL_SPOT,
|
|
4071
|
+
vibrant: Variant.VIBRANT,
|
|
4072
|
+
expressive: Variant.EXPRESSIVE,
|
|
4073
|
+
fidelity: Variant.FIDELITY,
|
|
4074
|
+
content: Variant.CONTENT
|
|
4075
|
+
};
|
|
4076
|
+
var tokenDescriptions = {
|
|
4077
|
+
background: "Default background color for screens and large surfaces.",
|
|
4078
|
+
error: "Color for error states, used on elements like error text and icons.",
|
|
4079
|
+
errorContainer: "Fill color for error container elements like error banners.",
|
|
4080
|
+
inverseOnSurface: "Color for text and icons on inverse surface backgrounds.",
|
|
4081
|
+
inversePrimary: "Primary color used on inverse surface, e.g. buttons on snackbars.",
|
|
4082
|
+
inverseSurface: "Background for elements that require reverse contrast, such as snackbars.",
|
|
4083
|
+
onBackground: "Color for text and icons displayed on the background.",
|
|
4084
|
+
onError: "Color for text and icons on error-colored elements.",
|
|
4085
|
+
onErrorContainer: "Color for text and icons on error container elements.",
|
|
4086
|
+
onPrimary: "Color for text and icons on primary-colored elements like filled buttons.",
|
|
4087
|
+
onPrimaryContainer: "Color for text and icons on primary container elements like tonal buttons.",
|
|
4088
|
+
onPrimaryFixed: "Color for text and icons on primary fixed elements, constant across themes.",
|
|
4089
|
+
onPrimaryFixedVariant: "Lower-emphasis color for text and icons on primary fixed elements.",
|
|
4090
|
+
onSecondary: "Color for text and icons on secondary-colored elements.",
|
|
4091
|
+
onSecondaryContainer: "Color for text and icons on secondary container elements.",
|
|
4092
|
+
onSecondaryFixed: "Color for text and icons on secondary fixed elements, constant across themes.",
|
|
4093
|
+
onSecondaryFixedVariant: "Lower-emphasis color for text and icons on secondary fixed elements.",
|
|
4094
|
+
onSurface: "High-emphasis color for text and icons on surface backgrounds.",
|
|
4095
|
+
onSurfaceVariant: "Medium-emphasis color for text and icons on surface variant backgrounds.",
|
|
4096
|
+
onTertiary: "Color for text and icons on tertiary-colored elements.",
|
|
4097
|
+
onTertiaryContainer: "Color for text and icons on tertiary container elements.",
|
|
4098
|
+
onTertiaryFixed: "Color for text and icons on tertiary fixed elements, constant across themes.",
|
|
4099
|
+
onTertiaryFixedVariant: "Lower-emphasis color for text and icons on tertiary fixed elements.",
|
|
4100
|
+
outline: "Subtle color for borders and dividers to create visual separation.",
|
|
4101
|
+
outlineVariant: "Lower-emphasis border color used for decorative dividers.",
|
|
4102
|
+
primary: "Main brand color, used for key components like filled buttons and active states.",
|
|
4103
|
+
primaryContainer: "Fill color for large primary elements like cards and tonal buttons.",
|
|
4104
|
+
primaryFixed: "Fixed primary color that stays the same in light and dark themes.",
|
|
4105
|
+
primaryFixedDim: "Dimmed variant of the fixed primary color for lower emphasis.",
|
|
4106
|
+
scrim: "Color overlay for modals and dialogs to obscure background content.",
|
|
4107
|
+
secondary: "Accent color for less prominent elements like filter chips and selections.",
|
|
4108
|
+
secondaryContainer: "Fill color for secondary container elements like tonal buttons and input fields.",
|
|
4109
|
+
secondaryFixed: "Fixed secondary color that stays the same in light and dark themes.",
|
|
4110
|
+
secondaryFixedDim: "Dimmed variant of the fixed secondary color for lower emphasis.",
|
|
4111
|
+
shadow: "Color for elevation shadows applied to surfaces and components.",
|
|
4112
|
+
surface: "Default surface color for cards, sheets, and dialogs.",
|
|
4113
|
+
surfaceBright: "Brightest surface variant, used for elevated surfaces in dark themes.",
|
|
4114
|
+
surfaceContainer: "Middle-emphasis container color for grouping related content.",
|
|
4115
|
+
surfaceContainerHigh: "Higher-emphasis container color for elements like cards.",
|
|
4116
|
+
surfaceContainerHighest: "Highest-emphasis container color for text fields and other input areas.",
|
|
4117
|
+
surfaceContainerLow: "Lower-emphasis container color for subtle surface groupings.",
|
|
4118
|
+
surfaceContainerLowest: "Lowest-emphasis container, typically the lightest surface in light theme.",
|
|
4119
|
+
surfaceDim: "Dimmest surface variant, used for recessed areas or dark theme backgrounds.",
|
|
4120
|
+
surfaceTint: "Tint color applied to surfaces for subtle primary color elevation overlay.",
|
|
4121
|
+
surfaceVariant: "Alternative surface color for differentiated areas like sidebar backgrounds.",
|
|
4122
|
+
tertiary: "Third accent color for complementary elements that balance primary and secondary.",
|
|
4123
|
+
tertiaryContainer: "Fill color for tertiary container elements like complementary cards.",
|
|
4124
|
+
tertiaryFixed: "Fixed tertiary color that stays the same in light and dark themes.",
|
|
4125
|
+
tertiaryFixedDim: "Dimmed variant of the fixed tertiary color for lower emphasis."
|
|
4126
|
+
};
|
|
4127
|
+
function isTokenName(key) {
|
|
4128
|
+
return key in tokenDescriptions;
|
|
4129
|
+
}
|
|
4130
|
+
var tokenNames = Object.keys(tokenDescriptions).filter(isTokenName);
|
|
4131
|
+
function deriveCustomPaletteName(tokenName, allPaletteNamesKebab) {
|
|
4132
|
+
let baseName = tokenName;
|
|
4133
|
+
if (/^on[A-Z]/.test(baseName) && baseName.length > 2) {
|
|
4134
|
+
baseName = baseName.charAt(2).toLowerCase() + baseName.slice(3);
|
|
4135
|
+
}
|
|
4136
|
+
if (baseName.endsWith("Container")) {
|
|
4137
|
+
baseName = baseName.slice(0, -"Container".length);
|
|
4138
|
+
}
|
|
4139
|
+
const kebab = kebabCase4(baseName);
|
|
4140
|
+
return allPaletteNamesKebab.has(kebab) ? kebab : void 0;
|
|
4141
|
+
}
|
|
4142
|
+
function toRecord(arr, getEntry) {
|
|
4143
|
+
return Object.fromEntries(arr.map(getEntry));
|
|
4144
|
+
}
|
|
4145
|
+
function getPalette(palettes, colorName) {
|
|
4146
|
+
const palette = palettes[colorName];
|
|
4147
|
+
if (!palette) {
|
|
4148
|
+
throw new Error(
|
|
4149
|
+
`Custom color palette not found for '${colorName}'. This is likely a bug in the implementation.`
|
|
4150
|
+
);
|
|
4151
|
+
}
|
|
4152
|
+
return palette;
|
|
4153
|
+
}
|
|
4154
|
+
function mergeBaseAndCustomColors(scheme, customColors, colorPalettes) {
|
|
4155
|
+
const baseVars = toRecord(tokenNames, (tokenName) => {
|
|
4156
|
+
const dynamicColor = MaterialDynamicColors2[tokenName];
|
|
4157
|
+
const argb = dynamicColor.getArgb(scheme);
|
|
4158
|
+
return [tokenName, argb];
|
|
4159
|
+
});
|
|
4160
|
+
const customVars = {};
|
|
4161
|
+
customColors.forEach((color) => {
|
|
4162
|
+
const colorname = color.name;
|
|
4163
|
+
const getPaletteForColor = () => getPalette(colorPalettes, colorname);
|
|
4164
|
+
const colorDynamicColor = new DynamicColor(
|
|
4165
|
+
colorname,
|
|
4166
|
+
getPaletteForColor,
|
|
4167
|
+
(s) => s.isDark ? 80 : 40,
|
|
4168
|
+
// Main color: lighter in dark mode, darker in light mode
|
|
4169
|
+
true
|
|
4170
|
+
// background
|
|
4171
|
+
);
|
|
4172
|
+
const onColorDynamicColor = new DynamicColor(
|
|
4173
|
+
`on${upperFirst2(colorname)}`,
|
|
4174
|
+
getPaletteForColor,
|
|
4175
|
+
(s) => s.isDark ? 20 : 100,
|
|
4176
|
+
// Text on main color: high contrast (dark on light, light on dark)
|
|
4177
|
+
false
|
|
4178
|
+
);
|
|
4179
|
+
const containerDynamicColor = new DynamicColor(
|
|
4180
|
+
`${colorname}Container`,
|
|
4181
|
+
getPaletteForColor,
|
|
4182
|
+
(s) => s.isDark ? 30 : 90,
|
|
4183
|
+
// Container: subtle variant (darker in dark mode, lighter in light mode)
|
|
4184
|
+
true
|
|
4185
|
+
// background
|
|
4186
|
+
);
|
|
4187
|
+
const onContainerDynamicColor = new DynamicColor(
|
|
4188
|
+
`on${upperFirst2(colorname)}Container`,
|
|
4189
|
+
getPaletteForColor,
|
|
4190
|
+
(s) => s.isDark ? 90 : 30,
|
|
4191
|
+
// Text on container: high contrast against container background
|
|
4192
|
+
false
|
|
4193
|
+
);
|
|
4194
|
+
customVars[colorname] = colorDynamicColor.getArgb(scheme);
|
|
4195
|
+
customVars[`on${upperFirst2(colorname)}`] = onColorDynamicColor.getArgb(scheme);
|
|
4196
|
+
customVars[`${colorname}Container`] = containerDynamicColor.getArgb(scheme);
|
|
4197
|
+
customVars[`on${upperFirst2(colorname)}Container`] = onContainerDynamicColor.getArgb(scheme);
|
|
4198
|
+
});
|
|
4199
|
+
return { ...baseVars, ...customVars };
|
|
4200
|
+
}
|
|
4201
|
+
function createColorPalette(colorDef, baseScheme, effectiveSourceForHarmonization) {
|
|
4202
|
+
const colorArgb = argbFromHex2(colorDef.hex);
|
|
4203
|
+
const harmonizedArgb = colorDef.blend ? Blend.harmonize(colorArgb, effectiveSourceForHarmonization) : colorArgb;
|
|
4204
|
+
const hct = Hct2.fromInt(harmonizedArgb);
|
|
4205
|
+
let targetChroma;
|
|
4206
|
+
if (colorDef.core && colorDef.chromaSource) {
|
|
4207
|
+
if (colorDef.chromaSource === "neutral") {
|
|
4208
|
+
targetChroma = baseScheme.neutralPalette.chroma;
|
|
4209
|
+
} else if (colorDef.chromaSource === "neutralVariant") {
|
|
4210
|
+
targetChroma = baseScheme.neutralVariantPalette.chroma;
|
|
4211
|
+
} else {
|
|
4212
|
+
targetChroma = baseScheme.primaryPalette.chroma;
|
|
4213
|
+
}
|
|
4214
|
+
} else {
|
|
4215
|
+
targetChroma = baseScheme.primaryPalette.chroma;
|
|
4216
|
+
}
|
|
4217
|
+
return TonalPalette2.fromHueAndChroma(hct.hue, targetChroma);
|
|
4218
|
+
}
|
|
4219
|
+
function buildTokenToPaletteMap(schemePalettes, scheme) {
|
|
4220
|
+
const result = {};
|
|
4221
|
+
for (const propName of Object.getOwnPropertyNames(MaterialDynamicColors2)) {
|
|
4222
|
+
const dc = Object.getOwnPropertyDescriptor(
|
|
4223
|
+
MaterialDynamicColors2,
|
|
4224
|
+
propName
|
|
4225
|
+
)?.value;
|
|
4226
|
+
if (!(dc instanceof DynamicColor)) continue;
|
|
4227
|
+
const palette = dc.palette(scheme);
|
|
4228
|
+
for (const [palName, pal] of schemePalettes) {
|
|
4229
|
+
if (palette === pal) {
|
|
4230
|
+
result[propName] = palName;
|
|
4231
|
+
break;
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
return result;
|
|
4236
|
+
}
|
|
4237
|
+
function builder(hexSource, {
|
|
4238
|
+
scheme = DEFAULT_SCHEME,
|
|
4239
|
+
contrast = DEFAULT_CONTRAST,
|
|
4240
|
+
primary,
|
|
4241
|
+
secondary,
|
|
4242
|
+
tertiary,
|
|
4243
|
+
neutral,
|
|
4244
|
+
neutralVariant,
|
|
4245
|
+
error,
|
|
4246
|
+
customColors: hexCustomColors = DEFAULT_CUSTOM_COLORS,
|
|
4247
|
+
prefix = DEFAULT_PREFIX
|
|
4248
|
+
} = {}) {
|
|
4249
|
+
const sourceArgb = argbFromHex2(hexSource);
|
|
4250
|
+
const sourceHct = Hct2.fromInt(sourceArgb);
|
|
4251
|
+
const effectiveSource = primary || hexSource;
|
|
4252
|
+
const effectiveSourceArgb = argbFromHex2(effectiveSource);
|
|
4253
|
+
const effectiveSourceForHarmonization = primary ? argbFromHex2(primary) : sourceArgb;
|
|
4254
|
+
const SchemeClass = schemesMap[scheme];
|
|
4255
|
+
const primaryHct = Hct2.fromInt(effectiveSourceArgb);
|
|
4256
|
+
const baseScheme = new SchemeClass(primaryHct, false, contrast);
|
|
4257
|
+
const allColors = [
|
|
4258
|
+
// Core colors (hex may be undefined)
|
|
4259
|
+
{
|
|
4260
|
+
name: "primary",
|
|
4261
|
+
hex: primary,
|
|
4262
|
+
core: true,
|
|
4263
|
+
chromaSource: "primary"
|
|
4264
|
+
},
|
|
4265
|
+
{
|
|
4266
|
+
name: "secondary",
|
|
4267
|
+
hex: secondary,
|
|
4268
|
+
core: true,
|
|
4269
|
+
chromaSource: "primary"
|
|
4270
|
+
},
|
|
4271
|
+
{
|
|
4272
|
+
name: "tertiary",
|
|
4273
|
+
hex: tertiary,
|
|
4274
|
+
core: true,
|
|
4275
|
+
chromaSource: "primary"
|
|
4276
|
+
},
|
|
4277
|
+
{ name: "error", hex: error, core: true, chromaSource: "primary" },
|
|
4278
|
+
{
|
|
4279
|
+
name: "neutral",
|
|
4280
|
+
hex: neutral,
|
|
4281
|
+
core: true,
|
|
4282
|
+
chromaSource: "neutral"
|
|
4283
|
+
},
|
|
4284
|
+
{
|
|
4285
|
+
name: "neutralVariant",
|
|
4286
|
+
hex: neutralVariant,
|
|
4287
|
+
core: true,
|
|
4288
|
+
chromaSource: "neutralVariant"
|
|
4289
|
+
},
|
|
4290
|
+
//
|
|
4291
|
+
// Custom colors
|
|
4292
|
+
//
|
|
4293
|
+
...hexCustomColors.map((c) => ({
|
|
4294
|
+
name: c.name,
|
|
4295
|
+
hex: c.hex,
|
|
4296
|
+
blend: c.blend,
|
|
4297
|
+
core: false
|
|
4298
|
+
}))
|
|
4299
|
+
];
|
|
4300
|
+
const definedColors = allColors.filter(
|
|
4301
|
+
(c) => c.hex !== void 0
|
|
4302
|
+
);
|
|
4303
|
+
const colorPalettes = Object.fromEntries(
|
|
4304
|
+
definedColors.map((colorDef) => [
|
|
4305
|
+
colorDef.name,
|
|
4306
|
+
createColorPalette(colorDef, baseScheme, effectiveSourceForHarmonization)
|
|
4307
|
+
])
|
|
4308
|
+
);
|
|
4309
|
+
const variant = schemeToVariant[scheme];
|
|
4310
|
+
const schemeConfig = {
|
|
4311
|
+
sourceColorArgb: effectiveSourceArgb,
|
|
4312
|
+
variant,
|
|
4313
|
+
contrastLevel: contrast,
|
|
4314
|
+
primaryPalette: colorPalettes["primary"] || baseScheme.primaryPalette,
|
|
4315
|
+
secondaryPalette: colorPalettes["secondary"] || baseScheme.secondaryPalette,
|
|
4316
|
+
tertiaryPalette: colorPalettes["tertiary"] || baseScheme.tertiaryPalette,
|
|
4317
|
+
neutralPalette: colorPalettes["neutral"] || baseScheme.neutralPalette,
|
|
4318
|
+
neutralVariantPalette: colorPalettes["neutralVariant"] || baseScheme.neutralVariantPalette
|
|
4319
|
+
};
|
|
4320
|
+
const lightScheme = new DynamicScheme2({ ...schemeConfig, isDark: false });
|
|
4321
|
+
const darkScheme = new DynamicScheme2({ ...schemeConfig, isDark: true });
|
|
4322
|
+
const errorPalette = colorPalettes["error"];
|
|
4323
|
+
if (errorPalette) {
|
|
4324
|
+
lightScheme.errorPalette = errorPalette;
|
|
4325
|
+
darkScheme.errorPalette = errorPalette;
|
|
4326
|
+
}
|
|
4327
|
+
const allPalettes = {
|
|
4328
|
+
primary: lightScheme.primaryPalette,
|
|
4329
|
+
secondary: lightScheme.secondaryPalette,
|
|
4330
|
+
tertiary: lightScheme.tertiaryPalette,
|
|
4331
|
+
error: lightScheme.errorPalette,
|
|
4332
|
+
neutral: lightScheme.neutralPalette,
|
|
4333
|
+
"neutral-variant": lightScheme.neutralVariantPalette,
|
|
4334
|
+
// Add custom color palettes
|
|
4335
|
+
...Object.fromEntries(
|
|
4336
|
+
definedColors.filter((c) => !c.core).map((colorDef) => [colorDef.name, colorPalettes[colorDef.name]])
|
|
4337
|
+
)
|
|
4338
|
+
};
|
|
4339
|
+
const customColors = definedColors.filter((c) => !c.core).map((c) => ({
|
|
4340
|
+
name: c.name,
|
|
4341
|
+
blend: c.blend ?? DEFAULT_BLEND,
|
|
4342
|
+
value: argbFromHex2(c.hex)
|
|
4343
|
+
}));
|
|
4344
|
+
const mergedColorsLight = mergeBaseAndCustomColors(
|
|
4345
|
+
lightScheme,
|
|
4346
|
+
customColors,
|
|
4347
|
+
colorPalettes
|
|
4348
|
+
);
|
|
4349
|
+
const mergedColorsDark = mergeBaseAndCustomColors(
|
|
4350
|
+
darkScheme,
|
|
4351
|
+
customColors,
|
|
4352
|
+
colorPalettes
|
|
4353
|
+
);
|
|
4354
|
+
const schemePalettes = [
|
|
4355
|
+
["primary", lightScheme.primaryPalette],
|
|
4356
|
+
["secondary", lightScheme.secondaryPalette],
|
|
4357
|
+
["tertiary", lightScheme.tertiaryPalette],
|
|
4358
|
+
["error", lightScheme.errorPalette],
|
|
4359
|
+
["neutral", lightScheme.neutralPalette],
|
|
4360
|
+
["neutral-variant", lightScheme.neutralVariantPalette]
|
|
4361
|
+
];
|
|
4362
|
+
const tokenToPalette = buildTokenToPaletteMap(schemePalettes, lightScheme);
|
|
4363
|
+
const allPaletteNamesKebab = new Set(Object.keys(allPalettes).map(kebabCase4));
|
|
4364
|
+
const ctx = {
|
|
4365
|
+
hexSource,
|
|
4366
|
+
prefix,
|
|
4367
|
+
scheme,
|
|
4368
|
+
primary,
|
|
4369
|
+
secondary,
|
|
4370
|
+
tertiary,
|
|
4371
|
+
neutral,
|
|
4372
|
+
neutralVariant,
|
|
4373
|
+
error,
|
|
4374
|
+
hexCustomColors,
|
|
4375
|
+
sourceHct,
|
|
4376
|
+
effectiveSourceArgb,
|
|
4377
|
+
primaryHct,
|
|
4378
|
+
SchemeClass,
|
|
4379
|
+
allPalettes,
|
|
4380
|
+
mergedColorsLight,
|
|
4381
|
+
mergedColorsDark,
|
|
4382
|
+
tokenToPalette,
|
|
4383
|
+
allPaletteNamesKebab
|
|
4384
|
+
};
|
|
4385
|
+
return {
|
|
4386
|
+
toCss: () => buildCss(ctx),
|
|
4387
|
+
toJson: () => buildJson(ctx),
|
|
4388
|
+
toFigmaVariables: () => buildFigmaVariables(ctx),
|
|
4389
|
+
toFigmaTokens: () => buildFigmaTokens(ctx),
|
|
4390
|
+
toTailwind: (options) => buildTailwind(ctx, options),
|
|
4391
|
+
toFlutter: () => buildFlutter(ctx),
|
|
4392
|
+
mergedColorsLight,
|
|
4393
|
+
mergedColorsDark,
|
|
4394
|
+
allPalettes
|
|
4395
|
+
};
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
// src/ExportButton.tsx
|
|
4399
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
4400
|
+
function ExportButton({ config }) {
|
|
4401
|
+
const handleExport = () => {
|
|
4402
|
+
try {
|
|
4403
|
+
const { source, ...rest } = config;
|
|
4404
|
+
const result = builder(source, rest);
|
|
4405
|
+
const files = result.toFigmaTokens();
|
|
4406
|
+
for (const [filename, content] of Object.entries(files)) {
|
|
4407
|
+
const blob = new Blob([JSON.stringify(content, null, 2)], {
|
|
4408
|
+
type: "application/json"
|
|
4409
|
+
});
|
|
4410
|
+
const url = URL.createObjectURL(blob);
|
|
4411
|
+
const a = document.createElement("a");
|
|
4412
|
+
a.href = url;
|
|
4413
|
+
a.download = filename;
|
|
4414
|
+
document.body.appendChild(a);
|
|
4415
|
+
a.click();
|
|
4416
|
+
document.body.removeChild(a);
|
|
4417
|
+
URL.revokeObjectURL(url);
|
|
4418
|
+
}
|
|
4419
|
+
console.log("Figma tokens exported successfully");
|
|
4420
|
+
} catch (error) {
|
|
4421
|
+
console.error("Failed to export Figma tokens:", error);
|
|
4422
|
+
alert(
|
|
4423
|
+
"Failed to export: " + (error instanceof Error ? error.message : String(error))
|
|
4424
|
+
);
|
|
4425
|
+
}
|
|
4426
|
+
};
|
|
4427
|
+
return /* @__PURE__ */ jsx2(
|
|
4428
|
+
Fab,
|
|
4429
|
+
{
|
|
4430
|
+
onClick: handleExport,
|
|
4431
|
+
title: "Export Figma Tokens",
|
|
4432
|
+
"aria-label": "Export Figma Tokens",
|
|
4433
|
+
className: "fixed z-50 bottom-6 right-6",
|
|
4434
|
+
children: /* @__PURE__ */ jsxs(
|
|
4435
|
+
"svg",
|
|
4436
|
+
{
|
|
4437
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4438
|
+
width: "24",
|
|
4439
|
+
height: "24",
|
|
4440
|
+
viewBox: "0 0 24 24",
|
|
4441
|
+
fill: "none",
|
|
4442
|
+
stroke: "currentColor",
|
|
4443
|
+
strokeWidth: "2",
|
|
4444
|
+
strokeLinecap: "round",
|
|
4445
|
+
strokeLinejoin: "round",
|
|
4446
|
+
children: [
|
|
4447
|
+
/* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
4448
|
+
/* @__PURE__ */ jsx2("polyline", { points: "7 10 12 15 17 10" }),
|
|
4449
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
4450
|
+
]
|
|
4451
|
+
}
|
|
4452
|
+
)
|
|
4453
|
+
}
|
|
4454
|
+
);
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
// src/Mcu.tsx
|
|
4458
|
+
import { useMemo as useMemo2 } from "react";
|
|
4459
|
+
|
|
4460
|
+
// src/Mcu.context.tsx
|
|
4461
|
+
import {
|
|
4462
|
+
hexFromArgb as hexFromArgb5
|
|
4463
|
+
} from "@material/material-color-utilities";
|
|
4464
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
4465
|
+
|
|
4466
|
+
// src/lib/createRequiredContext.ts
|
|
4467
|
+
import { createContext, useContext } from "react";
|
|
4468
|
+
var createRequiredContext = () => {
|
|
4469
|
+
const Ctx = createContext(null);
|
|
4470
|
+
const useCtx = () => {
|
|
4471
|
+
const contextValue = useContext(Ctx);
|
|
4472
|
+
if (contextValue === null) {
|
|
4473
|
+
throw new Error("Context value is null");
|
|
4474
|
+
}
|
|
4475
|
+
return contextValue;
|
|
4476
|
+
};
|
|
4477
|
+
return [useCtx, Ctx.Provider, Ctx];
|
|
4478
|
+
};
|
|
4479
|
+
|
|
4480
|
+
// src/Mcu.context.tsx
|
|
4481
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
4482
|
+
var [useMcu, Provider, McuContext] = createRequiredContext();
|
|
4483
|
+
var McuProvider = ({
|
|
4484
|
+
styleId,
|
|
4485
|
+
children,
|
|
4486
|
+
...configProps
|
|
4487
|
+
}) => {
|
|
4488
|
+
const [initials] = useState(() => configProps);
|
|
4489
|
+
const [mcuConfig, setMcuConfig] = useState(initials);
|
|
4490
|
+
const configKey = JSON.stringify(configProps);
|
|
4491
|
+
React.useEffect(() => {
|
|
4492
|
+
setMcuConfig(configProps);
|
|
4493
|
+
}, [configKey]);
|
|
4494
|
+
const {
|
|
4495
|
+
css,
|
|
4496
|
+
mergedColorsLight,
|
|
4497
|
+
mergedColorsDark,
|
|
4498
|
+
allPalettes,
|
|
4499
|
+
figmaTokens,
|
|
4500
|
+
figmaVariables
|
|
4501
|
+
} = useMemo(() => {
|
|
4502
|
+
const { toCss, toFigmaTokens, toFigmaVariables, ...rest } = builder(
|
|
4503
|
+
mcuConfig.source,
|
|
4504
|
+
mcuConfig
|
|
4505
|
+
);
|
|
4506
|
+
return {
|
|
4507
|
+
css: toCss(),
|
|
4508
|
+
figmaTokens: toFigmaTokens(),
|
|
4509
|
+
figmaVariables: toFigmaVariables(),
|
|
4510
|
+
...rest
|
|
4511
|
+
};
|
|
4512
|
+
}, [mcuConfig]);
|
|
4513
|
+
const getMcuColor = useCallback(
|
|
4514
|
+
(colorName, theme) => {
|
|
4515
|
+
const mergedColors = theme === "light" ? mergedColorsLight : mergedColorsDark;
|
|
4516
|
+
const colorValue = mergedColors[colorName];
|
|
4517
|
+
if (colorValue === void 0) {
|
|
4518
|
+
throw new Error(`Unknown MCU token '${colorName}'`);
|
|
4519
|
+
}
|
|
4520
|
+
return hexFromArgb5(colorValue);
|
|
4521
|
+
},
|
|
4522
|
+
[mergedColorsDark, mergedColorsLight]
|
|
4523
|
+
);
|
|
4524
|
+
const value = useMemo(
|
|
4525
|
+
() => ({
|
|
4526
|
+
initials,
|
|
4527
|
+
mcuConfig,
|
|
4528
|
+
setMcuConfig,
|
|
4529
|
+
getMcuColor,
|
|
4530
|
+
allPalettes,
|
|
4531
|
+
figmaTokens,
|
|
4532
|
+
figmaVariables
|
|
4533
|
+
}),
|
|
4534
|
+
[
|
|
4535
|
+
getMcuColor,
|
|
4536
|
+
initials,
|
|
4537
|
+
mcuConfig,
|
|
4538
|
+
allPalettes,
|
|
4539
|
+
figmaTokens,
|
|
4540
|
+
figmaVariables
|
|
4541
|
+
]
|
|
4542
|
+
);
|
|
4543
|
+
return /* @__PURE__ */ jsxs2(Provider, { value, children: [
|
|
4544
|
+
/* @__PURE__ */ jsx3("style", { id: styleId, dangerouslySetInnerHTML: { __html: css } }),
|
|
4545
|
+
children
|
|
4546
|
+
] });
|
|
4547
|
+
};
|
|
4548
|
+
|
|
4549
|
+
// src/Mcu.tsx
|
|
4550
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
4551
|
+
var mcuStyleId = "mcu-styles";
|
|
4552
|
+
var DEFAULT_COLOR_MATCH = false;
|
|
4553
|
+
function Mcu({
|
|
4554
|
+
source,
|
|
4555
|
+
scheme = DEFAULT_SCHEME,
|
|
4556
|
+
contrast = DEFAULT_CONTRAST,
|
|
4557
|
+
primary,
|
|
4558
|
+
secondary,
|
|
4559
|
+
tertiary,
|
|
4560
|
+
neutral,
|
|
4561
|
+
neutralVariant,
|
|
4562
|
+
error,
|
|
4563
|
+
colorMatch = DEFAULT_COLOR_MATCH,
|
|
4564
|
+
customColors = DEFAULT_CUSTOM_COLORS,
|
|
4565
|
+
prefix = DEFAULT_PREFIX,
|
|
4566
|
+
children
|
|
4567
|
+
}) {
|
|
4568
|
+
const config = useMemo2(
|
|
4569
|
+
() => ({
|
|
4570
|
+
source,
|
|
4571
|
+
scheme,
|
|
4572
|
+
contrast,
|
|
4573
|
+
primary,
|
|
4574
|
+
secondary,
|
|
4575
|
+
tertiary,
|
|
4576
|
+
neutral,
|
|
4577
|
+
neutralVariant,
|
|
4578
|
+
error,
|
|
4579
|
+
colorMatch,
|
|
4580
|
+
customColors,
|
|
4581
|
+
prefix
|
|
4582
|
+
}),
|
|
4583
|
+
[
|
|
4584
|
+
contrast,
|
|
4585
|
+
customColors,
|
|
4586
|
+
scheme,
|
|
4587
|
+
source,
|
|
4588
|
+
primary,
|
|
4589
|
+
secondary,
|
|
4590
|
+
tertiary,
|
|
4591
|
+
neutral,
|
|
4592
|
+
neutralVariant,
|
|
4593
|
+
error,
|
|
4594
|
+
colorMatch,
|
|
4595
|
+
prefix
|
|
4596
|
+
]
|
|
4597
|
+
);
|
|
4598
|
+
return /* @__PURE__ */ jsx4(McuProvider, { ...config, styleId: mcuStyleId, children });
|
|
4599
|
+
}
|
|
4600
|
+
export {
|
|
4601
|
+
ExportButton,
|
|
4602
|
+
Mcu,
|
|
4603
|
+
useMcu
|
|
4604
|
+
};
|