@@ -13,7 +13,7 @@ test('it can generate responsive variants', () => {
1313 .chocolate { color: brown; }
1414 }
1515
16- @tailwind screens;
16+ @screens utilities ;
1717 `
1818
1919 const output = `
@@ -55,7 +55,7 @@ test('it can generate responsive variants with a custom separator', () => {
5555 .chocolate { color: brown; }
5656 }
5757
58- @tailwind screens;
58+ @screens utilities ;
5959 `
6060
6161 const output = `
@@ -97,7 +97,7 @@ test('it can generate responsive variants when classes have non-standard charact
9797 .chocolate-2\\.5 { color: brown; }
9898 }
9999
100- @tailwind screens;
100+ @screens utilities ;
101101 `
102102
103103 const output = `
@@ -144,7 +144,7 @@ test('responsive variants are grouped', () => {
144144 .chocolate { color: brown; }
145145 }
146146
147- @tailwind screens;
147+ @screens utilities ;
148148 `
149149
150150 const output = `
@@ -190,7 +190,7 @@ test('it can generate responsive variants for nested at-rules', () => {
190190 }
191191 }
192192
193- @tailwind screens;
193+ @screens utilities ;
194194 `
195195
196196 const output = `
@@ -255,7 +255,7 @@ test('it can generate responsive variants for deeply nested at-rules', () => {
255255 }
256256 }
257257
258- @tailwind screens;
258+ @screens utilities ;
259259 `
260260
261261 const output = `
@@ -320,7 +320,7 @@ test('screen prefix is only applied to the last class in a selector', () => {
320320 .banana li * .sandwich #foo > div { color: yellow; }
321321 }
322322
323- @tailwind screens;
323+ @screens utilities ;
324324 `
325325
326326 const output = `
@@ -357,7 +357,7 @@ test('responsive variants are generated for all selectors in a rule', () => {
357357 .foo, .bar { color: yellow; }
358358 }
359359
360- @tailwind screens;
360+ @screens utilities ;
361361 `
362362
363363 const output = `
@@ -394,7 +394,7 @@ test('selectors with no classes cannot be made responsive', () => {
394394 div { color: yellow; }
395395 }
396396
397- @tailwind screens;
397+ @screens utilities ;
398398 `
399399 expect . assertions ( 1 )
400400 return run ( input , {
@@ -417,7 +417,7 @@ test('all selectors in a rule must contain classes', () => {
417417 .foo, div { color: yellow; }
418418 }
419419
420- @tailwind screens;
420+ @screens utilities ;
421421 `
422422 expect . assertions ( 1 )
423423 return run ( input , {
@@ -433,3 +433,59 @@ test('all selectors in a rule must contain classes', () => {
433433 expect ( e ) . toMatchObject ( { name : 'CssSyntaxError' } )
434434 } )
435435} )
436+
437+ test ( 'responsive components are inserted at @screens components' , ( ) => {
438+ const input = `
439+ @responsive components {
440+ .banana { color: yellow; }
441+ }
442+
443+ .apple { color: red; }
444+
445+ @screens components;
446+
447+ @responsive {
448+ .chocolate { color: brown; }
449+ }
450+
451+ @screens utilities;
452+ `
453+
454+ const output = `
455+ .banana { color: yellow; }
456+ .apple { color: red; }
457+ @media (min-width: 500px) {
458+ .sm\\:banana { color: yellow; }
459+ }
460+ @media (min-width: 750px) {
461+ .md\\:banana { color: yellow; }
462+ }
463+ @media (min-width: 1000px) {
464+ .lg\\:banana { color: yellow; }
465+ }
466+ .chocolate { color: brown; }
467+ @media (min-width: 500px) {
468+ .sm\\:chocolate { color: brown; }
469+ }
470+ @media (min-width: 750px) {
471+ .md\\:chocolate { color: brown; }
472+ }
473+ @media (min-width: 1000px) {
474+ .lg\\:chocolate { color: brown; }
475+ }
476+ `
477+
478+ return run ( input , {
479+ theme : {
480+ screens : {
481+ sm : '500px' ,
482+ md : '750px' ,
483+ lg : '1000px' ,
484+ } ,
485+ } ,
486+ separator : ':' ,
487+ } ) . then ( result => {
488+ expect ( result . css ) . toMatchCss ( output )
489+ expect ( result . warnings ( ) . length ) . toBe ( 0 )
490+ } )
491+ } )
0 commit comments