blob: 2ba8d2e20c8aaa812e63d48300542b801d18d55c (
plain) (
blame)
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
|
;; -*- eval: (rainbow-mode) -*-
(ns bbbg.styles
(:require
[garden.color :as color]
[garden.compiler :refer [compile-css]]
[garden.def :refer [defstyles]]
[garden.selectors :refer [& active attr= descendant hover visited]]))
(def black "#342e37")
(def silver "#f9fafb")
(def gray "#aaa")
(def gray-light "#ddd")
(def purple "#837aff")
(def red "#c42348")
(def orange "#fa824c")
(def yellow "#FACB0F")
(def blue "#026fb1")
(def green "#87E24B")
(def contextual-colors
{:success green
:info blue
:warning yellow
:error red})
;;;
(defstyles global-nav
[:.global-nav
{:background-color silver}
[:>ul
{:display :flex
:flex-direction :row
:list-style :none}]
[:a (descendant :.link-form (attr= "type" "submit"))
{:padding "1rem 1.5rem"
:display :block
:color black
:text-decoration :none}
[(& hover)
{:color blue}]]
[:.spacer
{:flex 1}]])
(def link-conditional-styles
(list
[(& hover) (& active)
{:text-decoration :underline}]
[(& active)
{:color purple}]))
(defstyles link-form
[:form.link-form
{:margin 0}
[(attr= "type" "submit")
{:background "none"
:border "none"
:padding 0
:color blue
:text-decoration :none
:cursor :pointer}
link-conditional-styles]])
(defstyles flash
[:.flash-messages
{:width "800px"
:margin "1rem auto"}]
[:.flash-message
{:padding "1rem 1.5rem"
:border "1px solid"
:margin-bottom "1rem"}]
(for [[context color] contextual-colors]
[(& (keyword (str ".flash-" (name context))))
{:border-color color
:background-color (color/lighten color 30)
:border-radius "5px"}]))
(defstyles styles
global-nav
link-form
flash
[:body
{:color black}]
[:a {:color blue
:text-decoration :none}
link-conditional-styles])
(def stylesheet
(compile-css styles))
|