forked from robinweser/inline-style-prefixer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsizing.js
More file actions
35 lines (32 loc) · 837 Bytes
/
sizing.js
File metadata and controls
35 lines (32 loc) · 837 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
34
35
/* @flow */
import getPrefixedValue from '../../utils/getPrefixedValue'
import type { PluginMetaData } from '../../../flowtypes/PluginMetaData'
const properties = {
maxHeight: true,
maxWidth: true,
width: true,
height: true,
columnWidth: true,
minWidth: true,
minHeight: true
}
const values = {
'min-content': true,
'max-content': true,
'fill-available': true,
'fit-content': true,
'contain-floats': true
}
// TODO: chrome & opera support it
export default function sizing(
property: string,
value: any,
style: Object,
{ cssPrefix, keepUnprefixed }: PluginMetaData
): ?Array<any> | ?any {
// This might change in the future
// Keep an eye on it
if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {
return getPrefixedValue(cssPrefix + value, value, keepUnprefixed)
}
}