@@ -261,6 +261,108 @@ crosscheck(() => {
261261 } )
262262 } )
263263
264+ it ( 'supports min-* and max-* variants with or without arbitrary dimension prefixes' , ( ) => {
265+ let config = {
266+ content : [
267+ {
268+ raw : html `
269+ <div
270+ class= "font-bold min-[100px]:font-bold max-[100px]:font-bold min-[w:100px]:font-bold max-[w:100px]:font-bold min-[h:100px]:font-bold max-[h:100px]:font-bold"
271+ > </ div>
272+ ` ,
273+ } ,
274+ ] ,
275+ corePlugins : { preflight : false } ,
276+ theme : {
277+ screens : defaultScreens ,
278+ } ,
279+ }
280+
281+ let input = css `
282+ @tailwind utilities;
283+ `
284+
285+ return run ( input , config ) . then ( ( result ) => {
286+ expect ( result . css ) . toMatchFormattedCss ( css `
287+ .font-bold {
288+ font-weight : 700 ;
289+ }
290+ @media (max-width : 100px ) {
291+ .max-\[100px\]\:font-bold {
292+ font-weight : 700 ;
293+ }
294+ }
295+ @media (max-height : 100px ) {
296+ .max-\[h\:100px\]\:font-bold {
297+ font-weight : 700 ;
298+ }
299+ }
300+ @media (max-width : 100px ) {
301+ .max-\[w\:100px\]\:font-bold {
302+ font-weight : 700 ;
303+ }
304+ }
305+ @media (min-width : 100px ) {
306+ .min-\[100px\]\:font-bold {
307+ font-weight : 700 ;
308+ }
309+ }
310+ @media (min-height : 100px ) {
311+ .min-\[h\:100px\]\:font-bold {
312+ font-weight : 700 ;
313+ }
314+ }
315+ @media (min-width : 100px ) {
316+ .min-\[w\:100px\]\:font-bold {
317+ font-weight : 700 ;
318+ }
319+ }
320+ ` )
321+ } )
322+ } )
323+
324+ it ( 'supports min-* and max-* variants being used together with or without arbitrary dimension prefixes' , ( ) => {
325+ let config = {
326+ content : [
327+ {
328+ raw : html `
329+ <div
330+ class= "min-[100px]:min-[w:100px]:min-[h:100px]:max-[100px]:max-[w:100px]:max-[h:100px]:font-bold"
331+ > </ div>
332+ ` ,
333+ } ,
334+ ] ,
335+ corePlugins : { preflight : false } ,
336+ theme : {
337+ screens : defaultScreens ,
338+ } ,
339+ }
340+
341+ let input = css `
342+ @tailwind utilities;
343+ `
344+
345+ return run ( input , config ) . then ( ( result ) => {
346+ expect ( result . css ) . toMatchFormattedCss ( css `
347+ @media (min-width : 100px ) {
348+ @media (min-width : 100px ) {
349+ @media (min-height : 100px ) {
350+ @media (max-width : 100px ) {
351+ @media (max-width : 100px ) {
352+ @media (max-height : 100px ) {
353+ .min-\[100px\]\:min-\[w\:100px\]\:min-\[h\:100px\]\:max-\[100px\]\:max-\[w\:100px\]\:max-\[h\:100px\]\:font-bold {
354+ font-weight : 700 ;
355+ }
356+ }
357+ }
358+ }
359+ }
360+ }
361+ }
362+ ` )
363+ } )
364+ } )
365+
264366 it ( 'warns when using min variants with complex screen configs' , async ( ) => {
265367 let config = {
266368 content : [
0 commit comments