forked from robinweser/inline-style-prefixer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflexboxOld.js
More file actions
33 lines (31 loc) · 901 Bytes
/
flexboxOld.js
File metadata and controls
33 lines (31 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* @flow */
const alternativeValues = {
'space-around': 'justify',
'space-between': 'justify',
'flex-start': 'start',
'flex-end': 'end',
'wrap-reverse': 'multiple',
wrap: 'multiple'
}
const alternativeProps = {
alignItems: 'WebkitBoxAlign',
justifyContent: 'WebkitBoxPack',
flexWrap: 'WebkitBoxLines'
}
export default function flexboxOld(property: string, value: any, style: Object): void {
if (property === 'flexDirection' && typeof value === 'string') {
if (value.indexOf('column') > -1) {
style.WebkitBoxOrient = 'vertical'
} else {
style.WebkitBoxOrient = 'horizontal'
}
if (value.indexOf('reverse') > -1) {
style.WebkitBoxDirection = 'reverse'
} else {
style.WebkitBoxDirection = 'normal'
}
}
if (alternativeProps.hasOwnProperty(property)) {
style[alternativeProps[property]] = alternativeValues[value] || value
}
}