-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars.styl
More file actions
526 lines (435 loc) · 10.4 KB
/
vars.styl
File metadata and controls
526 lines (435 loc) · 10.4 KB
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
// HACK: ../../src/
use('../src/stylus_get_color.js')
use('../src/stylus_get_cdn_url.js')
use('../src/stylus_get_value.js')
// TODO: move to vars.json, allow js to use (cardList)
$breakPointSmall = 340px
$breakPointMedium = 768px
$breakPointLarge = 1280px // drawer shows here
$inputMaxWidth = 600px
$cdnUrl = getCdnUrl()
flex1()
flex: 1
min-height: 0
// TODO: figure out if can do min-width: 0 here too
container()
width: 100%
max-width: 1260px
margin: 0 auto
padding: 16px
box-sizing: border-box
// height is 0 when no text, this fixes
dont-collapse-when-empty()
&:empty::after
content: '.'
visibility: hidden
fix-overflow-shadows()
margin: -8px
padding: 8px
shadow-1()
transition: box-shadow 0.25s
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.12)
shadow-upper-1()
transition: box-shadow 0.25s
box-shadow: 0 -1px 4px 0 rgba(0, 0, 0, 0.12)
shadow-panel() // TODO: name?
box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.08)
shadow-2()
transition: box-shadow 0.25s
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.18), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14)
shadow-3()
transition: box-shadow 0.25s
box-shadow: 0 11px 7px 0 rgba(0, 0, 0, 0.19), 0 13px 25px 0 rgba(0, 0, 0, 0.3)
shadow-4()
transition: box-shadow 0.25s
box-shadow: 0 15px 12px 0 rgba(0, 0, 0, 0.17), 0 20px 40px 0 rgba(0, 0, 0, 0.3)
shadow-5()
transition: box-shadow 0.25s
box-shadow: 0 17px 17px 0 rgba(0, 0, 0, 0.15), 0 27px 55px 0 rgba(0, 0, 0, 0.3)
font-h1()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 56px
font-weight: 400
line-height: 1.4em
letter-spacing: 0.25
font-h1-heavy()
font-h1()
font-weight: 700
font-h2()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 44px
font-weight: 400
line-height: 1.4em
letter-spacing: 0.25px
font-h2-heavy()
font-h2()
font-weight: 600
font-h3(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 36px
font-weight: 400
line-height: 1.4em
letter-spacing: 0.24px
if state is medium
color: getColor('$bgText60')
font-h3-heavy()
font-h3()
font-weight: 600
font-h4()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 28px
font-weight: 600
line-height: 1.4em
letter-spacing: 0.15px
font-h4-heavy()
font-h4()
font-weight: 700
font-h5()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 24px
font-weight: 600
line-height: 1.4em
letter-spacing: 0.13px
font-h5()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 20px
font-weight: 600
line-height: 1.4em
letter-spacing: 0.13px
// FIXME: consolidate w h5?
font-h6()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 20px
font-weight: 600
line-height: 1.4em
letter-spacing: 0.13px
font-button()
font-family: Montserrat
color: getColor('$bgText87')
font-size: 14px
font-weight: 700
line-height: 16px
letter-spacing: 1.25px
font-body1(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 16px
font-weight: 400
line-height: 20px
letter-spacing: 0.47px
if state is medium
color: getColor('$bgText60')
font-body2(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 14px
font-weight: 400
letter-spacing: 0.23px
if state is medium
color: getColor('$bgText60')
font-subtitle1(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 16px
font-weight: 600
line-height: 20px
letter-spacing: 0.14px
if state is medium
color: getColor('$bgText60')
font-subtitle2(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 14px
font-weight: 600
letter-spacing: 0.1px
if state is medium
color: getColor('$bgText60')
font-tbd-name() // FIXME name
font-family: Montserrat
color: getColor('$bgText87')
font-size: 13px
font-weight: 600
line-height: 1.23em
letter-spacing: 0.4px
text-transform: uppercase
font-tbd2-name() // FIXME name
font-family: Montserrat
color: getColor('$bgText87')
font-size: 13px
font-weight: 600
font-caption1(state = disabled) // primary, disabled, italic
font-family: Montserrat
color: getColor('$bgText60')
font-size: 12px
line-height: 1.23em
letter-spacing: 0.37px
if state is italic
font-style: italic
if state is disabled
color: getColor('$bgText38')
if state is high
color: getColor('$bgText87')
font-caption2(state = disabled) // primary, disabled, italic
font-caption1()
font-weight: 600
font-overline(state = high)
font-family: Montserrat
color: getColor('$bgText87')
font-size: 13px
font-weight: bold
line-height: 1.23em
letter-spacing: 2px
if state is medium
color: getColor('$bgText60')
cssVariableFallbacks(property, args)
string = join(' ', args)
variable = match('var\((.*?)\)', string)
if variable and variable[1]
{property}: convert(replace('var\(' + variable[1] + '\)', getValue(variable[1]), string)) // fallback chrome < 49
{property}: args
background()
cssVariableFallbacks('background', arguments)
background-color()
cssVariableFallbacks('background-color', arguments)
color()
cssVariableFallbacks('color', arguments)
box-shadow()
cssVariableFallbacks('box-shadow', arguments)
border()
cssVariableFallbacks('border', arguments)
ripple(color, type = default)
position: relative
outline: none
overflow: hidden
&:after // ripple
content: ''
position: absolute
border-radius: 50%
width: 70%
padding-bottom: 70%
left: 15%
top: 50%
margin-top: -35%
transform: scale(1)
transform-origin: 50%
// margin-top: -50%
background: color
opacity: 0
pointer-events: none
// hover seems to be the fastest way to get the animation to start in android.
// :focus has a couple hundred ms delay, i think active might too.
// ios and desktop look bad on hover
.is-android &:hover::after
will-change: transform
// anim defined in root
if type is 'bottomBar'
animation: z-ripple-bottom-bar-animation-css-only 0.25s ease-out
else
animation: z-ripple-animation-css-only 0.6s ease-out
opacity: 0
&:focus:not(:active)::after
will-change: transform
if type is bottomBar
animation: z-ripple-bottom-bar-animation-css-only 0.25s ease-out
else
animation: z-ripple-animation-css-only 0.6s ease-out
opacity: 0
card()
shadow-1()
border-radius: 4px
display: block
background: getColor('$bgColor')
tapTabs()
border: 1px solid getColor('$secondary50')
border-radius: 4px
display: flex
> .tap-tab
flex1()
font-body2()
padding: 8px 16px
border-radius: 4px
text-align: center
cursor: pointer
&.is-selected
background: getColor('$secondary50')
imageFadeIn()
opacity: 0
&.is-image-loaded
opacity: 1
transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1)
ul()
margin: 0
padding-left: 20px
text-align: left
max-width: 500px
margin: 0 auto
> li
margin-top: 8px
list-style-type: circle
box()
shadow-1()
border-radius: 6px
background: getColor('$bgColor')
display: flex
flex-direction: column
> .header
padding: 24px
font-overline()
text-transform: uppercase
border-bottom: 1px solid getColor('$bgText6')
> .content
flex1()
display: flex
flex-direction: column
// padding: 24px
padding: 16px 0
overflow: hidden
defaultPadding()
padding: 16px
@media (min-width: $breakPointMedium)
padding: 32px
menu-item()
font-body2()
padding: 10px 12px
display: block
cursor: pointer
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
&:hover
background: getColor('$bgText6')
&.is-selected
font-subtitle2()
border-left: 2px solid getColor('$bgText')
divider()
height: 1px
width: 100%
background: getColor('$bgText12')
margin: 8px 0
tooltip(isDark = false)
if isDark
bgColor = getColor('$primaryMain')
color = getColor('$primaryMainText')
else
bgColor = getColor('$bgColorAlt1')
color = getColor('$bgText')
shadow-1()
position: absolute
z-index: 99
opacity: 0
pointer-events: none
border-radius: 8px
max-width: 300px
min-height: 72px
will-change: transform
box-sizing: border-box
cursor: pointer
display: flex
align-items: center
background: bgColor
&::after
content: ''
position: absolute
border: 10px solid transparent
&.anchor-top-center
margin-top: 0
&::after
left: 50%
top: -10px
margin-left: -10px
border-top: none
// border-left: none
border-bottom-color: bgColor
&.anchor-top-left
margin-top: 0
&::after
left: 24px
top: -10px
margin-left: -10px
border-top: none
// border-left: none
border-bottom-color: bgColor
&.anchor-top-right
margin-top: 0
&::after
right: 24px
top: -10px
margin-left: -10px
border-top: none
// border-left: none
border-bottom-color: bgColor
&.anchor-bottom-center
margin-top: -20px
&::after
left: 50%
bottom: -10px
margin-left: -10px
border-bottom: none
border-top-color: bgColor
&.anchor-bottom-left
margin-top: -20px
&::after
left: 24px
bottom: -10px
margin-left: -10px
border-bottom: none
border-top-color: bgColor
&.anchor-center-left
margin-left: 10px
margin-top: -10px
&::after
top: 50%
left: -10px
margin-top: -10px
border-left: none
border-right-color: bgColor
&.anchor-center-right
margin-left: -10px
margin-top: -10px
&::after
top: 50%
right: -10px
margin-top: -10px
border-right: none
border-left-color: bgColor
&.is-visible
opacity: 1
transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1)
pointer-events: all
> .close
position: absolute
top: 16px
right: 16px
> .content
flex1()
font-body2()
padding: 16px
color: color
> .title
font-subtitle2()
color: color
padding-right: 24px
margin-bottom: 8px
input()
border: 1px solid getColor('$bgText12')
border-radius: 8px
padding: 8px 16px
font: inherit
color: inherit
background-color: getColor('$bgColor')
outline: none
-webkit-tap-highlight-color: transparent
width: 100%
box-sizing: border-box
transition: border 0.2s cubic-bezier(0.4, 0, 0.2, 1)
&:disabled
background: getColor('$bgColorAlt1')
&:hover
border: 1px solid getColor('$bgText26')