bundle-mjs.mjs 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035
  1. const CLASS_PART_SEPARATOR = '-';
  2. const createClassGroupUtils = config => {
  3. const classMap = createClassMap(config);
  4. const {
  5. conflictingClassGroups,
  6. conflictingClassGroupModifiers
  7. } = config;
  8. const getClassGroupId = className => {
  9. const classParts = className.split(CLASS_PART_SEPARATOR);
  10. // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.
  11. if (classParts[0] === '' && classParts.length !== 1) {
  12. classParts.shift();
  13. }
  14. return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
  15. };
  16. const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
  17. const conflicts = conflictingClassGroups[classGroupId] || [];
  18. if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
  19. return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
  20. }
  21. return conflicts;
  22. };
  23. return {
  24. getClassGroupId,
  25. getConflictingClassGroupIds
  26. };
  27. };
  28. const getGroupRecursive = (classParts, classPartObject) => {
  29. if (classParts.length === 0) {
  30. return classPartObject.classGroupId;
  31. }
  32. const currentClassPart = classParts[0];
  33. const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
  34. const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
  35. if (classGroupFromNextClassPart) {
  36. return classGroupFromNextClassPart;
  37. }
  38. if (classPartObject.validators.length === 0) {
  39. return undefined;
  40. }
  41. const classRest = classParts.join(CLASS_PART_SEPARATOR);
  42. return classPartObject.validators.find(({
  43. validator
  44. }) => validator(classRest))?.classGroupId;
  45. };
  46. const arbitraryPropertyRegex = /^\[(.+)\]$/;
  47. const getGroupIdForArbitraryProperty = className => {
  48. if (arbitraryPropertyRegex.test(className)) {
  49. const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
  50. const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
  51. if (property) {
  52. // I use two dots here because one dot is used as prefix for class groups in plugins
  53. return 'arbitrary..' + property;
  54. }
  55. }
  56. };
  57. /**
  58. * Exported for testing only
  59. */
  60. const createClassMap = config => {
  61. const {
  62. theme,
  63. classGroups
  64. } = config;
  65. const classMap = {
  66. nextPart: new Map(),
  67. validators: []
  68. };
  69. for (const classGroupId in classGroups) {
  70. processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
  71. }
  72. return classMap;
  73. };
  74. const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
  75. classGroup.forEach(classDefinition => {
  76. if (typeof classDefinition === 'string') {
  77. const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
  78. classPartObjectToEdit.classGroupId = classGroupId;
  79. return;
  80. }
  81. if (typeof classDefinition === 'function') {
  82. if (isThemeGetter(classDefinition)) {
  83. processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
  84. return;
  85. }
  86. classPartObject.validators.push({
  87. validator: classDefinition,
  88. classGroupId
  89. });
  90. return;
  91. }
  92. Object.entries(classDefinition).forEach(([key, classGroup]) => {
  93. processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
  94. });
  95. });
  96. };
  97. const getPart = (classPartObject, path) => {
  98. let currentClassPartObject = classPartObject;
  99. path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
  100. if (!currentClassPartObject.nextPart.has(pathPart)) {
  101. currentClassPartObject.nextPart.set(pathPart, {
  102. nextPart: new Map(),
  103. validators: []
  104. });
  105. }
  106. currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
  107. });
  108. return currentClassPartObject;
  109. };
  110. const isThemeGetter = func => func.isThemeGetter;
  111. // LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance
  112. const createLruCache = maxCacheSize => {
  113. if (maxCacheSize < 1) {
  114. return {
  115. get: () => undefined,
  116. set: () => {}
  117. };
  118. }
  119. let cacheSize = 0;
  120. let cache = new Map();
  121. let previousCache = new Map();
  122. const update = (key, value) => {
  123. cache.set(key, value);
  124. cacheSize++;
  125. if (cacheSize > maxCacheSize) {
  126. cacheSize = 0;
  127. previousCache = cache;
  128. cache = new Map();
  129. }
  130. };
  131. return {
  132. get(key) {
  133. let value = cache.get(key);
  134. if (value !== undefined) {
  135. return value;
  136. }
  137. if ((value = previousCache.get(key)) !== undefined) {
  138. update(key, value);
  139. return value;
  140. }
  141. },
  142. set(key, value) {
  143. if (cache.has(key)) {
  144. cache.set(key, value);
  145. } else {
  146. update(key, value);
  147. }
  148. }
  149. };
  150. };
  151. const IMPORTANT_MODIFIER = '!';
  152. const MODIFIER_SEPARATOR = ':';
  153. const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
  154. const createParseClassName = config => {
  155. const {
  156. prefix,
  157. experimentalParseClassName
  158. } = config;
  159. /**
  160. * Parse class name into parts.
  161. *
  162. * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
  163. * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
  164. */
  165. let parseClassName = className => {
  166. const modifiers = [];
  167. let bracketDepth = 0;
  168. let parenDepth = 0;
  169. let modifierStart = 0;
  170. let postfixModifierPosition;
  171. for (let index = 0; index < className.length; index++) {
  172. let currentCharacter = className[index];
  173. if (bracketDepth === 0 && parenDepth === 0) {
  174. if (currentCharacter === MODIFIER_SEPARATOR) {
  175. modifiers.push(className.slice(modifierStart, index));
  176. modifierStart = index + MODIFIER_SEPARATOR_LENGTH;
  177. continue;
  178. }
  179. if (currentCharacter === '/') {
  180. postfixModifierPosition = index;
  181. continue;
  182. }
  183. }
  184. if (currentCharacter === '[') {
  185. bracketDepth++;
  186. } else if (currentCharacter === ']') {
  187. bracketDepth--;
  188. } else if (currentCharacter === '(') {
  189. parenDepth++;
  190. } else if (currentCharacter === ')') {
  191. parenDepth--;
  192. }
  193. }
  194. const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
  195. const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
  196. const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
  197. const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
  198. return {
  199. modifiers,
  200. hasImportantModifier,
  201. baseClassName,
  202. maybePostfixModifierPosition
  203. };
  204. };
  205. if (prefix) {
  206. const fullPrefix = prefix + MODIFIER_SEPARATOR;
  207. const parseClassNameOriginal = parseClassName;
  208. parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
  209. isExternal: true,
  210. modifiers: [],
  211. hasImportantModifier: false,
  212. baseClassName: className,
  213. maybePostfixModifierPosition: undefined
  214. };
  215. }
  216. if (experimentalParseClassName) {
  217. const parseClassNameOriginal = parseClassName;
  218. parseClassName = className => experimentalParseClassName({
  219. className,
  220. parseClassName: parseClassNameOriginal
  221. });
  222. }
  223. return parseClassName;
  224. };
  225. const stripImportantModifier = baseClassName => {
  226. if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
  227. return baseClassName.substring(0, baseClassName.length - 1);
  228. }
  229. /**
  230. * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
  231. * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
  232. */
  233. if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
  234. return baseClassName.substring(1);
  235. }
  236. return baseClassName;
  237. };
  238. /**
  239. * Sorts modifiers according to following schema:
  240. * - Predefined modifiers are sorted alphabetically
  241. * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
  242. */
  243. const createSortModifiers = config => {
  244. const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true]));
  245. const sortModifiers = modifiers => {
  246. if (modifiers.length <= 1) {
  247. return modifiers;
  248. }
  249. const sortedModifiers = [];
  250. let unsortedModifiers = [];
  251. modifiers.forEach(modifier => {
  252. const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier];
  253. if (isPositionSensitive) {
  254. sortedModifiers.push(...unsortedModifiers.sort(), modifier);
  255. unsortedModifiers = [];
  256. } else {
  257. unsortedModifiers.push(modifier);
  258. }
  259. });
  260. sortedModifiers.push(...unsortedModifiers.sort());
  261. return sortedModifiers;
  262. };
  263. return sortModifiers;
  264. };
  265. const createConfigUtils = config => ({
  266. cache: createLruCache(config.cacheSize),
  267. parseClassName: createParseClassName(config),
  268. sortModifiers: createSortModifiers(config),
  269. ...createClassGroupUtils(config)
  270. });
  271. const SPLIT_CLASSES_REGEX = /\s+/;
  272. const mergeClassList = (classList, configUtils) => {
  273. const {
  274. parseClassName,
  275. getClassGroupId,
  276. getConflictingClassGroupIds,
  277. sortModifiers
  278. } = configUtils;
  279. /**
  280. * Set of classGroupIds in following format:
  281. * `{importantModifier}{variantModifiers}{classGroupId}`
  282. * @example 'float'
  283. * @example 'hover:focus:bg-color'
  284. * @example 'md:!pr'
  285. */
  286. const classGroupsInConflict = [];
  287. const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
  288. let result = '';
  289. for (let index = classNames.length - 1; index >= 0; index -= 1) {
  290. const originalClassName = classNames[index];
  291. const {
  292. isExternal,
  293. modifiers,
  294. hasImportantModifier,
  295. baseClassName,
  296. maybePostfixModifierPosition
  297. } = parseClassName(originalClassName);
  298. if (isExternal) {
  299. result = originalClassName + (result.length > 0 ? ' ' + result : result);
  300. continue;
  301. }
  302. let hasPostfixModifier = !!maybePostfixModifierPosition;
  303. let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
  304. if (!classGroupId) {
  305. if (!hasPostfixModifier) {
  306. // Not a Tailwind class
  307. result = originalClassName + (result.length > 0 ? ' ' + result : result);
  308. continue;
  309. }
  310. classGroupId = getClassGroupId(baseClassName);
  311. if (!classGroupId) {
  312. // Not a Tailwind class
  313. result = originalClassName + (result.length > 0 ? ' ' + result : result);
  314. continue;
  315. }
  316. hasPostfixModifier = false;
  317. }
  318. const variantModifier = sortModifiers(modifiers).join(':');
  319. const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
  320. const classId = modifierId + classGroupId;
  321. if (classGroupsInConflict.includes(classId)) {
  322. // Tailwind class omitted due to conflict
  323. continue;
  324. }
  325. classGroupsInConflict.push(classId);
  326. const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
  327. for (let i = 0; i < conflictGroups.length; ++i) {
  328. const group = conflictGroups[i];
  329. classGroupsInConflict.push(modifierId + group);
  330. }
  331. // Tailwind class not in conflict
  332. result = originalClassName + (result.length > 0 ? ' ' + result : result);
  333. }
  334. return result;
  335. };
  336. /**
  337. * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
  338. *
  339. * Specifically:
  340. * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
  341. * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
  342. *
  343. * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
  344. */
  345. function twJoin() {
  346. let index = 0;
  347. let argument;
  348. let resolvedValue;
  349. let string = '';
  350. while (index < arguments.length) {
  351. if (argument = arguments[index++]) {
  352. if (resolvedValue = toValue(argument)) {
  353. string && (string += ' ');
  354. string += resolvedValue;
  355. }
  356. }
  357. }
  358. return string;
  359. }
  360. const toValue = mix => {
  361. if (typeof mix === 'string') {
  362. return mix;
  363. }
  364. let resolvedValue;
  365. let string = '';
  366. for (let k = 0; k < mix.length; k++) {
  367. if (mix[k]) {
  368. if (resolvedValue = toValue(mix[k])) {
  369. string && (string += ' ');
  370. string += resolvedValue;
  371. }
  372. }
  373. }
  374. return string;
  375. };
  376. function createTailwindMerge(createConfigFirst, ...createConfigRest) {
  377. let configUtils;
  378. let cacheGet;
  379. let cacheSet;
  380. let functionToCall = initTailwindMerge;
  381. function initTailwindMerge(classList) {
  382. const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
  383. configUtils = createConfigUtils(config);
  384. cacheGet = configUtils.cache.get;
  385. cacheSet = configUtils.cache.set;
  386. functionToCall = tailwindMerge;
  387. return tailwindMerge(classList);
  388. }
  389. function tailwindMerge(classList) {
  390. const cachedResult = cacheGet(classList);
  391. if (cachedResult) {
  392. return cachedResult;
  393. }
  394. const result = mergeClassList(classList, configUtils);
  395. cacheSet(classList, result);
  396. return result;
  397. }
  398. return function callTailwindMerge() {
  399. return functionToCall(twJoin.apply(null, arguments));
  400. };
  401. }
  402. const fromTheme = key => {
  403. const themeGetter = theme => theme[key] || [];
  404. themeGetter.isThemeGetter = true;
  405. return themeGetter;
  406. };
  407. const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
  408. const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
  409. const fractionRegex = /^\d+\/\d+$/;
  410. const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
  411. const 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$/;
  412. const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
  413. // Shadow always begins with x and y offset separated by underscore optionally prepended by inset
  414. const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
  415. const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
  416. const isFraction = value => fractionRegex.test(value);
  417. const isNumber = value => !!value && !Number.isNaN(Number(value));
  418. const isInteger = value => !!value && Number.isInteger(Number(value));
  419. const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));
  420. const isTshirtSize = value => tshirtUnitRegex.test(value);
  421. const isAny = () => true;
  422. const isLengthOnly = value =>
  423. // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
  424. // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
  425. // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
  426. lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
  427. const isNever = () => false;
  428. const isShadow = value => shadowRegex.test(value);
  429. const isImage = value => imageRegex.test(value);
  430. const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);
  431. const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);
  432. const isArbitraryValue = value => arbitraryValueRegex.test(value);
  433. const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
  434. const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
  435. const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
  436. const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
  437. const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
  438. const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
  439. const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
  440. const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
  441. const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);
  442. const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
  443. const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);
  444. const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);
  445. // Helpers
  446. const getIsArbitraryValue = (value, testLabel, testValue) => {
  447. const result = arbitraryValueRegex.exec(value);
  448. if (result) {
  449. if (result[1]) {
  450. return testLabel(result[1]);
  451. }
  452. return testValue(result[2]);
  453. }
  454. return false;
  455. };
  456. const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
  457. const result = arbitraryVariableRegex.exec(value);
  458. if (result) {
  459. if (result[1]) {
  460. return testLabel(result[1]);
  461. }
  462. return shouldMatchNoLabel;
  463. }
  464. return false;
  465. };
  466. // Labels
  467. const isLabelPosition = label => label === 'position' || label === 'percentage';
  468. const isLabelImage = label => label === 'image' || label === 'url';
  469. const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';
  470. const isLabelLength = label => label === 'length';
  471. const isLabelNumber = label => label === 'number';
  472. const isLabelFamilyName = label => label === 'family-name';
  473. const isLabelShadow = label => label === 'shadow';
  474. const validators = /*#__PURE__*/Object.defineProperty({
  475. __proto__: null,
  476. isAny,
  477. isAnyNonArbitrary,
  478. isArbitraryImage,
  479. isArbitraryLength,
  480. isArbitraryNumber,
  481. isArbitraryPosition,
  482. isArbitraryShadow,
  483. isArbitrarySize,
  484. isArbitraryValue,
  485. isArbitraryVariable,
  486. isArbitraryVariableFamilyName,
  487. isArbitraryVariableImage,
  488. isArbitraryVariableLength,
  489. isArbitraryVariablePosition,
  490. isArbitraryVariableShadow,
  491. isArbitraryVariableSize,
  492. isFraction,
  493. isInteger,
  494. isNumber,
  495. isPercent,
  496. isTshirtSize
  497. }, Symbol.toStringTag, {
  498. value: 'Module'
  499. });
  500. const getDefaultConfig = () => {
  501. /**
  502. * Theme getters for theme variable namespaces
  503. * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
  504. */
  505. /***/
  506. const themeColor = fromTheme('color');
  507. const themeFont = fromTheme('font');
  508. const themeText = fromTheme('text');
  509. const themeFontWeight = fromTheme('font-weight');
  510. const themeTracking = fromTheme('tracking');
  511. const themeLeading = fromTheme('leading');
  512. const themeBreakpoint = fromTheme('breakpoint');
  513. const themeContainer = fromTheme('container');
  514. const themeSpacing = fromTheme('spacing');
  515. const themeRadius = fromTheme('radius');
  516. const themeShadow = fromTheme('shadow');
  517. const themeInsetShadow = fromTheme('inset-shadow');
  518. const themeTextShadow = fromTheme('text-shadow');
  519. const themeDropShadow = fromTheme('drop-shadow');
  520. const themeBlur = fromTheme('blur');
  521. const themePerspective = fromTheme('perspective');
  522. const themeAspect = fromTheme('aspect');
  523. const themeEase = fromTheme('ease');
  524. const themeAnimate = fromTheme('animate');
  525. /**
  526. * Helpers to avoid repeating the same scales
  527. *
  528. * We use functions that create a new array every time they're called instead of static arrays.
  529. * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.
  530. */
  531. /***/
  532. const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
  533. const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',
  534. // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
  535. 'left-top', 'top-right',
  536. // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
  537. 'right-top', 'bottom-right',
  538. // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
  539. 'right-bottom', 'bottom-left',
  540. // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
  541. 'left-bottom'];
  542. const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
  543. const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
  544. const scaleOverscroll = () => ['auto', 'contain', 'none'];
  545. const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
  546. const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];
  547. const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];
  548. const scaleGridColRowStartAndEnd = () => ['auto', {
  549. span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]
  550. }, isInteger, isArbitraryVariable, isArbitraryValue];
  551. const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];
  552. const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];
  553. const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];
  554. const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
  555. const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
  556. const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
  557. const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
  558. const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
  559. position: [isArbitraryVariable, isArbitraryValue]
  560. }];
  561. const scaleBgRepeat = () => ['no-repeat', {
  562. repeat: ['', 'x', 'y', 'space', 'round']
  563. }];
  564. const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {
  565. size: [isArbitraryVariable, isArbitraryValue]
  566. }];
  567. const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
  568. const scaleRadius = () => [
  569. // Deprecated since Tailwind CSS v4.0.0
  570. '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];
  571. const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
  572. const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
  573. const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
  574. const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
  575. const scaleBlur = () => [
  576. // Deprecated since Tailwind CSS v4.0.0
  577. '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
  578. const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
  579. const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
  580. const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
  581. const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];
  582. return {
  583. cacheSize: 500,
  584. theme: {
  585. animate: ['spin', 'ping', 'pulse', 'bounce'],
  586. aspect: ['video'],
  587. blur: [isTshirtSize],
  588. breakpoint: [isTshirtSize],
  589. color: [isAny],
  590. container: [isTshirtSize],
  591. 'drop-shadow': [isTshirtSize],
  592. ease: ['in', 'out', 'in-out'],
  593. font: [isAnyNonArbitrary],
  594. 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],
  595. 'inset-shadow': [isTshirtSize],
  596. leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],
  597. perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],
  598. radius: [isTshirtSize],
  599. shadow: [isTshirtSize],
  600. spacing: ['px', isNumber],
  601. text: [isTshirtSize],
  602. 'text-shadow': [isTshirtSize],
  603. tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']
  604. },
  605. classGroups: {
  606. // --------------
  607. // --- Layout ---
  608. // --------------
  609. /**
  610. * Aspect Ratio
  611. * @see https://tailwindcss.com/docs/aspect-ratio
  612. */
  613. aspect: [{
  614. aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
  615. }],
  616. /**
  617. * Container
  618. * @see https://tailwindcss.com/docs/container
  619. * @deprecated since Tailwind CSS v4.0.0
  620. */
  621. container: ['container'],
  622. /**
  623. * Columns
  624. * @see https://tailwindcss.com/docs/columns
  625. */
  626. columns: [{
  627. columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
  628. }],
  629. /**
  630. * Break After
  631. * @see https://tailwindcss.com/docs/break-after
  632. */
  633. 'break-after': [{
  634. 'break-after': scaleBreak()
  635. }],
  636. /**
  637. * Break Before
  638. * @see https://tailwindcss.com/docs/break-before
  639. */
  640. 'break-before': [{
  641. 'break-before': scaleBreak()
  642. }],
  643. /**
  644. * Break Inside
  645. * @see https://tailwindcss.com/docs/break-inside
  646. */
  647. 'break-inside': [{
  648. 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']
  649. }],
  650. /**
  651. * Box Decoration Break
  652. * @see https://tailwindcss.com/docs/box-decoration-break
  653. */
  654. 'box-decoration': [{
  655. 'box-decoration': ['slice', 'clone']
  656. }],
  657. /**
  658. * Box Sizing
  659. * @see https://tailwindcss.com/docs/box-sizing
  660. */
  661. box: [{
  662. box: ['border', 'content']
  663. }],
  664. /**
  665. * Display
  666. * @see https://tailwindcss.com/docs/display
  667. */
  668. 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'],
  669. /**
  670. * Screen Reader Only
  671. * @see https://tailwindcss.com/docs/display#screen-reader-only
  672. */
  673. sr: ['sr-only', 'not-sr-only'],
  674. /**
  675. * Floats
  676. * @see https://tailwindcss.com/docs/float
  677. */
  678. float: [{
  679. float: ['right', 'left', 'none', 'start', 'end']
  680. }],
  681. /**
  682. * Clear
  683. * @see https://tailwindcss.com/docs/clear
  684. */
  685. clear: [{
  686. clear: ['left', 'right', 'both', 'none', 'start', 'end']
  687. }],
  688. /**
  689. * Isolation
  690. * @see https://tailwindcss.com/docs/isolation
  691. */
  692. isolation: ['isolate', 'isolation-auto'],
  693. /**
  694. * Object Fit
  695. * @see https://tailwindcss.com/docs/object-fit
  696. */
  697. 'object-fit': [{
  698. object: ['contain', 'cover', 'fill', 'none', 'scale-down']
  699. }],
  700. /**
  701. * Object Position
  702. * @see https://tailwindcss.com/docs/object-position
  703. */
  704. 'object-position': [{
  705. object: scalePositionWithArbitrary()
  706. }],
  707. /**
  708. * Overflow
  709. * @see https://tailwindcss.com/docs/overflow
  710. */
  711. overflow: [{
  712. overflow: scaleOverflow()
  713. }],
  714. /**
  715. * Overflow X
  716. * @see https://tailwindcss.com/docs/overflow
  717. */
  718. 'overflow-x': [{
  719. 'overflow-x': scaleOverflow()
  720. }],
  721. /**
  722. * Overflow Y
  723. * @see https://tailwindcss.com/docs/overflow
  724. */
  725. 'overflow-y': [{
  726. 'overflow-y': scaleOverflow()
  727. }],
  728. /**
  729. * Overscroll Behavior
  730. * @see https://tailwindcss.com/docs/overscroll-behavior
  731. */
  732. overscroll: [{
  733. overscroll: scaleOverscroll()
  734. }],
  735. /**
  736. * Overscroll Behavior X
  737. * @see https://tailwindcss.com/docs/overscroll-behavior
  738. */
  739. 'overscroll-x': [{
  740. 'overscroll-x': scaleOverscroll()
  741. }],
  742. /**
  743. * Overscroll Behavior Y
  744. * @see https://tailwindcss.com/docs/overscroll-behavior
  745. */
  746. 'overscroll-y': [{
  747. 'overscroll-y': scaleOverscroll()
  748. }],
  749. /**
  750. * Position
  751. * @see https://tailwindcss.com/docs/position
  752. */
  753. position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
  754. /**
  755. * Top / Right / Bottom / Left
  756. * @see https://tailwindcss.com/docs/top-right-bottom-left
  757. */
  758. inset: [{
  759. inset: scaleInset()
  760. }],
  761. /**
  762. * Right / Left
  763. * @see https://tailwindcss.com/docs/top-right-bottom-left
  764. */
  765. 'inset-x': [{
  766. 'inset-x': scaleInset()
  767. }],
  768. /**
  769. * Top / Bottom
  770. * @see https://tailwindcss.com/docs/top-right-bottom-left
  771. */
  772. 'inset-y': [{
  773. 'inset-y': scaleInset()
  774. }],
  775. /**
  776. * Start
  777. * @see https://tailwindcss.com/docs/top-right-bottom-left
  778. */
  779. start: [{
  780. start: scaleInset()
  781. }],
  782. /**
  783. * End
  784. * @see https://tailwindcss.com/docs/top-right-bottom-left
  785. */
  786. end: [{
  787. end: scaleInset()
  788. }],
  789. /**
  790. * Top
  791. * @see https://tailwindcss.com/docs/top-right-bottom-left
  792. */
  793. top: [{
  794. top: scaleInset()
  795. }],
  796. /**
  797. * Right
  798. * @see https://tailwindcss.com/docs/top-right-bottom-left
  799. */
  800. right: [{
  801. right: scaleInset()
  802. }],
  803. /**
  804. * Bottom
  805. * @see https://tailwindcss.com/docs/top-right-bottom-left
  806. */
  807. bottom: [{
  808. bottom: scaleInset()
  809. }],
  810. /**
  811. * Left
  812. * @see https://tailwindcss.com/docs/top-right-bottom-left
  813. */
  814. left: [{
  815. left: scaleInset()
  816. }],
  817. /**
  818. * Visibility
  819. * @see https://tailwindcss.com/docs/visibility
  820. */
  821. visibility: ['visible', 'invisible', 'collapse'],
  822. /**
  823. * Z-Index
  824. * @see https://tailwindcss.com/docs/z-index
  825. */
  826. z: [{
  827. z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]
  828. }],
  829. // ------------------------
  830. // --- Flexbox and Grid ---
  831. // ------------------------
  832. /**
  833. * Flex Basis
  834. * @see https://tailwindcss.com/docs/flex-basis
  835. */
  836. basis: [{
  837. basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]
  838. }],
  839. /**
  840. * Flex Direction
  841. * @see https://tailwindcss.com/docs/flex-direction
  842. */
  843. 'flex-direction': [{
  844. flex: ['row', 'row-reverse', 'col', 'col-reverse']
  845. }],
  846. /**
  847. * Flex Wrap
  848. * @see https://tailwindcss.com/docs/flex-wrap
  849. */
  850. 'flex-wrap': [{
  851. flex: ['nowrap', 'wrap', 'wrap-reverse']
  852. }],
  853. /**
  854. * Flex
  855. * @see https://tailwindcss.com/docs/flex
  856. */
  857. flex: [{
  858. flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]
  859. }],
  860. /**
  861. * Flex Grow
  862. * @see https://tailwindcss.com/docs/flex-grow
  863. */
  864. grow: [{
  865. grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]
  866. }],
  867. /**
  868. * Flex Shrink
  869. * @see https://tailwindcss.com/docs/flex-shrink
  870. */
  871. shrink: [{
  872. shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]
  873. }],
  874. /**
  875. * Order
  876. * @see https://tailwindcss.com/docs/order
  877. */
  878. order: [{
  879. order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]
  880. }],
  881. /**
  882. * Grid Template Columns
  883. * @see https://tailwindcss.com/docs/grid-template-columns
  884. */
  885. 'grid-cols': [{
  886. 'grid-cols': scaleGridTemplateColsRows()
  887. }],
  888. /**
  889. * Grid Column Start / End
  890. * @see https://tailwindcss.com/docs/grid-column
  891. */
  892. 'col-start-end': [{
  893. col: scaleGridColRowStartAndEnd()
  894. }],
  895. /**
  896. * Grid Column Start
  897. * @see https://tailwindcss.com/docs/grid-column
  898. */
  899. 'col-start': [{
  900. 'col-start': scaleGridColRowStartOrEnd()
  901. }],
  902. /**
  903. * Grid Column End
  904. * @see https://tailwindcss.com/docs/grid-column
  905. */
  906. 'col-end': [{
  907. 'col-end': scaleGridColRowStartOrEnd()
  908. }],
  909. /**
  910. * Grid Template Rows
  911. * @see https://tailwindcss.com/docs/grid-template-rows
  912. */
  913. 'grid-rows': [{
  914. 'grid-rows': scaleGridTemplateColsRows()
  915. }],
  916. /**
  917. * Grid Row Start / End
  918. * @see https://tailwindcss.com/docs/grid-row
  919. */
  920. 'row-start-end': [{
  921. row: scaleGridColRowStartAndEnd()
  922. }],
  923. /**
  924. * Grid Row Start
  925. * @see https://tailwindcss.com/docs/grid-row
  926. */
  927. 'row-start': [{
  928. 'row-start': scaleGridColRowStartOrEnd()
  929. }],
  930. /**
  931. * Grid Row End
  932. * @see https://tailwindcss.com/docs/grid-row
  933. */
  934. 'row-end': [{
  935. 'row-end': scaleGridColRowStartOrEnd()
  936. }],
  937. /**
  938. * Grid Auto Flow
  939. * @see https://tailwindcss.com/docs/grid-auto-flow
  940. */
  941. 'grid-flow': [{
  942. 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']
  943. }],
  944. /**
  945. * Grid Auto Columns
  946. * @see https://tailwindcss.com/docs/grid-auto-columns
  947. */
  948. 'auto-cols': [{
  949. 'auto-cols': scaleGridAutoColsRows()
  950. }],
  951. /**
  952. * Grid Auto Rows
  953. * @see https://tailwindcss.com/docs/grid-auto-rows
  954. */
  955. 'auto-rows': [{
  956. 'auto-rows': scaleGridAutoColsRows()
  957. }],
  958. /**
  959. * Gap
  960. * @see https://tailwindcss.com/docs/gap
  961. */
  962. gap: [{
  963. gap: scaleUnambiguousSpacing()
  964. }],
  965. /**
  966. * Gap X
  967. * @see https://tailwindcss.com/docs/gap
  968. */
  969. 'gap-x': [{
  970. 'gap-x': scaleUnambiguousSpacing()
  971. }],
  972. /**
  973. * Gap Y
  974. * @see https://tailwindcss.com/docs/gap
  975. */
  976. 'gap-y': [{
  977. 'gap-y': scaleUnambiguousSpacing()
  978. }],
  979. /**
  980. * Justify Content
  981. * @see https://tailwindcss.com/docs/justify-content
  982. */
  983. 'justify-content': [{
  984. justify: [...scaleAlignPrimaryAxis(), 'normal']
  985. }],
  986. /**
  987. * Justify Items
  988. * @see https://tailwindcss.com/docs/justify-items
  989. */
  990. 'justify-items': [{
  991. 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']
  992. }],
  993. /**
  994. * Justify Self
  995. * @see https://tailwindcss.com/docs/justify-self
  996. */
  997. 'justify-self': [{
  998. 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]
  999. }],
  1000. /**
  1001. * Align Content
  1002. * @see https://tailwindcss.com/docs/align-content
  1003. */
  1004. 'align-content': [{
  1005. content: ['normal', ...scaleAlignPrimaryAxis()]
  1006. }],
  1007. /**
  1008. * Align Items
  1009. * @see https://tailwindcss.com/docs/align-items
  1010. */
  1011. 'align-items': [{
  1012. items: [...scaleAlignSecondaryAxis(), {
  1013. baseline: ['', 'last']
  1014. }]
  1015. }],
  1016. /**
  1017. * Align Self
  1018. * @see https://tailwindcss.com/docs/align-self
  1019. */
  1020. 'align-self': [{
  1021. self: ['auto', ...scaleAlignSecondaryAxis(), {
  1022. baseline: ['', 'last']
  1023. }]
  1024. }],
  1025. /**
  1026. * Place Content
  1027. * @see https://tailwindcss.com/docs/place-content
  1028. */
  1029. 'place-content': [{
  1030. 'place-content': scaleAlignPrimaryAxis()
  1031. }],
  1032. /**
  1033. * Place Items
  1034. * @see https://tailwindcss.com/docs/place-items
  1035. */
  1036. 'place-items': [{
  1037. 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']
  1038. }],
  1039. /**
  1040. * Place Self
  1041. * @see https://tailwindcss.com/docs/place-self
  1042. */
  1043. 'place-self': [{
  1044. 'place-self': ['auto', ...scaleAlignSecondaryAxis()]
  1045. }],
  1046. // Spacing
  1047. /**
  1048. * Padding
  1049. * @see https://tailwindcss.com/docs/padding
  1050. */
  1051. p: [{
  1052. p: scaleUnambiguousSpacing()
  1053. }],
  1054. /**
  1055. * Padding X
  1056. * @see https://tailwindcss.com/docs/padding
  1057. */
  1058. px: [{
  1059. px: scaleUnambiguousSpacing()
  1060. }],
  1061. /**
  1062. * Padding Y
  1063. * @see https://tailwindcss.com/docs/padding
  1064. */
  1065. py: [{
  1066. py: scaleUnambiguousSpacing()
  1067. }],
  1068. /**
  1069. * Padding Start
  1070. * @see https://tailwindcss.com/docs/padding
  1071. */
  1072. ps: [{
  1073. ps: scaleUnambiguousSpacing()
  1074. }],
  1075. /**
  1076. * Padding End
  1077. * @see https://tailwindcss.com/docs/padding
  1078. */
  1079. pe: [{
  1080. pe: scaleUnambiguousSpacing()
  1081. }],
  1082. /**
  1083. * Padding Top
  1084. * @see https://tailwindcss.com/docs/padding
  1085. */
  1086. pt: [{
  1087. pt: scaleUnambiguousSpacing()
  1088. }],
  1089. /**
  1090. * Padding Right
  1091. * @see https://tailwindcss.com/docs/padding
  1092. */
  1093. pr: [{
  1094. pr: scaleUnambiguousSpacing()
  1095. }],
  1096. /**
  1097. * Padding Bottom
  1098. * @see https://tailwindcss.com/docs/padding
  1099. */
  1100. pb: [{
  1101. pb: scaleUnambiguousSpacing()
  1102. }],
  1103. /**
  1104. * Padding Left
  1105. * @see https://tailwindcss.com/docs/padding
  1106. */
  1107. pl: [{
  1108. pl: scaleUnambiguousSpacing()
  1109. }],
  1110. /**
  1111. * Margin
  1112. * @see https://tailwindcss.com/docs/margin
  1113. */
  1114. m: [{
  1115. m: scaleMargin()
  1116. }],
  1117. /**
  1118. * Margin X
  1119. * @see https://tailwindcss.com/docs/margin
  1120. */
  1121. mx: [{
  1122. mx: scaleMargin()
  1123. }],
  1124. /**
  1125. * Margin Y
  1126. * @see https://tailwindcss.com/docs/margin
  1127. */
  1128. my: [{
  1129. my: scaleMargin()
  1130. }],
  1131. /**
  1132. * Margin Start
  1133. * @see https://tailwindcss.com/docs/margin
  1134. */
  1135. ms: [{
  1136. ms: scaleMargin()
  1137. }],
  1138. /**
  1139. * Margin End
  1140. * @see https://tailwindcss.com/docs/margin
  1141. */
  1142. me: [{
  1143. me: scaleMargin()
  1144. }],
  1145. /**
  1146. * Margin Top
  1147. * @see https://tailwindcss.com/docs/margin
  1148. */
  1149. mt: [{
  1150. mt: scaleMargin()
  1151. }],
  1152. /**
  1153. * Margin Right
  1154. * @see https://tailwindcss.com/docs/margin
  1155. */
  1156. mr: [{
  1157. mr: scaleMargin()
  1158. }],
  1159. /**
  1160. * Margin Bottom
  1161. * @see https://tailwindcss.com/docs/margin
  1162. */
  1163. mb: [{
  1164. mb: scaleMargin()
  1165. }],
  1166. /**
  1167. * Margin Left
  1168. * @see https://tailwindcss.com/docs/margin
  1169. */
  1170. ml: [{
  1171. ml: scaleMargin()
  1172. }],
  1173. /**
  1174. * Space Between X
  1175. * @see https://tailwindcss.com/docs/margin#adding-space-between-children
  1176. */
  1177. 'space-x': [{
  1178. 'space-x': scaleUnambiguousSpacing()
  1179. }],
  1180. /**
  1181. * Space Between X Reverse
  1182. * @see https://tailwindcss.com/docs/margin#adding-space-between-children
  1183. */
  1184. 'space-x-reverse': ['space-x-reverse'],
  1185. /**
  1186. * Space Between Y
  1187. * @see https://tailwindcss.com/docs/margin#adding-space-between-children
  1188. */
  1189. 'space-y': [{
  1190. 'space-y': scaleUnambiguousSpacing()
  1191. }],
  1192. /**
  1193. * Space Between Y Reverse
  1194. * @see https://tailwindcss.com/docs/margin#adding-space-between-children
  1195. */
  1196. 'space-y-reverse': ['space-y-reverse'],
  1197. // --------------
  1198. // --- Sizing ---
  1199. // --------------
  1200. /**
  1201. * Size
  1202. * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
  1203. */
  1204. size: [{
  1205. size: scaleSizing()
  1206. }],
  1207. /**
  1208. * Width
  1209. * @see https://tailwindcss.com/docs/width
  1210. */
  1211. w: [{
  1212. w: [themeContainer, 'screen', ...scaleSizing()]
  1213. }],
  1214. /**
  1215. * Min-Width
  1216. * @see https://tailwindcss.com/docs/min-width
  1217. */
  1218. 'min-w': [{
  1219. 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
  1220. 'none', ...scaleSizing()]
  1221. }],
  1222. /**
  1223. * Max-Width
  1224. * @see https://tailwindcss.com/docs/max-width
  1225. */
  1226. 'max-w': [{
  1227. 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
  1228. 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
  1229. {
  1230. screen: [themeBreakpoint]
  1231. }, ...scaleSizing()]
  1232. }],
  1233. /**
  1234. * Height
  1235. * @see https://tailwindcss.com/docs/height
  1236. */
  1237. h: [{
  1238. h: ['screen', ...scaleSizing()]
  1239. }],
  1240. /**
  1241. * Min-Height
  1242. * @see https://tailwindcss.com/docs/min-height
  1243. */
  1244. 'min-h': [{
  1245. 'min-h': ['screen', 'none', ...scaleSizing()]
  1246. }],
  1247. /**
  1248. * Max-Height
  1249. * @see https://tailwindcss.com/docs/max-height
  1250. */
  1251. 'max-h': [{
  1252. 'max-h': ['screen', ...scaleSizing()]
  1253. }],
  1254. // ------------------
  1255. // --- Typography ---
  1256. // ------------------
  1257. /**
  1258. * Font Size
  1259. * @see https://tailwindcss.com/docs/font-size
  1260. */
  1261. 'font-size': [{
  1262. text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]
  1263. }],
  1264. /**
  1265. * Font Smoothing
  1266. * @see https://tailwindcss.com/docs/font-smoothing
  1267. */
  1268. 'font-smoothing': ['antialiased', 'subpixel-antialiased'],
  1269. /**
  1270. * Font Style
  1271. * @see https://tailwindcss.com/docs/font-style
  1272. */
  1273. 'font-style': ['italic', 'not-italic'],
  1274. /**
  1275. * Font Weight
  1276. * @see https://tailwindcss.com/docs/font-weight
  1277. */
  1278. 'font-weight': [{
  1279. font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
  1280. }],
  1281. /**
  1282. * Font Stretch
  1283. * @see https://tailwindcss.com/docs/font-stretch
  1284. */
  1285. 'font-stretch': [{
  1286. 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]
  1287. }],
  1288. /**
  1289. * Font Family
  1290. * @see https://tailwindcss.com/docs/font-family
  1291. */
  1292. 'font-family': [{
  1293. font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
  1294. }],
  1295. /**
  1296. * Font Variant Numeric
  1297. * @see https://tailwindcss.com/docs/font-variant-numeric
  1298. */
  1299. 'fvn-normal': ['normal-nums'],
  1300. /**
  1301. * Font Variant Numeric
  1302. * @see https://tailwindcss.com/docs/font-variant-numeric
  1303. */
  1304. 'fvn-ordinal': ['ordinal'],
  1305. /**
  1306. * Font Variant Numeric
  1307. * @see https://tailwindcss.com/docs/font-variant-numeric
  1308. */
  1309. 'fvn-slashed-zero': ['slashed-zero'],
  1310. /**
  1311. * Font Variant Numeric
  1312. * @see https://tailwindcss.com/docs/font-variant-numeric
  1313. */
  1314. 'fvn-figure': ['lining-nums', 'oldstyle-nums'],
  1315. /**
  1316. * Font Variant Numeric
  1317. * @see https://tailwindcss.com/docs/font-variant-numeric
  1318. */
  1319. 'fvn-spacing': ['proportional-nums', 'tabular-nums'],
  1320. /**
  1321. * Font Variant Numeric
  1322. * @see https://tailwindcss.com/docs/font-variant-numeric
  1323. */
  1324. 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],
  1325. /**
  1326. * Letter Spacing
  1327. * @see https://tailwindcss.com/docs/letter-spacing
  1328. */
  1329. tracking: [{
  1330. tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
  1331. }],
  1332. /**
  1333. * Line Clamp
  1334. * @see https://tailwindcss.com/docs/line-clamp
  1335. */
  1336. 'line-clamp': [{
  1337. 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]
  1338. }],
  1339. /**
  1340. * Line Height
  1341. * @see https://tailwindcss.com/docs/line-height
  1342. */
  1343. leading: [{
  1344. leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
  1345. themeLeading, ...scaleUnambiguousSpacing()]
  1346. }],
  1347. /**
  1348. * List Style Image
  1349. * @see https://tailwindcss.com/docs/list-style-image
  1350. */
  1351. 'list-image': [{
  1352. 'list-image': ['none', isArbitraryVariable, isArbitraryValue]
  1353. }],
  1354. /**
  1355. * List Style Position
  1356. * @see https://tailwindcss.com/docs/list-style-position
  1357. */
  1358. 'list-style-position': [{
  1359. list: ['inside', 'outside']
  1360. }],
  1361. /**
  1362. * List Style Type
  1363. * @see https://tailwindcss.com/docs/list-style-type
  1364. */
  1365. 'list-style-type': [{
  1366. list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]
  1367. }],
  1368. /**
  1369. * Text Alignment
  1370. * @see https://tailwindcss.com/docs/text-align
  1371. */
  1372. 'text-alignment': [{
  1373. text: ['left', 'center', 'right', 'justify', 'start', 'end']
  1374. }],
  1375. /**
  1376. * Placeholder Color
  1377. * @deprecated since Tailwind CSS v3.0.0
  1378. * @see https://v3.tailwindcss.com/docs/placeholder-color
  1379. */
  1380. 'placeholder-color': [{
  1381. placeholder: scaleColor()
  1382. }],
  1383. /**
  1384. * Text Color
  1385. * @see https://tailwindcss.com/docs/text-color
  1386. */
  1387. 'text-color': [{
  1388. text: scaleColor()
  1389. }],
  1390. /**
  1391. * Text Decoration
  1392. * @see https://tailwindcss.com/docs/text-decoration
  1393. */
  1394. 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],
  1395. /**
  1396. * Text Decoration Style
  1397. * @see https://tailwindcss.com/docs/text-decoration-style
  1398. */
  1399. 'text-decoration-style': [{
  1400. decoration: [...scaleLineStyle(), 'wavy']
  1401. }],
  1402. /**
  1403. * Text Decoration Thickness
  1404. * @see https://tailwindcss.com/docs/text-decoration-thickness
  1405. */
  1406. 'text-decoration-thickness': [{
  1407. decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]
  1408. }],
  1409. /**
  1410. * Text Decoration Color
  1411. * @see https://tailwindcss.com/docs/text-decoration-color
  1412. */
  1413. 'text-decoration-color': [{
  1414. decoration: scaleColor()
  1415. }],
  1416. /**
  1417. * Text Underline Offset
  1418. * @see https://tailwindcss.com/docs/text-underline-offset
  1419. */
  1420. 'underline-offset': [{
  1421. 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]
  1422. }],
  1423. /**
  1424. * Text Transform
  1425. * @see https://tailwindcss.com/docs/text-transform
  1426. */
  1427. 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],
  1428. /**
  1429. * Text Overflow
  1430. * @see https://tailwindcss.com/docs/text-overflow
  1431. */
  1432. 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],
  1433. /**
  1434. * Text Wrap
  1435. * @see https://tailwindcss.com/docs/text-wrap
  1436. */
  1437. 'text-wrap': [{
  1438. text: ['wrap', 'nowrap', 'balance', 'pretty']
  1439. }],
  1440. /**
  1441. * Text Indent
  1442. * @see https://tailwindcss.com/docs/text-indent
  1443. */
  1444. indent: [{
  1445. indent: scaleUnambiguousSpacing()
  1446. }],
  1447. /**
  1448. * Vertical Alignment
  1449. * @see https://tailwindcss.com/docs/vertical-align
  1450. */
  1451. 'vertical-align': [{
  1452. align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]
  1453. }],
  1454. /**
  1455. * Whitespace
  1456. * @see https://tailwindcss.com/docs/whitespace
  1457. */
  1458. whitespace: [{
  1459. whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']
  1460. }],
  1461. /**
  1462. * Word Break
  1463. * @see https://tailwindcss.com/docs/word-break
  1464. */
  1465. break: [{
  1466. break: ['normal', 'words', 'all', 'keep']
  1467. }],
  1468. /**
  1469. * Overflow Wrap
  1470. * @see https://tailwindcss.com/docs/overflow-wrap
  1471. */
  1472. wrap: [{
  1473. wrap: ['break-word', 'anywhere', 'normal']
  1474. }],
  1475. /**
  1476. * Hyphens
  1477. * @see https://tailwindcss.com/docs/hyphens
  1478. */
  1479. hyphens: [{
  1480. hyphens: ['none', 'manual', 'auto']
  1481. }],
  1482. /**
  1483. * Content
  1484. * @see https://tailwindcss.com/docs/content
  1485. */
  1486. content: [{
  1487. content: ['none', isArbitraryVariable, isArbitraryValue]
  1488. }],
  1489. // -------------------
  1490. // --- Backgrounds ---
  1491. // -------------------
  1492. /**
  1493. * Background Attachment
  1494. * @see https://tailwindcss.com/docs/background-attachment
  1495. */
  1496. 'bg-attachment': [{
  1497. bg: ['fixed', 'local', 'scroll']
  1498. }],
  1499. /**
  1500. * Background Clip
  1501. * @see https://tailwindcss.com/docs/background-clip
  1502. */
  1503. 'bg-clip': [{
  1504. 'bg-clip': ['border', 'padding', 'content', 'text']
  1505. }],
  1506. /**
  1507. * Background Origin
  1508. * @see https://tailwindcss.com/docs/background-origin
  1509. */
  1510. 'bg-origin': [{
  1511. 'bg-origin': ['border', 'padding', 'content']
  1512. }],
  1513. /**
  1514. * Background Position
  1515. * @see https://tailwindcss.com/docs/background-position
  1516. */
  1517. 'bg-position': [{
  1518. bg: scaleBgPosition()
  1519. }],
  1520. /**
  1521. * Background Repeat
  1522. * @see https://tailwindcss.com/docs/background-repeat
  1523. */
  1524. 'bg-repeat': [{
  1525. bg: scaleBgRepeat()
  1526. }],
  1527. /**
  1528. * Background Size
  1529. * @see https://tailwindcss.com/docs/background-size
  1530. */
  1531. 'bg-size': [{
  1532. bg: scaleBgSize()
  1533. }],
  1534. /**
  1535. * Background Image
  1536. * @see https://tailwindcss.com/docs/background-image
  1537. */
  1538. 'bg-image': [{
  1539. bg: ['none', {
  1540. linear: [{
  1541. to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
  1542. }, isInteger, isArbitraryVariable, isArbitraryValue],
  1543. radial: ['', isArbitraryVariable, isArbitraryValue],
  1544. conic: [isInteger, isArbitraryVariable, isArbitraryValue]
  1545. }, isArbitraryVariableImage, isArbitraryImage]
  1546. }],
  1547. /**
  1548. * Background Color
  1549. * @see https://tailwindcss.com/docs/background-color
  1550. */
  1551. 'bg-color': [{
  1552. bg: scaleColor()
  1553. }],
  1554. /**
  1555. * Gradient Color Stops From Position
  1556. * @see https://tailwindcss.com/docs/gradient-color-stops
  1557. */
  1558. 'gradient-from-pos': [{
  1559. from: scaleGradientStopPosition()
  1560. }],
  1561. /**
  1562. * Gradient Color Stops Via Position
  1563. * @see https://tailwindcss.com/docs/gradient-color-stops
  1564. */
  1565. 'gradient-via-pos': [{
  1566. via: scaleGradientStopPosition()
  1567. }],
  1568. /**
  1569. * Gradient Color Stops To Position
  1570. * @see https://tailwindcss.com/docs/gradient-color-stops
  1571. */
  1572. 'gradient-to-pos': [{
  1573. to: scaleGradientStopPosition()
  1574. }],
  1575. /**
  1576. * Gradient Color Stops From
  1577. * @see https://tailwindcss.com/docs/gradient-color-stops
  1578. */
  1579. 'gradient-from': [{
  1580. from: scaleColor()
  1581. }],
  1582. /**
  1583. * Gradient Color Stops Via
  1584. * @see https://tailwindcss.com/docs/gradient-color-stops
  1585. */
  1586. 'gradient-via': [{
  1587. via: scaleColor()
  1588. }],
  1589. /**
  1590. * Gradient Color Stops To
  1591. * @see https://tailwindcss.com/docs/gradient-color-stops
  1592. */
  1593. 'gradient-to': [{
  1594. to: scaleColor()
  1595. }],
  1596. // ---------------
  1597. // --- Borders ---
  1598. // ---------------
  1599. /**
  1600. * Border Radius
  1601. * @see https://tailwindcss.com/docs/border-radius
  1602. */
  1603. rounded: [{
  1604. rounded: scaleRadius()
  1605. }],
  1606. /**
  1607. * Border Radius Start
  1608. * @see https://tailwindcss.com/docs/border-radius
  1609. */
  1610. 'rounded-s': [{
  1611. 'rounded-s': scaleRadius()
  1612. }],
  1613. /**
  1614. * Border Radius End
  1615. * @see https://tailwindcss.com/docs/border-radius
  1616. */
  1617. 'rounded-e': [{
  1618. 'rounded-e': scaleRadius()
  1619. }],
  1620. /**
  1621. * Border Radius Top
  1622. * @see https://tailwindcss.com/docs/border-radius
  1623. */
  1624. 'rounded-t': [{
  1625. 'rounded-t': scaleRadius()
  1626. }],
  1627. /**
  1628. * Border Radius Right
  1629. * @see https://tailwindcss.com/docs/border-radius
  1630. */
  1631. 'rounded-r': [{
  1632. 'rounded-r': scaleRadius()
  1633. }],
  1634. /**
  1635. * Border Radius Bottom
  1636. * @see https://tailwindcss.com/docs/border-radius
  1637. */
  1638. 'rounded-b': [{
  1639. 'rounded-b': scaleRadius()
  1640. }],
  1641. /**
  1642. * Border Radius Left
  1643. * @see https://tailwindcss.com/docs/border-radius
  1644. */
  1645. 'rounded-l': [{
  1646. 'rounded-l': scaleRadius()
  1647. }],
  1648. /**
  1649. * Border Radius Start Start
  1650. * @see https://tailwindcss.com/docs/border-radius
  1651. */
  1652. 'rounded-ss': [{
  1653. 'rounded-ss': scaleRadius()
  1654. }],
  1655. /**
  1656. * Border Radius Start End
  1657. * @see https://tailwindcss.com/docs/border-radius
  1658. */
  1659. 'rounded-se': [{
  1660. 'rounded-se': scaleRadius()
  1661. }],
  1662. /**
  1663. * Border Radius End End
  1664. * @see https://tailwindcss.com/docs/border-radius
  1665. */
  1666. 'rounded-ee': [{
  1667. 'rounded-ee': scaleRadius()
  1668. }],
  1669. /**
  1670. * Border Radius End Start
  1671. * @see https://tailwindcss.com/docs/border-radius
  1672. */
  1673. 'rounded-es': [{
  1674. 'rounded-es': scaleRadius()
  1675. }],
  1676. /**
  1677. * Border Radius Top Left
  1678. * @see https://tailwindcss.com/docs/border-radius
  1679. */
  1680. 'rounded-tl': [{
  1681. 'rounded-tl': scaleRadius()
  1682. }],
  1683. /**
  1684. * Border Radius Top Right
  1685. * @see https://tailwindcss.com/docs/border-radius
  1686. */
  1687. 'rounded-tr': [{
  1688. 'rounded-tr': scaleRadius()
  1689. }],
  1690. /**
  1691. * Border Radius Bottom Right
  1692. * @see https://tailwindcss.com/docs/border-radius
  1693. */
  1694. 'rounded-br': [{
  1695. 'rounded-br': scaleRadius()
  1696. }],
  1697. /**
  1698. * Border Radius Bottom Left
  1699. * @see https://tailwindcss.com/docs/border-radius
  1700. */
  1701. 'rounded-bl': [{
  1702. 'rounded-bl': scaleRadius()
  1703. }],
  1704. /**
  1705. * Border Width
  1706. * @see https://tailwindcss.com/docs/border-width
  1707. */
  1708. 'border-w': [{
  1709. border: scaleBorderWidth()
  1710. }],
  1711. /**
  1712. * Border Width X
  1713. * @see https://tailwindcss.com/docs/border-width
  1714. */
  1715. 'border-w-x': [{
  1716. 'border-x': scaleBorderWidth()
  1717. }],
  1718. /**
  1719. * Border Width Y
  1720. * @see https://tailwindcss.com/docs/border-width
  1721. */
  1722. 'border-w-y': [{
  1723. 'border-y': scaleBorderWidth()
  1724. }],
  1725. /**
  1726. * Border Width Start
  1727. * @see https://tailwindcss.com/docs/border-width
  1728. */
  1729. 'border-w-s': [{
  1730. 'border-s': scaleBorderWidth()
  1731. }],
  1732. /**
  1733. * Border Width End
  1734. * @see https://tailwindcss.com/docs/border-width
  1735. */
  1736. 'border-w-e': [{
  1737. 'border-e': scaleBorderWidth()
  1738. }],
  1739. /**
  1740. * Border Width Top
  1741. * @see https://tailwindcss.com/docs/border-width
  1742. */
  1743. 'border-w-t': [{
  1744. 'border-t': scaleBorderWidth()
  1745. }],
  1746. /**
  1747. * Border Width Right
  1748. * @see https://tailwindcss.com/docs/border-width
  1749. */
  1750. 'border-w-r': [{
  1751. 'border-r': scaleBorderWidth()
  1752. }],
  1753. /**
  1754. * Border Width Bottom
  1755. * @see https://tailwindcss.com/docs/border-width
  1756. */
  1757. 'border-w-b': [{
  1758. 'border-b': scaleBorderWidth()
  1759. }],
  1760. /**
  1761. * Border Width Left
  1762. * @see https://tailwindcss.com/docs/border-width
  1763. */
  1764. 'border-w-l': [{
  1765. 'border-l': scaleBorderWidth()
  1766. }],
  1767. /**
  1768. * Divide Width X
  1769. * @see https://tailwindcss.com/docs/border-width#between-children
  1770. */
  1771. 'divide-x': [{
  1772. 'divide-x': scaleBorderWidth()
  1773. }],
  1774. /**
  1775. * Divide Width X Reverse
  1776. * @see https://tailwindcss.com/docs/border-width#between-children
  1777. */
  1778. 'divide-x-reverse': ['divide-x-reverse'],
  1779. /**
  1780. * Divide Width Y
  1781. * @see https://tailwindcss.com/docs/border-width#between-children
  1782. */
  1783. 'divide-y': [{
  1784. 'divide-y': scaleBorderWidth()
  1785. }],
  1786. /**
  1787. * Divide Width Y Reverse
  1788. * @see https://tailwindcss.com/docs/border-width#between-children
  1789. */
  1790. 'divide-y-reverse': ['divide-y-reverse'],
  1791. /**
  1792. * Border Style
  1793. * @see https://tailwindcss.com/docs/border-style
  1794. */
  1795. 'border-style': [{
  1796. border: [...scaleLineStyle(), 'hidden', 'none']
  1797. }],
  1798. /**
  1799. * Divide Style
  1800. * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
  1801. */
  1802. 'divide-style': [{
  1803. divide: [...scaleLineStyle(), 'hidden', 'none']
  1804. }],
  1805. /**
  1806. * Border Color
  1807. * @see https://tailwindcss.com/docs/border-color
  1808. */
  1809. 'border-color': [{
  1810. border: scaleColor()
  1811. }],
  1812. /**
  1813. * Border Color X
  1814. * @see https://tailwindcss.com/docs/border-color
  1815. */
  1816. 'border-color-x': [{
  1817. 'border-x': scaleColor()
  1818. }],
  1819. /**
  1820. * Border Color Y
  1821. * @see https://tailwindcss.com/docs/border-color
  1822. */
  1823. 'border-color-y': [{
  1824. 'border-y': scaleColor()
  1825. }],
  1826. /**
  1827. * Border Color S
  1828. * @see https://tailwindcss.com/docs/border-color
  1829. */
  1830. 'border-color-s': [{
  1831. 'border-s': scaleColor()
  1832. }],
  1833. /**
  1834. * Border Color E
  1835. * @see https://tailwindcss.com/docs/border-color
  1836. */
  1837. 'border-color-e': [{
  1838. 'border-e': scaleColor()
  1839. }],
  1840. /**
  1841. * Border Color Top
  1842. * @see https://tailwindcss.com/docs/border-color
  1843. */
  1844. 'border-color-t': [{
  1845. 'border-t': scaleColor()
  1846. }],
  1847. /**
  1848. * Border Color Right
  1849. * @see https://tailwindcss.com/docs/border-color
  1850. */
  1851. 'border-color-r': [{
  1852. 'border-r': scaleColor()
  1853. }],
  1854. /**
  1855. * Border Color Bottom
  1856. * @see https://tailwindcss.com/docs/border-color
  1857. */
  1858. 'border-color-b': [{
  1859. 'border-b': scaleColor()
  1860. }],
  1861. /**
  1862. * Border Color Left
  1863. * @see https://tailwindcss.com/docs/border-color
  1864. */
  1865. 'border-color-l': [{
  1866. 'border-l': scaleColor()
  1867. }],
  1868. /**
  1869. * Divide Color
  1870. * @see https://tailwindcss.com/docs/divide-color
  1871. */
  1872. 'divide-color': [{
  1873. divide: scaleColor()
  1874. }],
  1875. /**
  1876. * Outline Style
  1877. * @see https://tailwindcss.com/docs/outline-style
  1878. */
  1879. 'outline-style': [{
  1880. outline: [...scaleLineStyle(), 'none', 'hidden']
  1881. }],
  1882. /**
  1883. * Outline Offset
  1884. * @see https://tailwindcss.com/docs/outline-offset
  1885. */
  1886. 'outline-offset': [{
  1887. 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]
  1888. }],
  1889. /**
  1890. * Outline Width
  1891. * @see https://tailwindcss.com/docs/outline-width
  1892. */
  1893. 'outline-w': [{
  1894. outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]
  1895. }],
  1896. /**
  1897. * Outline Color
  1898. * @see https://tailwindcss.com/docs/outline-color
  1899. */
  1900. 'outline-color': [{
  1901. outline: scaleColor()
  1902. }],
  1903. // ---------------
  1904. // --- Effects ---
  1905. // ---------------
  1906. /**
  1907. * Box Shadow
  1908. * @see https://tailwindcss.com/docs/box-shadow
  1909. */
  1910. shadow: [{
  1911. shadow: [
  1912. // Deprecated since Tailwind CSS v4.0.0
  1913. '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]
  1914. }],
  1915. /**
  1916. * Box Shadow Color
  1917. * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
  1918. */
  1919. 'shadow-color': [{
  1920. shadow: scaleColor()
  1921. }],
  1922. /**
  1923. * Inset Box Shadow
  1924. * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
  1925. */
  1926. 'inset-shadow': [{
  1927. 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
  1928. }],
  1929. /**
  1930. * Inset Box Shadow Color
  1931. * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
  1932. */
  1933. 'inset-shadow-color': [{
  1934. 'inset-shadow': scaleColor()
  1935. }],
  1936. /**
  1937. * Ring Width
  1938. * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
  1939. */
  1940. 'ring-w': [{
  1941. ring: scaleBorderWidth()
  1942. }],
  1943. /**
  1944. * Ring Width Inset
  1945. * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
  1946. * @deprecated since Tailwind CSS v4.0.0
  1947. * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
  1948. */
  1949. 'ring-w-inset': ['ring-inset'],
  1950. /**
  1951. * Ring Color
  1952. * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
  1953. */
  1954. 'ring-color': [{
  1955. ring: scaleColor()
  1956. }],
  1957. /**
  1958. * Ring Offset Width
  1959. * @see https://v3.tailwindcss.com/docs/ring-offset-width
  1960. * @deprecated since Tailwind CSS v4.0.0
  1961. * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
  1962. */
  1963. 'ring-offset-w': [{
  1964. 'ring-offset': [isNumber, isArbitraryLength]
  1965. }],
  1966. /**
  1967. * Ring Offset Color
  1968. * @see https://v3.tailwindcss.com/docs/ring-offset-color
  1969. * @deprecated since Tailwind CSS v4.0.0
  1970. * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
  1971. */
  1972. 'ring-offset-color': [{
  1973. 'ring-offset': scaleColor()
  1974. }],
  1975. /**
  1976. * Inset Ring Width
  1977. * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
  1978. */
  1979. 'inset-ring-w': [{
  1980. 'inset-ring': scaleBorderWidth()
  1981. }],
  1982. /**
  1983. * Inset Ring Color
  1984. * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
  1985. */
  1986. 'inset-ring-color': [{
  1987. 'inset-ring': scaleColor()
  1988. }],
  1989. /**
  1990. * Text Shadow
  1991. * @see https://tailwindcss.com/docs/text-shadow
  1992. */
  1993. 'text-shadow': [{
  1994. 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
  1995. }],
  1996. /**
  1997. * Text Shadow Color
  1998. * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
  1999. */
  2000. 'text-shadow-color': [{
  2001. 'text-shadow': scaleColor()
  2002. }],
  2003. /**
  2004. * Opacity
  2005. * @see https://tailwindcss.com/docs/opacity
  2006. */
  2007. opacity: [{
  2008. opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
  2009. }],
  2010. /**
  2011. * Mix Blend Mode
  2012. * @see https://tailwindcss.com/docs/mix-blend-mode
  2013. */
  2014. 'mix-blend': [{
  2015. 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']
  2016. }],
  2017. /**
  2018. * Background Blend Mode
  2019. * @see https://tailwindcss.com/docs/background-blend-mode
  2020. */
  2021. 'bg-blend': [{
  2022. 'bg-blend': scaleBlendMode()
  2023. }],
  2024. /**
  2025. * Mask Clip
  2026. * @see https://tailwindcss.com/docs/mask-clip
  2027. */
  2028. 'mask-clip': [{
  2029. 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
  2030. }, 'mask-no-clip'],
  2031. /**
  2032. * Mask Composite
  2033. * @see https://tailwindcss.com/docs/mask-composite
  2034. */
  2035. 'mask-composite': [{
  2036. mask: ['add', 'subtract', 'intersect', 'exclude']
  2037. }],
  2038. /**
  2039. * Mask Image
  2040. * @see https://tailwindcss.com/docs/mask-image
  2041. */
  2042. 'mask-image-linear-pos': [{
  2043. 'mask-linear': [isNumber]
  2044. }],
  2045. 'mask-image-linear-from-pos': [{
  2046. 'mask-linear-from': scaleMaskImagePosition()
  2047. }],
  2048. 'mask-image-linear-to-pos': [{
  2049. 'mask-linear-to': scaleMaskImagePosition()
  2050. }],
  2051. 'mask-image-linear-from-color': [{
  2052. 'mask-linear-from': scaleColor()
  2053. }],
  2054. 'mask-image-linear-to-color': [{
  2055. 'mask-linear-to': scaleColor()
  2056. }],
  2057. 'mask-image-t-from-pos': [{
  2058. 'mask-t-from': scaleMaskImagePosition()
  2059. }],
  2060. 'mask-image-t-to-pos': [{
  2061. 'mask-t-to': scaleMaskImagePosition()
  2062. }],
  2063. 'mask-image-t-from-color': [{
  2064. 'mask-t-from': scaleColor()
  2065. }],
  2066. 'mask-image-t-to-color': [{
  2067. 'mask-t-to': scaleColor()
  2068. }],
  2069. 'mask-image-r-from-pos': [{
  2070. 'mask-r-from': scaleMaskImagePosition()
  2071. }],
  2072. 'mask-image-r-to-pos': [{
  2073. 'mask-r-to': scaleMaskImagePosition()
  2074. }],
  2075. 'mask-image-r-from-color': [{
  2076. 'mask-r-from': scaleColor()
  2077. }],
  2078. 'mask-image-r-to-color': [{
  2079. 'mask-r-to': scaleColor()
  2080. }],
  2081. 'mask-image-b-from-pos': [{
  2082. 'mask-b-from': scaleMaskImagePosition()
  2083. }],
  2084. 'mask-image-b-to-pos': [{
  2085. 'mask-b-to': scaleMaskImagePosition()
  2086. }],
  2087. 'mask-image-b-from-color': [{
  2088. 'mask-b-from': scaleColor()
  2089. }],
  2090. 'mask-image-b-to-color': [{
  2091. 'mask-b-to': scaleColor()
  2092. }],
  2093. 'mask-image-l-from-pos': [{
  2094. 'mask-l-from': scaleMaskImagePosition()
  2095. }],
  2096. 'mask-image-l-to-pos': [{
  2097. 'mask-l-to': scaleMaskImagePosition()
  2098. }],
  2099. 'mask-image-l-from-color': [{
  2100. 'mask-l-from': scaleColor()
  2101. }],
  2102. 'mask-image-l-to-color': [{
  2103. 'mask-l-to': scaleColor()
  2104. }],
  2105. 'mask-image-x-from-pos': [{
  2106. 'mask-x-from': scaleMaskImagePosition()
  2107. }],
  2108. 'mask-image-x-to-pos': [{
  2109. 'mask-x-to': scaleMaskImagePosition()
  2110. }],
  2111. 'mask-image-x-from-color': [{
  2112. 'mask-x-from': scaleColor()
  2113. }],
  2114. 'mask-image-x-to-color': [{
  2115. 'mask-x-to': scaleColor()
  2116. }],
  2117. 'mask-image-y-from-pos': [{
  2118. 'mask-y-from': scaleMaskImagePosition()
  2119. }],
  2120. 'mask-image-y-to-pos': [{
  2121. 'mask-y-to': scaleMaskImagePosition()
  2122. }],
  2123. 'mask-image-y-from-color': [{
  2124. 'mask-y-from': scaleColor()
  2125. }],
  2126. 'mask-image-y-to-color': [{
  2127. 'mask-y-to': scaleColor()
  2128. }],
  2129. 'mask-image-radial': [{
  2130. 'mask-radial': [isArbitraryVariable, isArbitraryValue]
  2131. }],
  2132. 'mask-image-radial-from-pos': [{
  2133. 'mask-radial-from': scaleMaskImagePosition()
  2134. }],
  2135. 'mask-image-radial-to-pos': [{
  2136. 'mask-radial-to': scaleMaskImagePosition()
  2137. }],
  2138. 'mask-image-radial-from-color': [{
  2139. 'mask-radial-from': scaleColor()
  2140. }],
  2141. 'mask-image-radial-to-color': [{
  2142. 'mask-radial-to': scaleColor()
  2143. }],
  2144. 'mask-image-radial-shape': [{
  2145. 'mask-radial': ['circle', 'ellipse']
  2146. }],
  2147. 'mask-image-radial-size': [{
  2148. 'mask-radial': [{
  2149. closest: ['side', 'corner'],
  2150. farthest: ['side', 'corner']
  2151. }]
  2152. }],
  2153. 'mask-image-radial-pos': [{
  2154. 'mask-radial-at': scalePosition()
  2155. }],
  2156. 'mask-image-conic-pos': [{
  2157. 'mask-conic': [isNumber]
  2158. }],
  2159. 'mask-image-conic-from-pos': [{
  2160. 'mask-conic-from': scaleMaskImagePosition()
  2161. }],
  2162. 'mask-image-conic-to-pos': [{
  2163. 'mask-conic-to': scaleMaskImagePosition()
  2164. }],
  2165. 'mask-image-conic-from-color': [{
  2166. 'mask-conic-from': scaleColor()
  2167. }],
  2168. 'mask-image-conic-to-color': [{
  2169. 'mask-conic-to': scaleColor()
  2170. }],
  2171. /**
  2172. * Mask Mode
  2173. * @see https://tailwindcss.com/docs/mask-mode
  2174. */
  2175. 'mask-mode': [{
  2176. mask: ['alpha', 'luminance', 'match']
  2177. }],
  2178. /**
  2179. * Mask Origin
  2180. * @see https://tailwindcss.com/docs/mask-origin
  2181. */
  2182. 'mask-origin': [{
  2183. 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
  2184. }],
  2185. /**
  2186. * Mask Position
  2187. * @see https://tailwindcss.com/docs/mask-position
  2188. */
  2189. 'mask-position': [{
  2190. mask: scaleBgPosition()
  2191. }],
  2192. /**
  2193. * Mask Repeat
  2194. * @see https://tailwindcss.com/docs/mask-repeat
  2195. */
  2196. 'mask-repeat': [{
  2197. mask: scaleBgRepeat()
  2198. }],
  2199. /**
  2200. * Mask Size
  2201. * @see https://tailwindcss.com/docs/mask-size
  2202. */
  2203. 'mask-size': [{
  2204. mask: scaleBgSize()
  2205. }],
  2206. /**
  2207. * Mask Type
  2208. * @see https://tailwindcss.com/docs/mask-type
  2209. */
  2210. 'mask-type': [{
  2211. 'mask-type': ['alpha', 'luminance']
  2212. }],
  2213. /**
  2214. * Mask Image
  2215. * @see https://tailwindcss.com/docs/mask-image
  2216. */
  2217. 'mask-image': [{
  2218. mask: ['none', isArbitraryVariable, isArbitraryValue]
  2219. }],
  2220. // ---------------
  2221. // --- Filters ---
  2222. // ---------------
  2223. /**
  2224. * Filter
  2225. * @see https://tailwindcss.com/docs/filter
  2226. */
  2227. filter: [{
  2228. filter: [
  2229. // Deprecated since Tailwind CSS v3.0.0
  2230. '', 'none', isArbitraryVariable, isArbitraryValue]
  2231. }],
  2232. /**
  2233. * Blur
  2234. * @see https://tailwindcss.com/docs/blur
  2235. */
  2236. blur: [{
  2237. blur: scaleBlur()
  2238. }],
  2239. /**
  2240. * Brightness
  2241. * @see https://tailwindcss.com/docs/brightness
  2242. */
  2243. brightness: [{
  2244. brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
  2245. }],
  2246. /**
  2247. * Contrast
  2248. * @see https://tailwindcss.com/docs/contrast
  2249. */
  2250. contrast: [{
  2251. contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
  2252. }],
  2253. /**
  2254. * Drop Shadow
  2255. * @see https://tailwindcss.com/docs/drop-shadow
  2256. */
  2257. 'drop-shadow': [{
  2258. 'drop-shadow': [
  2259. // Deprecated since Tailwind CSS v4.0.0
  2260. '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]
  2261. }],
  2262. /**
  2263. * Drop Shadow Color
  2264. * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
  2265. */
  2266. 'drop-shadow-color': [{
  2267. 'drop-shadow': scaleColor()
  2268. }],
  2269. /**
  2270. * Grayscale
  2271. * @see https://tailwindcss.com/docs/grayscale
  2272. */
  2273. grayscale: [{
  2274. grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2275. }],
  2276. /**
  2277. * Hue Rotate
  2278. * @see https://tailwindcss.com/docs/hue-rotate
  2279. */
  2280. 'hue-rotate': [{
  2281. 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
  2282. }],
  2283. /**
  2284. * Invert
  2285. * @see https://tailwindcss.com/docs/invert
  2286. */
  2287. invert: [{
  2288. invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2289. }],
  2290. /**
  2291. * Saturate
  2292. * @see https://tailwindcss.com/docs/saturate
  2293. */
  2294. saturate: [{
  2295. saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
  2296. }],
  2297. /**
  2298. * Sepia
  2299. * @see https://tailwindcss.com/docs/sepia
  2300. */
  2301. sepia: [{
  2302. sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2303. }],
  2304. /**
  2305. * Backdrop Filter
  2306. * @see https://tailwindcss.com/docs/backdrop-filter
  2307. */
  2308. 'backdrop-filter': [{
  2309. 'backdrop-filter': [
  2310. // Deprecated since Tailwind CSS v3.0.0
  2311. '', 'none', isArbitraryVariable, isArbitraryValue]
  2312. }],
  2313. /**
  2314. * Backdrop Blur
  2315. * @see https://tailwindcss.com/docs/backdrop-blur
  2316. */
  2317. 'backdrop-blur': [{
  2318. 'backdrop-blur': scaleBlur()
  2319. }],
  2320. /**
  2321. * Backdrop Brightness
  2322. * @see https://tailwindcss.com/docs/backdrop-brightness
  2323. */
  2324. 'backdrop-brightness': [{
  2325. 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]
  2326. }],
  2327. /**
  2328. * Backdrop Contrast
  2329. * @see https://tailwindcss.com/docs/backdrop-contrast
  2330. */
  2331. 'backdrop-contrast': [{
  2332. 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]
  2333. }],
  2334. /**
  2335. * Backdrop Grayscale
  2336. * @see https://tailwindcss.com/docs/backdrop-grayscale
  2337. */
  2338. 'backdrop-grayscale': [{
  2339. 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2340. }],
  2341. /**
  2342. * Backdrop Hue Rotate
  2343. * @see https://tailwindcss.com/docs/backdrop-hue-rotate
  2344. */
  2345. 'backdrop-hue-rotate': [{
  2346. 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
  2347. }],
  2348. /**
  2349. * Backdrop Invert
  2350. * @see https://tailwindcss.com/docs/backdrop-invert
  2351. */
  2352. 'backdrop-invert': [{
  2353. 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2354. }],
  2355. /**
  2356. * Backdrop Opacity
  2357. * @see https://tailwindcss.com/docs/backdrop-opacity
  2358. */
  2359. 'backdrop-opacity': [{
  2360. 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]
  2361. }],
  2362. /**
  2363. * Backdrop Saturate
  2364. * @see https://tailwindcss.com/docs/backdrop-saturate
  2365. */
  2366. 'backdrop-saturate': [{
  2367. 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]
  2368. }],
  2369. /**
  2370. * Backdrop Sepia
  2371. * @see https://tailwindcss.com/docs/backdrop-sepia
  2372. */
  2373. 'backdrop-sepia': [{
  2374. 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]
  2375. }],
  2376. // --------------
  2377. // --- Tables ---
  2378. // --------------
  2379. /**
  2380. * Border Collapse
  2381. * @see https://tailwindcss.com/docs/border-collapse
  2382. */
  2383. 'border-collapse': [{
  2384. border: ['collapse', 'separate']
  2385. }],
  2386. /**
  2387. * Border Spacing
  2388. * @see https://tailwindcss.com/docs/border-spacing
  2389. */
  2390. 'border-spacing': [{
  2391. 'border-spacing': scaleUnambiguousSpacing()
  2392. }],
  2393. /**
  2394. * Border Spacing X
  2395. * @see https://tailwindcss.com/docs/border-spacing
  2396. */
  2397. 'border-spacing-x': [{
  2398. 'border-spacing-x': scaleUnambiguousSpacing()
  2399. }],
  2400. /**
  2401. * Border Spacing Y
  2402. * @see https://tailwindcss.com/docs/border-spacing
  2403. */
  2404. 'border-spacing-y': [{
  2405. 'border-spacing-y': scaleUnambiguousSpacing()
  2406. }],
  2407. /**
  2408. * Table Layout
  2409. * @see https://tailwindcss.com/docs/table-layout
  2410. */
  2411. 'table-layout': [{
  2412. table: ['auto', 'fixed']
  2413. }],
  2414. /**
  2415. * Caption Side
  2416. * @see https://tailwindcss.com/docs/caption-side
  2417. */
  2418. caption: [{
  2419. caption: ['top', 'bottom']
  2420. }],
  2421. // ---------------------------------
  2422. // --- Transitions and Animation ---
  2423. // ---------------------------------
  2424. /**
  2425. * Transition Property
  2426. * @see https://tailwindcss.com/docs/transition-property
  2427. */
  2428. transition: [{
  2429. transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]
  2430. }],
  2431. /**
  2432. * Transition Behavior
  2433. * @see https://tailwindcss.com/docs/transition-behavior
  2434. */
  2435. 'transition-behavior': [{
  2436. transition: ['normal', 'discrete']
  2437. }],
  2438. /**
  2439. * Transition Duration
  2440. * @see https://tailwindcss.com/docs/transition-duration
  2441. */
  2442. duration: [{
  2443. duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]
  2444. }],
  2445. /**
  2446. * Transition Timing Function
  2447. * @see https://tailwindcss.com/docs/transition-timing-function
  2448. */
  2449. ease: [{
  2450. ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]
  2451. }],
  2452. /**
  2453. * Transition Delay
  2454. * @see https://tailwindcss.com/docs/transition-delay
  2455. */
  2456. delay: [{
  2457. delay: [isNumber, isArbitraryVariable, isArbitraryValue]
  2458. }],
  2459. /**
  2460. * Animation
  2461. * @see https://tailwindcss.com/docs/animation
  2462. */
  2463. animate: [{
  2464. animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]
  2465. }],
  2466. // ------------------
  2467. // --- Transforms ---
  2468. // ------------------
  2469. /**
  2470. * Backface Visibility
  2471. * @see https://tailwindcss.com/docs/backface-visibility
  2472. */
  2473. backface: [{
  2474. backface: ['hidden', 'visible']
  2475. }],
  2476. /**
  2477. * Perspective
  2478. * @see https://tailwindcss.com/docs/perspective
  2479. */
  2480. perspective: [{
  2481. perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
  2482. }],
  2483. /**
  2484. * Perspective Origin
  2485. * @see https://tailwindcss.com/docs/perspective-origin
  2486. */
  2487. 'perspective-origin': [{
  2488. 'perspective-origin': scalePositionWithArbitrary()
  2489. }],
  2490. /**
  2491. * Rotate
  2492. * @see https://tailwindcss.com/docs/rotate
  2493. */
  2494. rotate: [{
  2495. rotate: scaleRotate()
  2496. }],
  2497. /**
  2498. * Rotate X
  2499. * @see https://tailwindcss.com/docs/rotate
  2500. */
  2501. 'rotate-x': [{
  2502. 'rotate-x': scaleRotate()
  2503. }],
  2504. /**
  2505. * Rotate Y
  2506. * @see https://tailwindcss.com/docs/rotate
  2507. */
  2508. 'rotate-y': [{
  2509. 'rotate-y': scaleRotate()
  2510. }],
  2511. /**
  2512. * Rotate Z
  2513. * @see https://tailwindcss.com/docs/rotate
  2514. */
  2515. 'rotate-z': [{
  2516. 'rotate-z': scaleRotate()
  2517. }],
  2518. /**
  2519. * Scale
  2520. * @see https://tailwindcss.com/docs/scale
  2521. */
  2522. scale: [{
  2523. scale: scaleScale()
  2524. }],
  2525. /**
  2526. * Scale X
  2527. * @see https://tailwindcss.com/docs/scale
  2528. */
  2529. 'scale-x': [{
  2530. 'scale-x': scaleScale()
  2531. }],
  2532. /**
  2533. * Scale Y
  2534. * @see https://tailwindcss.com/docs/scale
  2535. */
  2536. 'scale-y': [{
  2537. 'scale-y': scaleScale()
  2538. }],
  2539. /**
  2540. * Scale Z
  2541. * @see https://tailwindcss.com/docs/scale
  2542. */
  2543. 'scale-z': [{
  2544. 'scale-z': scaleScale()
  2545. }],
  2546. /**
  2547. * Scale 3D
  2548. * @see https://tailwindcss.com/docs/scale
  2549. */
  2550. 'scale-3d': ['scale-3d'],
  2551. /**
  2552. * Skew
  2553. * @see https://tailwindcss.com/docs/skew
  2554. */
  2555. skew: [{
  2556. skew: scaleSkew()
  2557. }],
  2558. /**
  2559. * Skew X
  2560. * @see https://tailwindcss.com/docs/skew
  2561. */
  2562. 'skew-x': [{
  2563. 'skew-x': scaleSkew()
  2564. }],
  2565. /**
  2566. * Skew Y
  2567. * @see https://tailwindcss.com/docs/skew
  2568. */
  2569. 'skew-y': [{
  2570. 'skew-y': scaleSkew()
  2571. }],
  2572. /**
  2573. * Transform
  2574. * @see https://tailwindcss.com/docs/transform
  2575. */
  2576. transform: [{
  2577. transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']
  2578. }],
  2579. /**
  2580. * Transform Origin
  2581. * @see https://tailwindcss.com/docs/transform-origin
  2582. */
  2583. 'transform-origin': [{
  2584. origin: scalePositionWithArbitrary()
  2585. }],
  2586. /**
  2587. * Transform Style
  2588. * @see https://tailwindcss.com/docs/transform-style
  2589. */
  2590. 'transform-style': [{
  2591. transform: ['3d', 'flat']
  2592. }],
  2593. /**
  2594. * Translate
  2595. * @see https://tailwindcss.com/docs/translate
  2596. */
  2597. translate: [{
  2598. translate: scaleTranslate()
  2599. }],
  2600. /**
  2601. * Translate X
  2602. * @see https://tailwindcss.com/docs/translate
  2603. */
  2604. 'translate-x': [{
  2605. 'translate-x': scaleTranslate()
  2606. }],
  2607. /**
  2608. * Translate Y
  2609. * @see https://tailwindcss.com/docs/translate
  2610. */
  2611. 'translate-y': [{
  2612. 'translate-y': scaleTranslate()
  2613. }],
  2614. /**
  2615. * Translate Z
  2616. * @see https://tailwindcss.com/docs/translate
  2617. */
  2618. 'translate-z': [{
  2619. 'translate-z': scaleTranslate()
  2620. }],
  2621. /**
  2622. * Translate None
  2623. * @see https://tailwindcss.com/docs/translate
  2624. */
  2625. 'translate-none': ['translate-none'],
  2626. // ---------------------
  2627. // --- Interactivity ---
  2628. // ---------------------
  2629. /**
  2630. * Accent Color
  2631. * @see https://tailwindcss.com/docs/accent-color
  2632. */
  2633. accent: [{
  2634. accent: scaleColor()
  2635. }],
  2636. /**
  2637. * Appearance
  2638. * @see https://tailwindcss.com/docs/appearance
  2639. */
  2640. appearance: [{
  2641. appearance: ['none', 'auto']
  2642. }],
  2643. /**
  2644. * Caret Color
  2645. * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
  2646. */
  2647. 'caret-color': [{
  2648. caret: scaleColor()
  2649. }],
  2650. /**
  2651. * Color Scheme
  2652. * @see https://tailwindcss.com/docs/color-scheme
  2653. */
  2654. 'color-scheme': [{
  2655. scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']
  2656. }],
  2657. /**
  2658. * Cursor
  2659. * @see https://tailwindcss.com/docs/cursor
  2660. */
  2661. cursor: [{
  2662. 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]
  2663. }],
  2664. /**
  2665. * Field Sizing
  2666. * @see https://tailwindcss.com/docs/field-sizing
  2667. */
  2668. 'field-sizing': [{
  2669. 'field-sizing': ['fixed', 'content']
  2670. }],
  2671. /**
  2672. * Pointer Events
  2673. * @see https://tailwindcss.com/docs/pointer-events
  2674. */
  2675. 'pointer-events': [{
  2676. 'pointer-events': ['auto', 'none']
  2677. }],
  2678. /**
  2679. * Resize
  2680. * @see https://tailwindcss.com/docs/resize
  2681. */
  2682. resize: [{
  2683. resize: ['none', '', 'y', 'x']
  2684. }],
  2685. /**
  2686. * Scroll Behavior
  2687. * @see https://tailwindcss.com/docs/scroll-behavior
  2688. */
  2689. 'scroll-behavior': [{
  2690. scroll: ['auto', 'smooth']
  2691. }],
  2692. /**
  2693. * Scroll Margin
  2694. * @see https://tailwindcss.com/docs/scroll-margin
  2695. */
  2696. 'scroll-m': [{
  2697. 'scroll-m': scaleUnambiguousSpacing()
  2698. }],
  2699. /**
  2700. * Scroll Margin X
  2701. * @see https://tailwindcss.com/docs/scroll-margin
  2702. */
  2703. 'scroll-mx': [{
  2704. 'scroll-mx': scaleUnambiguousSpacing()
  2705. }],
  2706. /**
  2707. * Scroll Margin Y
  2708. * @see https://tailwindcss.com/docs/scroll-margin
  2709. */
  2710. 'scroll-my': [{
  2711. 'scroll-my': scaleUnambiguousSpacing()
  2712. }],
  2713. /**
  2714. * Scroll Margin Start
  2715. * @see https://tailwindcss.com/docs/scroll-margin
  2716. */
  2717. 'scroll-ms': [{
  2718. 'scroll-ms': scaleUnambiguousSpacing()
  2719. }],
  2720. /**
  2721. * Scroll Margin End
  2722. * @see https://tailwindcss.com/docs/scroll-margin
  2723. */
  2724. 'scroll-me': [{
  2725. 'scroll-me': scaleUnambiguousSpacing()
  2726. }],
  2727. /**
  2728. * Scroll Margin Top
  2729. * @see https://tailwindcss.com/docs/scroll-margin
  2730. */
  2731. 'scroll-mt': [{
  2732. 'scroll-mt': scaleUnambiguousSpacing()
  2733. }],
  2734. /**
  2735. * Scroll Margin Right
  2736. * @see https://tailwindcss.com/docs/scroll-margin
  2737. */
  2738. 'scroll-mr': [{
  2739. 'scroll-mr': scaleUnambiguousSpacing()
  2740. }],
  2741. /**
  2742. * Scroll Margin Bottom
  2743. * @see https://tailwindcss.com/docs/scroll-margin
  2744. */
  2745. 'scroll-mb': [{
  2746. 'scroll-mb': scaleUnambiguousSpacing()
  2747. }],
  2748. /**
  2749. * Scroll Margin Left
  2750. * @see https://tailwindcss.com/docs/scroll-margin
  2751. */
  2752. 'scroll-ml': [{
  2753. 'scroll-ml': scaleUnambiguousSpacing()
  2754. }],
  2755. /**
  2756. * Scroll Padding
  2757. * @see https://tailwindcss.com/docs/scroll-padding
  2758. */
  2759. 'scroll-p': [{
  2760. 'scroll-p': scaleUnambiguousSpacing()
  2761. }],
  2762. /**
  2763. * Scroll Padding X
  2764. * @see https://tailwindcss.com/docs/scroll-padding
  2765. */
  2766. 'scroll-px': [{
  2767. 'scroll-px': scaleUnambiguousSpacing()
  2768. }],
  2769. /**
  2770. * Scroll Padding Y
  2771. * @see https://tailwindcss.com/docs/scroll-padding
  2772. */
  2773. 'scroll-py': [{
  2774. 'scroll-py': scaleUnambiguousSpacing()
  2775. }],
  2776. /**
  2777. * Scroll Padding Start
  2778. * @see https://tailwindcss.com/docs/scroll-padding
  2779. */
  2780. 'scroll-ps': [{
  2781. 'scroll-ps': scaleUnambiguousSpacing()
  2782. }],
  2783. /**
  2784. * Scroll Padding End
  2785. * @see https://tailwindcss.com/docs/scroll-padding
  2786. */
  2787. 'scroll-pe': [{
  2788. 'scroll-pe': scaleUnambiguousSpacing()
  2789. }],
  2790. /**
  2791. * Scroll Padding Top
  2792. * @see https://tailwindcss.com/docs/scroll-padding
  2793. */
  2794. 'scroll-pt': [{
  2795. 'scroll-pt': scaleUnambiguousSpacing()
  2796. }],
  2797. /**
  2798. * Scroll Padding Right
  2799. * @see https://tailwindcss.com/docs/scroll-padding
  2800. */
  2801. 'scroll-pr': [{
  2802. 'scroll-pr': scaleUnambiguousSpacing()
  2803. }],
  2804. /**
  2805. * Scroll Padding Bottom
  2806. * @see https://tailwindcss.com/docs/scroll-padding
  2807. */
  2808. 'scroll-pb': [{
  2809. 'scroll-pb': scaleUnambiguousSpacing()
  2810. }],
  2811. /**
  2812. * Scroll Padding Left
  2813. * @see https://tailwindcss.com/docs/scroll-padding
  2814. */
  2815. 'scroll-pl': [{
  2816. 'scroll-pl': scaleUnambiguousSpacing()
  2817. }],
  2818. /**
  2819. * Scroll Snap Align
  2820. * @see https://tailwindcss.com/docs/scroll-snap-align
  2821. */
  2822. 'snap-align': [{
  2823. snap: ['start', 'end', 'center', 'align-none']
  2824. }],
  2825. /**
  2826. * Scroll Snap Stop
  2827. * @see https://tailwindcss.com/docs/scroll-snap-stop
  2828. */
  2829. 'snap-stop': [{
  2830. snap: ['normal', 'always']
  2831. }],
  2832. /**
  2833. * Scroll Snap Type
  2834. * @see https://tailwindcss.com/docs/scroll-snap-type
  2835. */
  2836. 'snap-type': [{
  2837. snap: ['none', 'x', 'y', 'both']
  2838. }],
  2839. /**
  2840. * Scroll Snap Type Strictness
  2841. * @see https://tailwindcss.com/docs/scroll-snap-type
  2842. */
  2843. 'snap-strictness': [{
  2844. snap: ['mandatory', 'proximity']
  2845. }],
  2846. /**
  2847. * Touch Action
  2848. * @see https://tailwindcss.com/docs/touch-action
  2849. */
  2850. touch: [{
  2851. touch: ['auto', 'none', 'manipulation']
  2852. }],
  2853. /**
  2854. * Touch Action X
  2855. * @see https://tailwindcss.com/docs/touch-action
  2856. */
  2857. 'touch-x': [{
  2858. 'touch-pan': ['x', 'left', 'right']
  2859. }],
  2860. /**
  2861. * Touch Action Y
  2862. * @see https://tailwindcss.com/docs/touch-action
  2863. */
  2864. 'touch-y': [{
  2865. 'touch-pan': ['y', 'up', 'down']
  2866. }],
  2867. /**
  2868. * Touch Action Pinch Zoom
  2869. * @see https://tailwindcss.com/docs/touch-action
  2870. */
  2871. 'touch-pz': ['touch-pinch-zoom'],
  2872. /**
  2873. * User Select
  2874. * @see https://tailwindcss.com/docs/user-select
  2875. */
  2876. select: [{
  2877. select: ['none', 'text', 'all', 'auto']
  2878. }],
  2879. /**
  2880. * Will Change
  2881. * @see https://tailwindcss.com/docs/will-change
  2882. */
  2883. 'will-change': [{
  2884. 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]
  2885. }],
  2886. // -----------
  2887. // --- SVG ---
  2888. // -----------
  2889. /**
  2890. * Fill
  2891. * @see https://tailwindcss.com/docs/fill
  2892. */
  2893. fill: [{
  2894. fill: ['none', ...scaleColor()]
  2895. }],
  2896. /**
  2897. * Stroke Width
  2898. * @see https://tailwindcss.com/docs/stroke-width
  2899. */
  2900. 'stroke-w': [{
  2901. stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
  2902. }],
  2903. /**
  2904. * Stroke
  2905. * @see https://tailwindcss.com/docs/stroke
  2906. */
  2907. stroke: [{
  2908. stroke: ['none', ...scaleColor()]
  2909. }],
  2910. // ---------------------
  2911. // --- Accessibility ---
  2912. // ---------------------
  2913. /**
  2914. * Forced Color Adjust
  2915. * @see https://tailwindcss.com/docs/forced-color-adjust
  2916. */
  2917. 'forced-color-adjust': [{
  2918. 'forced-color-adjust': ['auto', 'none']
  2919. }]
  2920. },
  2921. conflictingClassGroups: {
  2922. overflow: ['overflow-x', 'overflow-y'],
  2923. overscroll: ['overscroll-x', 'overscroll-y'],
  2924. inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
  2925. 'inset-x': ['right', 'left'],
  2926. 'inset-y': ['top', 'bottom'],
  2927. flex: ['basis', 'grow', 'shrink'],
  2928. gap: ['gap-x', 'gap-y'],
  2929. p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
  2930. px: ['pr', 'pl'],
  2931. py: ['pt', 'pb'],
  2932. m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
  2933. mx: ['mr', 'ml'],
  2934. my: ['mt', 'mb'],
  2935. size: ['w', 'h'],
  2936. 'font-size': ['leading'],
  2937. 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
  2938. 'fvn-ordinal': ['fvn-normal'],
  2939. 'fvn-slashed-zero': ['fvn-normal'],
  2940. 'fvn-figure': ['fvn-normal'],
  2941. 'fvn-spacing': ['fvn-normal'],
  2942. 'fvn-fraction': ['fvn-normal'],
  2943. 'line-clamp': ['display', 'overflow'],
  2944. 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'],
  2945. 'rounded-s': ['rounded-ss', 'rounded-es'],
  2946. 'rounded-e': ['rounded-se', 'rounded-ee'],
  2947. 'rounded-t': ['rounded-tl', 'rounded-tr'],
  2948. 'rounded-r': ['rounded-tr', 'rounded-br'],
  2949. 'rounded-b': ['rounded-br', 'rounded-bl'],
  2950. 'rounded-l': ['rounded-tl', 'rounded-bl'],
  2951. 'border-spacing': ['border-spacing-x', 'border-spacing-y'],
  2952. 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
  2953. 'border-w-x': ['border-w-r', 'border-w-l'],
  2954. 'border-w-y': ['border-w-t', 'border-w-b'],
  2955. 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
  2956. 'border-color-x': ['border-color-r', 'border-color-l'],
  2957. 'border-color-y': ['border-color-t', 'border-color-b'],
  2958. translate: ['translate-x', 'translate-y', 'translate-none'],
  2959. 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
  2960. 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
  2961. 'scroll-mx': ['scroll-mr', 'scroll-ml'],
  2962. 'scroll-my': ['scroll-mt', 'scroll-mb'],
  2963. 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
  2964. 'scroll-px': ['scroll-pr', 'scroll-pl'],
  2965. 'scroll-py': ['scroll-pt', 'scroll-pb'],
  2966. touch: ['touch-x', 'touch-y', 'touch-pz'],
  2967. 'touch-x': ['touch'],
  2968. 'touch-y': ['touch'],
  2969. 'touch-pz': ['touch']
  2970. },
  2971. conflictingClassGroupModifiers: {
  2972. 'font-size': ['leading']
  2973. },
  2974. orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']
  2975. };
  2976. };
  2977. /**
  2978. * @param baseConfig Config where other config will be merged into. This object will be mutated.
  2979. * @param configExtension Partial config to merge into the `baseConfig`.
  2980. */
  2981. const mergeConfigs = (baseConfig, {
  2982. cacheSize,
  2983. prefix,
  2984. experimentalParseClassName,
  2985. extend = {},
  2986. override = {}
  2987. }) => {
  2988. overrideProperty(baseConfig, 'cacheSize', cacheSize);
  2989. overrideProperty(baseConfig, 'prefix', prefix);
  2990. overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName);
  2991. overrideConfigProperties(baseConfig.theme, override.theme);
  2992. overrideConfigProperties(baseConfig.classGroups, override.classGroups);
  2993. overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);
  2994. overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);
  2995. overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers);
  2996. mergeConfigProperties(baseConfig.theme, extend.theme);
  2997. mergeConfigProperties(baseConfig.classGroups, extend.classGroups);
  2998. mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);
  2999. mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);
  3000. mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers');
  3001. return baseConfig;
  3002. };
  3003. const overrideProperty = (baseObject, overrideKey, overrideValue) => {
  3004. if (overrideValue !== undefined) {
  3005. baseObject[overrideKey] = overrideValue;
  3006. }
  3007. };
  3008. const overrideConfigProperties = (baseObject, overrideObject) => {
  3009. if (overrideObject) {
  3010. for (const key in overrideObject) {
  3011. overrideProperty(baseObject, key, overrideObject[key]);
  3012. }
  3013. }
  3014. };
  3015. const mergeConfigProperties = (baseObject, mergeObject) => {
  3016. if (mergeObject) {
  3017. for (const key in mergeObject) {
  3018. mergeArrayProperties(baseObject, mergeObject, key);
  3019. }
  3020. }
  3021. };
  3022. const mergeArrayProperties = (baseObject, mergeObject, key) => {
  3023. const mergeValue = mergeObject[key];
  3024. if (mergeValue !== undefined) {
  3025. baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;
  3026. }
  3027. };
  3028. const extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
  3029. const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
  3030. export { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };
  3031. //# sourceMappingURL=bundle-mjs.mjs.map