@@ -1002,14 +1002,10 @@ describe('using apply with the prefix option', () => {
10021002
10031003 test ( 'a "Did You Mean" suggestion is omitted if a similar class cannot be identified.' , ( ) => {
10041004 const input = `
1005- .foo { @apply anteater; }
1006- `
1005+ .foo { @apply anteater; }
1006+ `
10071007
1008- const config = resolveConfig ( [
1009- {
1010- ...defaultConfig ,
1011- } ,
1012- ] )
1008+ const config = resolveConfig ( [ { ...defaultConfig } ] )
10131009
10141010 expect . assertions ( 1 )
10151011
@@ -1109,7 +1105,7 @@ test('you can apply classes to a rule with multiple selectors', () => {
11091105 @apply float-left opacity-50 hover:opacity-100 md:float-right;
11101106 }
11111107 }
1112- `
1108+ `
11131109
11141110 const expected = `
11151111 @supports (display: grid) {
@@ -1134,6 +1130,48 @@ test('you can apply classes to a rule with multiple selectors', () => {
11341130 } )
11351131} )
11361132
1133+ test ( 'you can apply classes to a rule with multiple selectors with important and a prefix enabled' , ( ) => {
1134+ const input = `
1135+ @supports (display: grid) {
1136+ .foo, h1 > .bar * {
1137+ @apply tw-float-left tw-opacity-50 hover:tw-opacity-100 md:tw-float-right;
1138+ }
1139+ }
1140+ `
1141+
1142+ const expected = `
1143+ @supports (display: grid) {
1144+ .foo, h1 > .bar * {
1145+ float: left;
1146+ opacity: 0.5;
1147+ }
1148+
1149+ .foo:hover, h1 > .bar *:hover {
1150+ opacity: 1;
1151+ }
1152+
1153+ @media (min-width: 768px) {
1154+ .foo, h1 > .bar * {
1155+ float: right;
1156+ }
1157+ }
1158+ }
1159+ `
1160+
1161+ const config = resolveConfig ( [
1162+ {
1163+ ...defaultConfig ,
1164+ prefix : 'tw-' ,
1165+ important : true ,
1166+ } ,
1167+ ] )
1168+
1169+ return run ( input , config ) . then ( ( result ) => {
1170+ expect ( result . css ) . toMatchCss ( expected )
1171+ expect ( result . warnings ( ) . length ) . toBe ( 0 )
1172+ } )
1173+ } )
1174+
11371175test ( 'you can apply classes in a nested rule' , ( ) => {
11381176 const input = `
11391177 .selector {
@@ -1241,11 +1279,11 @@ test('declarations within a rule that uses @apply can be !important', () => {
12411279 `
12421280
12431281 const expected = `
1244- .foo {
1245- text-align: center;
1246- float: left;
1247- display: block !important;
1248- }
1282+ .foo {
1283+ text-align: center;
1284+ float: left;
1285+ display: block !important;
1286+ }
12491287 `
12501288
12511289 expect . assertions ( 2 )
@@ -1266,11 +1304,11 @@ test('declarations within a rule that uses @apply with !important remain not !im
12661304 `
12671305
12681306 const expected = `
1269- .foo {
1270- text-align: center !important;
1271- float: left;
1272- display: block !important;
1273- }
1307+ .foo {
1308+ text-align: center !important;
1309+ float: left;
1310+ display: block !important;
1311+ }
12741312 `
12751313
12761314 expect . assertions ( 2 )
0 commit comments