@@ -3,7 +3,7 @@ import { jsx } from '@emotion/core';
3
3
import { mediaBreakpointUp } from './breakpoints' ;
4
4
import styles from './styles' ;
5
5
6
- export const percentage = x => `${ ( x * 100 ) . toFixed ( 6 ) } %` ;
6
+ export const percentage = ( x ) => `${ ( x * 100 ) . toFixed ( 6 ) } %` ;
7
7
8
8
export const makeCol = (
9
9
{ gutterWidth, columns, breakpoints } ,
@@ -14,23 +14,23 @@ export const makeCol = (
14
14
position : 'relative' ,
15
15
width : '100%' ,
16
16
paddingRight : gutterWidth / 2 ,
17
- paddingLeft : gutterWidth / 2
17
+ paddingLeft : gutterWidth / 2 ,
18
18
} ;
19
19
20
- Object . keys ( breakpoints ) . forEach ( breakpoint => {
20
+ Object . keys ( breakpoints ) . forEach ( ( breakpoint ) => {
21
21
const value = options [ breakpoint ] ;
22
22
const media = mediaBreakpointUp ( breakpoint , breakpoints ) ;
23
23
24
24
if ( value === true ) {
25
25
const mediaStyles = {
26
26
flexBasis : 0 ,
27
27
flexGrow : 1 ,
28
- maxWidth : '100%'
28
+ maxWidth : '100%' ,
29
29
} ;
30
30
31
31
if ( media ) {
32
32
Object . assign ( styles , {
33
- [ media ] : mediaStyles
33
+ [ media ] : mediaStyles ,
34
34
} ) ;
35
35
} else {
36
36
Object . assign ( styles , mediaStyles ) ;
@@ -39,25 +39,25 @@ export const makeCol = (
39
39
const mediaStyles = {
40
40
flex : '0 0 auto' ,
41
41
width : 'auto' ,
42
- maxWidth : '100%'
42
+ maxWidth : '100%' ,
43
43
} ;
44
44
45
45
if ( media ) {
46
46
Object . assign ( styles , {
47
- [ media ] : mediaStyles
47
+ [ media ] : mediaStyles ,
48
48
} ) ;
49
49
} else {
50
50
Object . assign ( styles , mediaStyles ) ;
51
51
}
52
52
} else if ( value !== false && value > 0 ) {
53
53
const mediaStyles = {
54
54
flex : `0 0 ${ percentage ( value / columns ) } ` ,
55
- maxWidth : percentage ( value / columns )
55
+ maxWidth : percentage ( value / columns ) ,
56
56
} ;
57
57
58
58
if ( media ) {
59
59
Object . assign ( styles , {
60
- [ media ] : mediaStyles
60
+ [ media ] : mediaStyles ,
61
61
} ) ;
62
62
} else {
63
63
Object . assign ( styles , mediaStyles ) ;
@@ -70,16 +70,16 @@ export const makeCol = (
70
70
71
71
export const makeColOffset = ( { breakpoints, columns } , offset ) => {
72
72
const styles = { } ;
73
- Object . keys ( offset ) . forEach ( name => {
73
+ Object . keys ( offset ) . forEach ( ( name ) => {
74
74
const size = offset [ name ] ;
75
75
const media = mediaBreakpointUp ( name , breakpoints ) ;
76
76
const mediaStyles = {
77
- marginLeft : percentage ( size / columns )
77
+ marginLeft : percentage ( size / columns ) ,
78
78
} ;
79
79
80
80
if ( media ) {
81
81
Object . assign ( styles , {
82
- [ media ] : mediaStyles
82
+ [ media ] : mediaStyles ,
83
83
} ) ;
84
84
} else {
85
85
Object . assign ( styles , mediaStyles ) ;
@@ -90,16 +90,16 @@ export const makeColOffset = ({ breakpoints, columns }, offset) => {
90
90
91
91
export const makeColOrder = ( { breakpoints, columns } , order ) => {
92
92
const styles = { } ;
93
- Object . keys ( order ) . forEach ( name => {
93
+ Object . keys ( order ) . forEach ( ( name ) => {
94
94
const size = order [ name ] ;
95
95
const media = mediaBreakpointUp ( name , breakpoints ) ;
96
96
const mediaStyles = {
97
- order : size === 'first' ? - 1 : size === 'last' ? columns + 1 : size
97
+ order : size === 'first' ? - 1 : size === 'last' ? columns + 1 : size ,
98
98
} ;
99
99
100
100
if ( media ) {
101
101
Object . assign ( styles , {
102
- [ media ] : mediaStyles
102
+ [ media ] : mediaStyles ,
103
103
} ) ;
104
104
} else {
105
105
Object . assign ( styles , mediaStyles ) ;
@@ -138,7 +138,7 @@ const Col = ({
138
138
css = { [
139
139
makeCol ( styles , { xs, sm, md, lg, xl, auto } ) ,
140
140
offset && makeColOffset ( styles , offset ) ,
141
- order && makeColOrder ( styles , order )
141
+ order && makeColOrder ( styles , order ) ,
142
142
] }
143
143
>
144
144
{ children }
@@ -153,7 +153,7 @@ Col.defaultProps = {
153
153
sm : false ,
154
154
md : false ,
155
155
lg : false ,
156
- xl : false
156
+ xl : false ,
157
157
} ;
158
158
159
159
export default Col ;
0 commit comments