bundle-cjs.js 91 KB

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