-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
259 lines (252 loc) · 5.86 KB
/
tailwind.config.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
const defaultTheme = require('tailwindcss/defaultTheme')
const plugin = require('tailwindcss/plugin')
const COLOR_PRIMARY = '#077BBC'
const COLOR_SECONDARY = '#021B27'
const COLOR_SURFACE = '#FAFDFF'
module.exports = {
content: ['./src/**/*.{html,tsx}'],
plugins: [
require('@tailwindcss/forms'),
plugin(function sentenceCase({ addUtilities }) {
addUtilities({
'.sentence-case': {
textTransform: 'lowercase',
},
'.sentence-case::first-letter': {
textTransform: 'uppercase',
},
})
}),
plugin(elevationShadowPlugin),
],
theme: {
extend: {
colors: {
primary: {
DEFAULT: COLOR_PRIMARY,
},
secondary: {
DEFAULT: COLOR_SECONDARY,
},
surface: {
DEFAULT: COLOR_SURFACE,
},
},
fontFamily: {
display: [
'"Montserrat Alternates"',
...defaultTheme.fontFamily.sans,
'"Noto Sans Symbols 2"',
],
mono: [
'"Fira Mono"',
...defaultTheme.fontFamily.mono,
'"Noto Sans Symbols 2"',
],
sans: [
'Montserrat',
...defaultTheme.fontFamily.sans,
'"Noto Sans Symbols 2"',
],
},
maxHeight: {
'10v': '10vh',
'20v': '20vh',
'30v': '30vh',
'40v': '40vh',
'50v': '50vh',
'60v': '60vh',
'70v': '70vh',
'80v': '80vh',
'90v': '90vh',
},
maxWidth: {
'10v': '10vw',
'20v': '20vw',
'30v': '30vw',
'40v': '40vw',
'50v': '50vw',
'60v': '60vw',
'70v': '70vw',
'80v': '80vw',
'90v': '90vw',
},
outline: {
primary: [`2px solid ${COLOR_PRIMARY}`, '1px'],
},
},
},
}
function elevationShadowPlugin({ addBase }) {
const elevationValues = [
{
ambient: '0px 0px 0px 0px',
elevation: 0,
penumbra: '0px 0px 0px 0px',
umbra: '0px 0px 0px 0px',
},
{
ambient: '0px 1px 3px 0px',
elevation: 1,
penumbra: '0px 1px 1px 0px',
umbra: '0px 2px 1px -1px',
},
{
ambient: '0px 1px 5px 0px',
elevation: 2,
penumbra: '0px 2px 2px 0px',
umbra: '0px 3px 1px -2px',
},
{
ambient: '0px 1px 8px 0px',
elevation: 3,
penumbra: '0px 3px 4px 0px',
umbra: '0px 3px 3px -2px',
},
{
ambient: '0px 1px 10px 0px',
elevation: 4,
penumbra: '0px 4px 5px 0px',
umbra: '0px 2px 4px -1px',
},
{
ambient: '0px 1px 14px 0px',
elevation: 5,
penumbra: '0px 5px 8px 0px',
umbra: '0px 3px 5px -1px',
},
{
ambient: '0px 1px 18px 0px',
elevation: 6,
penumbra: '0px 6px 10px 0px',
umbra: '0px 3px 5px -1px',
},
{
ambient: '0px 2px 16px 1px',
elevation: 7,
penumbra: '0px 7px 10px 1px',
umbra: '0px 4px 5px -2px',
},
{
ambient: '0px 3px 14px 2px',
elevation: 8,
penumbra: '0px 8px 10px 1px',
umbra: '0px 5px 5px -3px',
},
{
ambient: '0px 3px 16px 2px',
elevation: 9,
penumbra: '0px 9px 12px 1px',
umbra: '0px 5px 6px -3px',
},
{
ambient: '0px 4px 18px 3px',
elevation: 10,
penumbra: '0px 10px 14px 1px',
umbra: '0px 6px 6px -3px',
},
{
ambient: '0px 4px 20px 3px',
elevation: 11,
penumbra: '0px 11px 15px 1px',
umbra: '0px 6px 7px -4px',
},
{
ambient: '0px 5px 22px 4px',
elevation: 12,
penumbra: '0px 12px 17px 2px',
umbra: '0px 7px 8px -4px',
},
{
ambient: '0px 5px 24px 4px',
elevation: 13,
penumbra: '0px 13px 19px 2px',
umbra: '0px 7px 8px -4px',
},
{
ambient: '0px 5px 26px 4px',
elevation: 14,
penumbra: '0px 14px 21px 2px',
umbra: '0px 7px 9px -4px',
},
{
ambient: '0px 6px 28px 5px',
elevation: 15,
penumbra: '0px 15px 22px 2px',
umbra: '0px 8px 9px -5px',
},
{
ambient: '0px 6px 30px 5px',
elevation: 16,
penumbra: '0px 16px 24px 2px',
umbra: '0px 8px 10px -5px',
},
{
ambient: '0px 6px 32px 5px',
elevation: 17,
penumbra: '0px 17px 26px 2px',
umbra: '0px 8px 11px -5px',
},
{
ambient: '0px 7px 34px 6px',
elevation: 18,
penumbra: '0px 18px 28px 2px',
umbra: '0px 9px 11px -5px',
},
{
ambient: '0px 7px 36px 6px',
elevation: 19,
penumbra: '0px 19px 29px 2px',
umbra: '0px 9px 12px -6px',
},
{
ambient: '0px 8px 38px 7px',
elevation: 20,
penumbra: '0px 20px 31px 3px',
umbra: '0px 10px 13px -6px',
},
{
ambient: '0px 8px 40px 7px',
elevation: 21,
penumbra: '0px 21px 33px 3px',
umbra: '0px 10px 13px -6px',
},
{
ambient: '0px 8px 42px 7px',
elevation: 22,
penumbra: '0px 22px 35px 3px',
umbra: '0px 10px 14px -6px',
},
{
ambient: '0px 9px 44px 8px',
elevation: 23,
penumbra: '0px 23px 36px 3px',
umbra: '0px 11px 14px -7px',
},
{
ambient: '0px 9px 46px 8px',
elevation: 24,
penumbra: '0px 24px 38px 3px',
umbra: '0px 11px 15px -7px',
},
]
const elevationOpacities = {
ambient: 0.12,
penumbra: 0.14,
umbra: 0.2,
}
const shadowColor = [0, 0, 0]
const elevationStyles = {}
elevationValues.forEach(({ ambient, elevation, penumbra, umbra }) => {
elevationStyles[`.elevation-dp${elevation}`] = {
boxShadow: `${umbra} rgba(${shadowColor.join(',')}, ${
elevationOpacities.umbra
}), ${penumbra} rgba(${shadowColor.join(',')}, ${
elevationOpacities.penumbra
}), ${ambient} rgba(${shadowColor.join(',')}, ${
elevationOpacities.ambient
})`,
}
}, {})
addBase(elevationStyles)
}