-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshared.js
65 lines (55 loc) · 1.32 KB
/
shared.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { style, color, routes, font, device } from './constants'
view Blur {
const size = view.props.size || 500
$ = {
width: size,
height: size,
background: view.props.bg || '#fdfdfd',
filter: `blur(${view.props.blur || (size / 15)}px)`,
borderRadius: size,
position: 'absolute',
zIndex: 0,
top: view.props.top || 0,
left: view.props.left || 0,
transform: `translate3d(0, 0, 0)`,
}
}
view Row {
prop reverse, center, centered, spread, contain
<row root class={{ contain }} yield />
$ = {
flexFlow: reverse ? 'row-reverse' : 'row',
justifyContent: spread ? 'space-between' : center ? 'center' : 'flex-start',
alignItems: centered ? 'center' : 'flex-start',
width: '100%',
[device.small]: {
minWidth: 0,
flexFlow: 'column'
}
}
$contain = {
maxWidth: 1100,
minWidth: 700,
width: '80%',
margin: `auto`
}
}
view Col {
prop center, centered
prop pad
prop grow:? number
$ = {
flexFlow: 'column',
justifyContent: center ? 'center' : 'flex-start',
alignItems: centered ? 'center' : 'flex-start',
margin: center ? 'auto' : 0,
flexGrow: typeof grow != 'undefined' ? grow : 1,
flexShrink: 1,
maxWidth: '100%',
padding: pad ? 20 : 0,
[device.small]: {
margin: 0,
width: '100%'
}
}
}