UNPKG

1.01 kBJavaScriptView Raw
1import Animations from './props.animations.js'
2import Sizes from './props.sizes.js'
3import Colors from './props.colors.js'
4import ColorsHSL from './props.colors-hsl.js'
5import Fonts from './props.fonts.js'
6import Borders from './props.borders.js'
7import Aspects from './props.aspects.js'
8import Easings from './props.easing.js'
9import Gradients from './props.gradients.js'
10import Shadows from './props.shadows.js'
11import SVG from './props.svg.js'
12import Zindex from './props.zindex.js'
13
14const camelize = text => {
15 text = text.replace(/[-]+(.)?/g, (_, c) => c
16 ? c.toUpperCase()
17 : '')
18 return text.substr(0, 1).toLowerCase() + text.substr(1)
19}
20
21const mapToObjectNotation = props => {
22 for (var prop in props)
23 props[camelize(prop)] = props[prop]
24 return props
25}
26
27const OpenProps = mapToObjectNotation({
28 ...Animations,
29 ...Sizes,
30 ...Colors,
31 ...ColorsHSL,
32 ...Fonts,
33 ...Borders,
34 ...Aspects,
35 ...Easings,
36 ...SVG,
37 ...Gradients,
38 ...Shadows,
39 ...Zindex,
40})
41
42export default OpenProps
\No newline at end of file