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 => {
162162 }
163163 for ( let i = 0 ; i < value . slice ( 0 , mediaQueries . length ) . length ; i ++ ) {
164164 const media = mediaQueries [ i ]
165- if ( value [ i ] == null ) {
166- next [ media ] = { }
167- continue
168- }
169165 if ( ! media ) {
170166 next [ key ] = value [ i ]
171167 continue
172168 }
173169 next [ media ] = next [ media ] || { }
170+ if ( value [ i ] == null ) continue
174171 next [ media ] [ key ] = value [ i ]
175172 }
176173 }
Original file line number Diff line number Diff line change @@ -432,3 +432,27 @@ test('returns correct media query order', () => {
432432 color : 'red' ,
433433 } )
434434} )
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