-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtext.js
116 lines (95 loc) · 1.72 KB
/
text.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { style, color } from './constants'
const sanitize = str => str ? str.toLowerCase().replace(/[^a-zA-Z0-9 ]/g, '').replace(/\s/g, '-') : ''
view Title {
prop center
prop light
prop big
prop children
<Text
root
yield
id={sanitize(children)}
class={{ light, big }}
tagName="h2"
/>
$ = {
fontWeight: 400,
fontSize: 25,
margin: [18, 0, 8],
textAlign: center ? `center` : `auto`,
color: 'rgba(0,0,0,0.8)'
}
$light = {
color: '#fff'
}
$big = {
fontSize: 30,
color: color.brand1
}
}
view Title2 {
<Title root yield />
$Title = {
fontSize: 20,
color: color.brand1,
}
}
view SubTitle {
<Title tagName="h3" root yield />
$ = {
color: color(color.brand).darken(1).rgba(),
marginTop: 15,
fontSize: 18,
fontWeight: 400
}
}
view IntroText {
prop center
prop small
prop light
prop children
<Text root class={{ small }} tagName="h2">
{children}
</Text>
$ = {
fontSize: 22,
lineHeight: '1.95rem',
textAlign: center ? `center` : `auto`,
color: light ? 'auto' : 'rgba(0,0,0,0.65)',
marginBottom: 15,
marginTop: 0,
fontWeight: 300
}
$small = {
color: '#333',
fontWeight: 400,
fontSize: 16
}
}
view Text {
prop light, dim, small, children
prop tagName = 'p'
prop center
<text tagName={tagName} class={{ small, light, dim, center }}>
{children}
</text>
$ = {
fontWeight: 400,
fontSize: 16,
lineHeight: '1.6rem'
}
$light = {
color: `rgba(255,255,255,0.9)`
}
$small = {
fontSize: 14,
lineHeight: '1.55rem',
color: `rgba(0,0,0,0.45)`,
}
$dim = {
color: `rgba(0,0,0,0.45)`,
}
$center = {
textAlign: 'center'
}
}