File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -162,15 +162,12 @@ const responsive = styles => theme => {
162
162
}
163
163
for ( let i = 0 ; i < value . slice ( 0 , mediaQueries . length ) . length ; i ++ ) {
164
164
const media = mediaQueries [ i ]
165
- if ( value [ i ] == null ) {
166
- next [ media ] = { }
167
- continue
168
- }
169
165
if ( ! media ) {
170
166
next [ key ] = value [ i ]
171
167
continue
172
168
}
173
169
next [ media ] = next [ media ] || { }
170
+ if ( value [ i ] == null ) continue
174
171
next [ media ] [ key ] = value [ i ]
175
172
}
176
173
}
Original file line number Diff line number Diff line change @@ -432,3 +432,27 @@ test('returns correct media query order', () => {
432
432
color : 'red' ,
433
433
} )
434
434
} )
435
+
436
+ test ( 'returns correct media query order 2' , ( ) => {
437
+ const result = css ( {
438
+ flexDirection : 'column' ,
439
+ justifyContent : [ null , 'flex-start' , 'flex-end' ] ,
440
+ color : 'background' ,
441
+ height : '100%' ,
442
+ px : [ 2 , 3 , 4 ] ,
443
+ py : 4 ,
444
+ } ) ( theme )
445
+ const keys = Object . keys ( result )
446
+ expect ( keys ) . toEqual ( [
447
+ 'flexDirection' ,
448
+ 'justifyContent' ,
449
+ '@media screen and (min-width: 40em)' ,
450
+ '@media screen and (min-width: 52em)' ,
451
+ 'color' ,
452
+ 'height' ,
453
+ 'paddingLeft' ,
454
+ 'paddingRight' ,
455
+ 'paddingTop' ,
456
+ 'paddingBottom' ,
457
+ ] )
458
+ } )
You can’t perform that action at this time.
0 commit comments