-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
styles.cljs
573 lines (499 loc) · 16.2 KB
/
styles.cljs
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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
(ns day8.re-frame-10x.styles
(:require-macros
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.selectors :refer [defpseudoclass
defpseudoelement]])
(:require
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.compiler :refer [render-css]]
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.units :refer [em px percent]]
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.color :as color :refer [rgb rgba transparentize]]
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.selectors :as s]
[day8.re-frame-10x.inlined-deps.garden.v1v3v10.garden.stylesheet :refer [at-keyframes]] ;;(at-import at-media at-keyframes)
[day8.re-frame-10x.inlined-deps.spade.git-sha-93ef290.core :refer [defclass]]))
;; ====
;; https://www.nordtheme.com/docs/colors-and-palettes
;; ===
;; Polar Night
(def nord0 "#2E3440")
(def nord1 "#3B4252")
(def nord2 "#434C5E")
(def nord3 "#4C566A")
;; Snow Storm
(def nord4 "#D8DEE9")
(def nord5 "#E5E9F0")
(def nord6 "#ECEFF4")
;; Frost
(def nord7 "#8FBCBB")
(def nord8 "#88C0D0")
(def nord9 "#81A1C1")
(def nord10 "#5E81AC")
;; Aurora
(def nord11 "#BF616A")
(def nord12 "#D08770")
(def nord13 "#EBCB8B")
(def nord14 "#A3BE8C")
(def nord15 "#B48EAD")
;; Extras
(def nord-ghost-white "#F8F9FB")
;; Golden section, base 50
(def gs-2 (px 2))
(def gs-5 (px 5))
(def gs-7 (px 7))
(def gs-12 (px 12))
(def gs-19 (px 19))
(def gs-31 (px 31))
(def gs-50 (px 50))
(def gs-81 (px 81))
(def gs-131 (px 131))
(def gs-212 (px 212))
(def gs-2s (render-css gs-2))
(def gs-5s (render-css gs-5))
(def gs-7s (render-css gs-7))
(def gs-12s (render-css gs-12))
(def gs-19s (render-css gs-19))
(def gs-31s (render-css gs-31))
(def gs-50s (render-css gs-50))
(def gs-81s (render-css gs-81))
(def gs-131s (render-css gs-131))
(def gs-212s (render-css gs-212))
(def font-stack ["\"Segoe UI\"" "Roboto" "Helvetica" "sans-serif"])
(defpseudoclass -moz-focusring)
(defpseudoelement -moz-focus-inner)
;; ===
;; Base Classes
;; ===
(defn background-color-0
[ambiance]
(if (= ambiance :bright) :#fff nord1))
(defn background-color-1
[ambiance]
(if (= :bright ambiance) nord-ghost-white nord0))
(defn color-1
[ambiance]
(if (= :bright ambiance) nord3 nord4))
(defn background-color-2
[ambiance]
(if (= :bright ambiance) nord6 nord1))
(defn color-2
[ambiance]
(if (= :bright ambiance) nord2 nord4))
#_(defn background-color-3
[ambiance]
(if (= :bright ambiance) nord5 nord2))
#_(defn color-3
[ambiance]
(if (= :bright ambiance) nord3 nord5))
(defclass colors-0
[ambiance]
{:background-color (background-color-0 ambiance)})
(defclass colors-1
[ambiance]
{:background-color (background-color-1 ambiance)
:color (color-1 ambiance)})
(defn border-1
[ambiance]
[[(px 1) :solid (if (= :bright ambiance) nord4 nord3)]])
(defclass frame-1
[ambiance]
{:composes (colors-1 ambiance)
:border (border-1 ambiance)
:border-radius gs-2})
(defclass colors-2
[ambiance]
{:background-color (background-color-2 ambiance)
:color (color-2 ambiance)}
[:svg :path
{:fill (color-2 ambiance)}])
(defn border-2
[ambiance]
[[(px 1) :solid (if (= :bright ambiance) nord4 nord3)]])
(defclass frame-2
[ambiance]
{:composes (colors-2 ambiance)
:border (border-2 ambiance)
:border-radius gs-2})
(defclass colors-uncommon
[_]
{:color :#fff
:background-color nord15})
(defclass frame-uncommon
[ambiance]
{:composes (colors-uncommon ambiance)
:border [[(px 1) :solid (color/darken nord15 10)]]
:border-radius gs-2})
(defclass control-2
[ambiance active?]
{:composes (frame-2 ambiance)
:cursor :pointer}
(when active?
[:svg :path
{:fill nord7}])
[:&:hover
{:background-color (if (= :bright ambiance) nord5 nord2)
:color (if (= :bright ambiance) nord1 nord5)}
[:svg :path
{:fill nord7}]])
(defclass hyperlink
[_]
{:color nord9
:cursor :pointer}
[:&:hover
{:text-decoration :underline}])
(defn syntax-color
[ambiance syntax-color-scheme key]
(let [signature (if (= :cljs-devtools syntax-color-scheme)
(rgba 100 255 100 1)
(if (= :bright ambiance)
nord-ghost-white
nord0))]
(case key
:base-text-color (if (= :cljs-devtools syntax-color-scheme)
(rgb 0 0 0)
(if (= :bright ambiance) nord0 nord6))
:signature-background (transparentize signature 0.92)
:type (if (= :cljs-devtools syntax-color-scheme)
(rgb 0 160 220)
nord7)
:type-text (if (= :cljs-devtools syntax-color-scheme)
(rgb 238 238 255)
:pink)
:field (syntax-color ambiance syntax-color-scheme :type)
:basis (syntax-color ambiance syntax-color-scheme :type)
:meta (rgb 255 102 0)
:meta-text (rgb 238 238 238)
:protocol (rgb 41 59 163)
:method (rgb 41 59 163) ;; protocol
:ns (if (= :cljs-devtools syntax-color-scheme)
(rgb 150 150 150)
nord7)
:native (rgb 255 0 255)
:fn (if (= :cljs-devtools syntax-color-scheme)
(rgb 30 130 30)
nord8)
:lambda (rgb 30 130 30) ;; fn
:fn-args (if (= :cljs-devtools syntax-color-scheme)
(rgb 170 130 20)
nord9)
:custom-printing (rgb 255 255 200)
:circular-ref (rgb 255 0 0)
:nil (if (= :cljs-devtools syntax-color-scheme)
(rgb 128 128 128)
nord9)
:keyword (if (= :cljs-devtools syntax-color-scheme)
(rgb 136 19 145)
nord7)
:integer (if (= :cljs-devtools syntax-color-scheme)
(rgb 28 0 207)
nord15)
:float (if (= :cljs-devtools syntax-color-scheme)
(rgb 28 136 207)
nord15)
:float-nan (if (= :cljs-devtools syntax-color-scheme)
(rgb 213 60 27)
nord15)
:float-infinity (if (= :cljs-devtools syntax-color-scheme)
(rgb 28 80 207)
nord15)
:string (if (= :cljs-devtools syntax-color-scheme)
(rgb 196 26 22)
nord14)
:expanded-string (rgb 255 100 100)
:symbol (if (= :cljs-devtools syntax-color-scheme)
(rgb 0 0 0)
nord8)
:bool (if (= :cljs-devtools syntax-color-scheme)
(rgb 0 153 153)
nord10)
:fast-protocol (rgb 255 255 170)
:slow-protocol (rgb 238 238 238)
:more (rgb 255 255 255)
:more-background (rgb 153 153 153)
:index (if (= :cljs-devtools syntax-color-scheme)
(rgb 0 0 0)
nord7)
:index-background (if (= :cljs-devtools syntax-color-scheme)
(rgb 221 221 221)
nord2)
:field-spacer (rgb 204 204 204)
:native-reference-background (rgb 255 255 255)
:body-border (rgba 60 90 60 0.1)
:expanded-string-background (rgba 255 100 100 0.98) ;;expanded-string 0.4
:expanded-string-border (rgba 255 100 100 0.6) ;; expanded-string 0.4
:custom-printing-background (rgb 255 255 200) ;; custom-printing
nil)))
(defclass code
[ambiance syntax-color-scheme]
{:background-color (syntax-color ambiance syntax-color-scheme :signature-background)
:border [[(px 1) :solid (color/darken (syntax-color ambiance syntax-color-scheme :signature-background) 50)]]})
(defclass hljs
[ambiance syntax-color-scheme]
{:composes (code ambiance syntax-color-scheme)
:border-radius gs-2
:font-weight 400}
[:.code-listing--highlighted
{:background (if (= :bright ambiance) nord13 nord2)}]
[:.hljs-symbol
{:color (syntax-color ambiance syntax-color-scheme :keyword)}]
[:.hljs-type
{:color (syntax-color ambiance syntax-color-scheme :type)}]
[:.hljs-string
{:color (syntax-color ambiance syntax-color-scheme :string)}]
[:.hljs-name
{:color (syntax-color ambiance syntax-color-scheme :fn)}]
[:.hljs-literal
{:color (syntax-color ambiance syntax-color-scheme :bool)}]
[:.hljs-number
{:color (syntax-color ambiance syntax-color-scheme :float)}])
;; /*! abridged from normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
(defclass normalize
[]
{:line-height (em 1.15)
:-webkit-text-size-adjust (percent 100)
:font-family font-stack}
[:h1
{:font-size (em 2)
:margin [[(em 0.67) 0]]}]
[:pre
:code
{:font-family [:monospace :monospace]
:font-size (em 1)}]
[:b
{:font-weight :bolder}]
[:button
:input
:select
:textarea
{:font-family font-stack
:font-size (percent 100)
:line-height 1.15
:margin 0}]
[:button
:input
{:overflow :visible}]
[:button
:select
{:text-transform :none}]
[:button
(s/html (s/attr= :type :button))
(s/attr= :type :reset)
(s/attr= :type :submit)
{:-webkit-appearance :button}]
[((s/button) -moz-focus-inner)
((s/attr= :type :button) -moz-focus-inner)
((s/attr= :type :reset) -moz-focus-inner)
((s/attr= :type :submit) -moz-focus-inner)
{:border-style :none
:padding 0}]
[((s/button) -moz-focusring)
((s/attr= :type :button) -moz-focusring)
((s/attr= :type :reset) -moz-focusring)
((s/attr= :type :submit) -moz-focusring)
{:outline [[(px 1) :dotted :ButtonText]]}]
[:textarea
{:overflow :auto}]
[:ol
{:padding-inline-start 0}])
;; nord0 nord6 background when not syntax
;; nord1 nord4 background prominent/focused
(defclass background
[ambiance]
{:background-color (if (= ambiance :bright) :#fff nord0)})
(defclass navigation
[_]
{:background-color nord0}
[:.rc-label
{:color nord5
:font-weight :bold
:font-size (px 14)}])
(defclass navigation-border-top
[ambiance]
{:composes (navigation ambiance)
#_#_:border-top [[gs-2 :solid nord1]]})
(defclass navigation-border-bottom
[ambiance]
{:composes (navigation ambiance)
#_#_:border-bottom [[gs-2 :solid nord1]]})
(defclass button
[ambiance]
{:cursor :pointer
:background-color (if (= :bright ambiance) nord5 nord0)
:color (if (= :bright ambiance) nord0 nord5)
;; TODO: why doesn't this default to 400?
:font-weight 400
:border-radius (px 2)
:border [[(px 1) :solid nord4]]
:padding [[gs-2 gs-5 gs-2 gs-5]]}
[:svg :path
{:fill (if (= :bright ambiance) nord0 nord5)}]
[:&:hover
{:background-color (if (= :bright ambiance) nord6 nord2)
:color (if (= :bright ambiance) nord2 nord6)}
[:svg :path
{:fill (if (= :bright ambiance) nord2 nord6)}]])
;[:.hljs-built_in
; :.hljs-type
; {:color nord7}]
;["::selection"
; {:background (if (= :bright ambiance) nord5 nord2)}]
;[:.hljs
; {:display :block
; :overflow-x :auto
; :padding (em 0.5)}]
;
;[:.hljs
; :.hljs-subst
; {:color (if (= :bright ambiance) nord0 nord4)}]
;[:.hljs-selector.tag
; {:color nord9}]
;[:.hljs-selector-id
; {:color nord7
; :font-weight :bold}]
;[:.hljs-selector-class
; {:color nord7}]
;[:.hljs-selector-attr
; {:color nord7}]
;[:.hljs-selector-pseudo
; {:color nord8}]
;[:.hljs-addition
; {:color nord14}]
;[:.hljs-deletion
; {:color nord11}]
;[:.hljs-class
; {:color nord7}]
;[:.hljs-function
; {:color nord8}
; ["> .hljs-title"
; {:color nord8}]]
;[:.hljs-keyword
; :.hljs-literal
; {:color nord9}]
;[:.hljs-symbol
; {:color nord13}]
;[:.hljs-number
; {:color nord15}]
;[:.hljs-regexp
; {:color nord13}]
;[:.hljs-params
; {:color nord4}]
;[:.hljs-comment
; {:color nord3}]
;[:.hljs-doctag
; {:color nord7}]
;[:.hljs-meta
; :.hljs-meta-keyword
; {:color nord10}]
;[:.hljs-meta-string
; {:color nord14}]
;[:.hljs-attr
; {:color nord7}]
;[:.hljs-attribute
; {:color nord4}]
;[:.hljs-builtin-name
; {:color nord9}]
;[:.hljs-name
; {:color nord8}]
;[:.hljs-section
; {:color nord8}]
;[:.hljs-tag
; {:color nord9}]
;[:.hljs-variable
; {:color nord4}]
;[:.hljs-template-variable
; {:color nord4}]
;[:.hljs-template-tag
; {:color nord10}])
(defclass section-header
[ambiance]
(let [[_ _ border] (if (= :bright ambiance)
[nord0 nord5 nord4]
[nord6 nord1 nord3])]
{:background-color (background-color-2 ambiance)
:color (color-2 ambiance)
#_#_:padding-left gs-12s ;; TODO: this conflicts between fx and subs; need padding for fx but no padding for subs.
:border [[(px 1) :solid border]]
:height gs-31
:font-size (px 14)
;:font-weight :bold ;; TODO same as above
:overflow :hidden}))
(defclass path-header-style
[ambiance]
{:background-color (if (= :bright ambiance) nord5 nord0)
:color (if (= :bright ambiance) nord0 nord5)
:margin (px 3)})
(defclass path-text-input-style
[ambiance]
{:background-color (background-color-1 ambiance)
:height (px 25)
:width #{"-webkit-fill-available" "-moz-available"}
:padding [[0 gs-7]]
:border :none}
[:&:focus
{:outline-color nord6}]
["&::placeholder"
{:color nord3
:font-style :italic
:font-weight 300}])
(defclass pod-border
[_]
{:border-left [[(px 1) :solid nord4]]
:border-right [[(px 1) :solid nord4]]
:border-bottom [[(px 1) :solid nord4]]})
(defclass pod-data
[ambiance]
{:background-color (background-color-1 ambiance)
:padding [[0 gs-2]]
:min-width (px 100)})
(defclass section-data
[ambiance]
{:background-color (syntax-color ambiance :cljs-devtools :signature-background)
:padding [[gs-5 gs-12]]})
(defclass app-db-inspector-link
[_]
{}
[:a
{:font-size (px 11)
:color nord7}])
(defclass no-select
[]
{:-webkit-touch-callout :none
:-webkit-user-select :none
:-khtml-user-select :none
:-moz-user-select :none
:-ms-user-select :none
:user-select :none})
(defclass done-button
[]
{:background-color nord13}
[:&:hover
{:background-color nord13}])
(defclass trace-table
[]
{:background-color nord4
:border-radius gs-2}
[:thead
{:background-color nord5}])
;; [IJ] TODO: fix post shadow-dom
(defclass at-keyframes-styles
[]
(let [slide? false]
[(at-keyframes :pulse-previous-re-frame-10x
[:from (merge {:color "white"}
(when slide? {:left "-100%"}))]
[:to (when slide? {:left "0%"})])
(at-keyframes :pulse-next-re-frame-10x
[:from (merge {:color "white"}
(when slide? {:left "100%"}))]
[:to (when slide? {:left "0%"})])
(at-keyframes :fade-clipboard-msg-re-frame-10x
[:0% {:margin-left "100px"}]
[:5% {:margin-left "0px"
:opacity "1"}]
[:90% {:opacity "1"}])]))
(defclass clj-symbol [] {:color nord10})
(defclass clj-core-macro [] {:color nord11})
(defclass clj-keyword [] {:color nord15})
(defclass clj-number [] {:color nord12})
(defclass clj-string [] {:color nord14})
(defclass clj-nil [] {:color nord3})
(defclass clj-boolean [] {:color nord3})
(defclass clj-highlighted [] {:background-color nord13})
(defclass clj-seq [] {})