File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-shadow */
2
2
import _ from 'lodash'
3
- import postcss from 'postcss'
4
- import defineClass from '../util/defineClass'
5
3
6
4
function extractMinWidths ( breakpoints ) {
7
5
return _ . flatMap ( breakpoints , breakpoints => {
@@ -31,22 +29,21 @@ module.exports = function(options) {
31
29
const minWidths = extractMinWidths ( screens )
32
30
33
31
const atRules = _ . map ( minWidths , minWidth => {
34
- const atRule = postcss . atRule ( {
35
- name : 'media' ,
36
- params : `(min-width: ${ minWidth } )` ,
37
- } )
38
- atRule . append (
39
- defineClass ( 'container' , {
40
- 'max-width' : minWidth ,
41
- } )
42
- )
43
- return atRule
32
+ return {
33
+ [ `@media (min-width: ${ minWidth } )` ] : {
34
+ '.container' : {
35
+ 'max-width' : minWidth ,
36
+ } ,
37
+ } ,
38
+ }
44
39
} )
45
40
46
41
addComponents ( [
47
- defineClass ( 'container' , {
48
- width : '100%' ,
49
- } ) ,
42
+ {
43
+ '.container' : {
44
+ width : '100%' ,
45
+ } ,
46
+ } ,
50
47
...atRules ,
51
48
] )
52
49
}
You can’t perform that action at this time.
0 commit comments