11diff --git a/node_modules/@tailwindcss/jit/src/lib/generateRules.js b/node_modules/@tailwindcss/jit/src/lib/generateRules.js
2- index 7c98014..42a357f 100644
2+ index fe48a0d..28abdf5 100644
33--- a/node_modules/@tailwindcss/jit/src/lib/generateRules.js
44+++ b/node_modules/@tailwindcss/jit/src/lib/generateRules.js
5- @@ -65,16 +65,21 @@ function applyPrefix (matches, context ) {
5+ @@ -94,12 +94,15 @@ function applyImportant (matches) {
66 // and `focus:hover:text-center` in the same project, but it doesn't feel
77 // worth the complexity for that case.
88
@@ -16,16 +16,10 @@ index 7c98014..42a357f 100644
1616+ let updateSort =
1717+ hasLibVariant &&
1818+ !['sm', 'md', 'lg', 'xl', '2xl', 'motion-safe', 'dark', 'motion-reduce'].includes(variant)
19- +
2019 let [variantSort, applyThisVariant] = context.variantMap.get(variant)
2120 let result = []
2221
23- for (let [{ sort, layer, options }, rule] of matches) {
24- +
25- if (options.respectVariants === false) {
26- result.push([{ sort, layer, options }, rule])
27- continue
28- @@ -110,7 +115,10 @@ function applyVariant(variant, matches, context) {
22+ @@ -139,7 +142,10 @@ function applyVariant(variant, matches, context) {
2923 continue
3024 }
3125
@@ -37,15 +31,15 @@ index 7c98014..42a357f 100644
3731 result.push(withOffset)
3832 }
3933
40- @@ -171 ,6 +179 ,7 @@ function sortAgainst(toSort, against) {
34+ @@ -200 ,6 +206 ,7 @@ function sortAgainst(toSort, against) {
4135 function* resolveMatches(candidate, context) {
4236 let separator = context.tailwindConfig.separator
4337 let [classCandidate, ...variants] = candidate.split(separator).reverse()
4438+ let hasLibVariant = variants.includes('lib')
39+ let important = false
4540
46- // Strip prefix
47- // md:hover:tw-bg-black
48- @@ -196,7 +205,14 @@ function* resolveMatches(candidate, context) {
41+ if (classCandidate.startsWith('!')) {
42+ @@ -231,7 +238,14 @@ function* resolveMatches(candidate, context) {
4943 for (let ruleSet of [].concat(plugin(modifier, pluginHelpers))) {
5044 let [rules, options] = parseRules(ruleSet, context.postCssNodeCache)
5145 for (let rule of rules) {
@@ -61,24 +55,24 @@ index 7c98014..42a357f 100644
6155 }
6256 }
6357 }
64- @@ -205 ,7 +221 ,14 @@ function* resolveMatches(candidate, context) {
58+ @@ -240 ,7 +254 ,14 @@ function* resolveMatches(candidate, context) {
6559 let ruleSet = plugin
6660 let [rules, options] = parseRules(ruleSet, context.postCssNodeCache)
6761 for (let rule of rules) {
6862- matches.push([{ ...sort, options: { ...sort.options, ...options } }, rule])
6963+ matches.push([
70- + {
71- + ...sort,
72- + options: { ...sort.options, ...options },
73- + sort: hasLibVariant ? 0n : sort.sort,
74- + },
75- + rule,
76- + ])
64+ + {
65+ + ...sort,
66+ + options: { ...sort.options, ...options },
67+ + sort: hasLibVariant ? 0n : sort.sort,
68+ + },
69+ + rule,
70+ + ])
7771 }
7872 }
7973 }
80- @@ -213 ,7 +236 ,7 @@ function* resolveMatches(candidate, context) {
81- matches = applyPrefix(matches, context)
74+ @@ -252 ,7 +273 ,7 @@ function* resolveMatches(candidate, context) {
75+ }
8276
8377 for (let variant of variants) {
8478- matches = applyVariant(variant, matches, context)
@@ -87,10 +81,10 @@ index 7c98014..42a357f 100644
8781
8882 for (let match of matches) {
8983diff --git a/node_modules/@tailwindcss/jit/src/lib/setupContext.js b/node_modules/@tailwindcss/jit/src/lib/setupContext.js
90- index c2a4133..68b3c9f 100644
84+ index 65538d0..27c9c4b 100644
9185--- a/node_modules/@tailwindcss/jit/src/lib/setupContext.js
9286+++ b/node_modules/@tailwindcss/jit/src/lib/setupContext.js
93- @@ -559 ,10 +559 ,11 @@ function collectLayerPlugins(root) {
87+ @@ -613 ,10 +613 ,11 @@ function collectLayerPlugins(root) {
9488 function registerPlugins(tailwindConfig, plugins, context) {
9589 let variantList = []
9690 let variantMap = new Map()
@@ -105,7 +99,7 @@ index c2a4133..68b3c9f 100644
10599 }
106100
107101 let pluginApi = buildPluginApi(tailwindConfig, context, {
108- @@ -586 ,7 +587 ,7 @@ function registerPlugins(tailwindConfig, plugins, context) {
102+ @@ -640 ,7 +641 ,7 @@ function registerPlugins(tailwindConfig, plugins, context) {
109103 offsets.components,
110104 offsets.utilities,
111105 ])
@@ -114,7 +108,7 @@ index c2a4133..68b3c9f 100644
114108
115109 context.layerOrder = {
116110 base: (1n << reservedBits) << 0n,
117- @@ -595 ,10 +596 ,10 @@ function registerPlugins(tailwindConfig, plugins, context) {
111+ @@ -649 ,10 +650 ,10 @@ function registerPlugins(tailwindConfig, plugins, context) {
118112 }
119113
120114 reservedBits += 3n
@@ -123,9 +117,9 @@ index c2a4133..68b3c9f 100644
123117- new Map()
124118- )
125119+ context.variantOrder = variantList.reduce((map, variant, i) => {
126- + if (variant.includes('lib')) return map.set(variant, 1n)
127- + return map.set(variant, (1n << BigInt(i)) << reservedBits)
128- + }, new Map())
120+ + if (variant.includes('lib')) return map.set(variant, 1n)
121+ + return map.set(variant, (1n << BigInt(i)) << reservedBits)
122+ + }, new Map())
129123
130124 context.minimumScreen = [...context.variantOrder.values()].shift()
131125
0 commit comments