@@ -26,7 +26,7 @@ it('should not generate nested selectors if the feature flag is not enabled', ()
26
26
27
27
it ( 'should be possible to group variants' , ( ) => {
28
28
let config = {
29
- experimental : 'all' ,
29
+ experimental : { variantGrouping : true , oxideParser : false } ,
30
30
content : [ { raw : html `<div class= "md:(underline,italic)" > </ div> ` } ] ,
31
31
corePlugins : { preflight : false } ,
32
32
plugins : [ ] ,
@@ -39,7 +39,7 @@ it('should be possible to group variants', () => {
39
39
return run ( input , config ) . then ( ( result ) => {
40
40
expect ( result . css ) . toMatchFormattedCss ( css `
41
41
@media (min-width : 768px ) {
42
- .md\:\(underline\2c italic \) {
42
+ .md\:\(underline\, italic \) {
43
43
font-style : italic;
44
44
text-decoration-line : underline;
45
45
}
@@ -50,7 +50,7 @@ it('should be possible to group variants', () => {
50
50
51
51
it ( 'should be possible to group using constrained and arbitrary variants together' , ( ) => {
52
52
let config = {
53
- experimental : 'all' ,
53
+ experimental : { variantGrouping : true , oxideParser : false } ,
54
54
content : [
55
55
{
56
56
raw : html `<div
@@ -70,9 +70,8 @@ it('should be possible to group using constrained and arbitrary variants togethe
70
70
expect ( result . css ) . toMatchFormattedCss ( css `
71
71
@media (prefers-color-scheme : dark) {
72
72
@supports (hover : hover) {
73
- .dark\:\[\@supports\(hover\:hover\)\]\:hover\:\[\&\>\*\]\:\(\[--potato\:baked\]\2c
74
- bg-\[\#0088cc \]\)
75
- > * : hover {
73
+ .dark\:\[\@supports\(hover\:hover\)\]\:hover\:\[\&\>\*\]\:\(\[--potato\:baked\]\,bg-\[\#0088cc \]\)
74
+ > : hover {
76
75
--tw-bg-opacity : 1 ;
77
76
background-color : rgb (0 136 204 / var (--tw-bg-opacity ));
78
77
--potato : baked;
@@ -85,7 +84,7 @@ it('should be possible to group using constrained and arbitrary variants togethe
85
84
86
85
it ( 'should be possible to group multiple variants' , ( ) => {
87
86
let config = {
88
- experimental : 'all' ,
87
+ experimental : { variantGrouping : true , oxideParser : false } ,
89
88
content : [ { raw : html `<div class= "md:dark:(underline,italic)" > </ div> ` } ] ,
90
89
corePlugins : { preflight : false } ,
91
90
plugins : [ ] ,
@@ -99,7 +98,7 @@ it('should be possible to group multiple variants', () => {
99
98
expect ( result . css ) . toMatchFormattedCss ( css `
100
99
@media (min-width : 768px ) {
101
100
@media (prefers-color-scheme : dark) {
102
- .md\:dark\:\(underline\2c italic \) {
101
+ .md\:dark\:\(underline\, italic \) {
103
102
font-style : italic;
104
103
text-decoration-line : underline;
105
104
}
@@ -111,7 +110,7 @@ it('should be possible to group multiple variants', () => {
111
110
112
111
it ( 'should be possible to group nested grouped variants' , ( ) => {
113
112
let config = {
114
- experimental : 'all' ,
113
+ experimental : { variantGrouping : true , oxideParser : false } ,
115
114
content : [ { raw : html `<div class= "md:(underline,italic,hover:(uppercase,font-bold))" > </ div> ` } ] ,
116
115
corePlugins : { preflight : false } ,
117
116
plugins : [ ] ,
@@ -124,13 +123,13 @@ it('should be possible to group nested grouped variants', () => {
124
123
return run ( input , config ) . then ( ( result ) => {
125
124
expect ( result . css ) . toMatchFormattedCss ( css `
126
125
@media (min-width : 768px ) {
127
- .md\:\(underline\2c italic\2c hover\:\(uppercase\2c font-bold \)\) {
126
+ .md\:\(underline\, italic\, hover\:\(uppercase\, font-bold \)\) {
128
127
font-style : italic;
129
128
text-decoration-line : underline;
130
129
}
131
- .md\:\(underline\2c italic\2c hover\:\(uppercase\2c font-bold \)\): hover {
132
- font-weight : 700 ;
130
+ .md\:\(underline\,italic\,hover\:\(uppercase\,font-bold \)\): hover {
133
131
text-transform : uppercase;
132
+ font-weight : 700 ;
134
133
}
135
134
}
136
135
` )
@@ -139,7 +138,7 @@ it('should be possible to group nested grouped variants', () => {
139
138
140
139
it ( 'should be possible to use nested multiple grouped variants' , ( ) => {
141
140
let config = {
142
- experimental : 'all' ,
141
+ experimental : { variantGrouping : true , oxideParser : false } ,
143
142
content : [
144
143
{
145
144
raw : html `<div class= "md:(text-black,dark:(text-white,hover:focus:text-gray-100))" > </ div> ` ,
@@ -156,16 +155,16 @@ it('should be possible to use nested multiple grouped variants', () => {
156
155
return run ( input , config ) . then ( ( result ) => {
157
156
expect ( result . css ) . toMatchFormattedCss ( css `
158
157
@media (min-width : 768px ) {
159
- .md\:\(text-black\2c dark\:\(text-white\2c hover\:focus\:text-gray-100 \)\) {
158
+ .md\:\(text-black\, dark\:\(text-white\, hover\:focus\:text-gray-100 \)\) {
160
159
--tw-text-opacity : 1 ;
161
160
color : rgb (0 0 0 / var (--tw-text-opacity ));
162
161
}
163
162
@media (prefers-color-scheme : dark) {
164
- .md\:\(text-black\2c dark\:\(text-white\2c hover\:focus\:text-gray-100 \)\) {
163
+ .md\:\(text-black\, dark\:\(text-white\, hover\:focus\:text-gray-100 \)\) {
165
164
--tw-text-opacity : 1 ;
166
165
color : rgb (255 255 255 / var (--tw-text-opacity ));
167
166
}
168
- .md\:\(text-black\2c dark\:\(text-white\2c hover\:focus\:text-gray-100 \)\): focus : hover {
167
+ .md\:\(text-black\, dark\:\(text-white\, hover\:focus\:text-gray-100 \)\): focus : hover {
169
168
--tw-text-opacity : 1 ;
170
169
color : rgb (243 244 246 / var (--tw-text-opacity ));
171
170
}
@@ -177,11 +176,11 @@ it('should be possible to use nested multiple grouped variants', () => {
177
176
178
177
it ( 'should be possible to mix and match nesting and different variant combinations' , ( ) => {
179
178
let config = {
180
- experimental : 'all' ,
179
+ experimental : { variantGrouping : true , oxideParser : false } ,
181
180
content : [
182
181
{
183
182
raw : html `<div
184
- class= "md:[&>*]:(text-black,dark:(text-white,hover:[@supports(color:green)]:[&:nth-child(2n= 1)]:text-gray-100))"
183
+ class= "md:[&>*]:(text-black,dark:(text-white,hover:[@supports(color:green)]:[&:nth-child(2n+ 1)]:text-gray-100))"
185
184
> </ div> ` ,
186
185
} ,
187
186
] ,
@@ -196,26 +195,20 @@ it('should be possible to mix and match nesting and different variant combinatio
196
195
return run ( input , config ) . then ( ( result ) => {
197
196
expect ( result . css ) . toMatchFormattedCss ( css `
198
197
@media (min-width : 768px ) {
199
- .md\:\[\&\>\*\]\:\(text-black\2c
200
- dark\:\(text-white\2c
201
- hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\=1\)\]\:text-gray-100 \)\)
198
+ .md\:\[\&\>\*\]\:\(text-black\,dark\:\(text-white\,hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\+1\)\]\:text-gray-100 \)\)
202
199
> * {
203
200
--tw-text-opacity : 1 ;
204
201
color : rgb (0 0 0 / var (--tw-text-opacity ));
205
202
}
206
203
@media (prefers-color-scheme : dark) {
207
- .md\:\[\&\>\*\]\:\(text-black\2c
208
- dark\:\(text-white\2c
209
- hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\=1\)\]\:text-gray-100 \)\)
204
+ .md\:\[\&\>\*\]\:\(text-black\,dark\:\(text-white\,hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\+1\)\]\:text-gray-100 \)\)
210
205
> * {
211
206
--tw-text-opacity : 1 ;
212
207
color : rgb (255 255 255 / var (--tw-text-opacity ));
213
208
}
214
209
@supports (color : green) {
215
- .md\:\[\&\>\*\]\:\(text-black\2c
216
- dark\:\(text-white\2c
217
- hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\=1\)\]\:text-gray-100 \)\): nth-child (
218
- 2n= 1
210
+ .md\:\[\&\>\*\]\:\(text-black\,dark\:\(text-white\,hover\:\[\@supports\(color\:green\)\]\:\[\&\:nth-child\(2n\+1\)\]\:text-gray-100 \)\): nth-child (
211
+ odd
219
212
): hover
220
213
> * {
221
214
--tw-text-opacity : 1 ;
@@ -230,7 +223,7 @@ it('should be possible to mix and match nesting and different variant combinatio
230
223
231
224
it ( 'should group with variants defined in external plugins' , ( ) => {
232
225
let config = {
233
- experimental : 'all' ,
226
+ experimental : { variantGrouping : true , oxideParser : false } ,
234
227
content : [
235
228
{
236
229
raw : html `
@@ -253,24 +246,15 @@ it('should group with variants defined in external plugins', () => {
253
246
254
247
return run ( input , config ) . then ( ( result ) => {
255
248
expect ( result . css ) . toMatchFormattedCss ( css `
256
- .ui-active\:\(bg-black\2c text-white \)[data-ui-state ~= 'active' ] {
249
+ .ui-active\:\(bg-black\,text-white \)[data-ui-state ~= 'active' ],
250
+ [data-ui-state ~= 'active' ] .ui-active\:\(bg-black\,text-white \) {
257
251
--tw-bg-opacity : 1 ;
258
252
background-color : rgb (0 0 0 / var (--tw-bg-opacity ));
259
253
--tw-text-opacity : 1 ;
260
254
color : rgb (255 255 255 / var (--tw-text-opacity ));
261
255
}
262
- [data-ui-state ~= 'active' ] .ui-active\:\(bg-black\2c text-white \) {
263
- --tw-bg-opacity : 1 ;
264
- background-color : rgb (0 0 0 / var (--tw-bg-opacity ));
265
- --tw-text-opacity : 1 ;
266
- color : rgb (255 255 255 / var (--tw-text-opacity ));
267
- }
268
- .ui-selected\:\(bg-indigo-500\2c underline \)[data-ui-state ~= 'selected' ] {
269
- --tw-bg-opacity : 1 ;
270
- background-color : rgb (99 102 241 / var (--tw-bg-opacity ));
271
- text-decoration-line : underline;
272
- }
273
- [data-ui-state ~= 'selected' ] .ui-selected\:\(bg-indigo-500\2c underline \) {
256
+ .ui-selected\:\(bg-indigo-500\,underline \)[data-ui-state ~= 'selected' ],
257
+ [data-ui-state ~= 'selected' ] .ui-selected\:\(bg-indigo-500\,underline \) {
274
258
--tw-bg-opacity : 1 ;
275
259
background-color : rgb (99 102 241 / var (--tw-bg-opacity ));
276
260
text-decoration-line : underline;
0 commit comments