|
4 | 4 | // go from darkest to lightest |
5 | 5 |
|
6 | 6 | $themes: ( |
7 | | - normal: ( |
8 | | - black-1: black, |
9 | | - black-transparent: rgba(0,0,0,0.5), |
10 | | - white-1: white, |
11 | | - white-transparent: rgba(255, 255, 255, 0.5), |
12 | | - |
13 | | - grey-1: grey, |
14 | | - grey-2: #CCC, |
15 | | - grey-3: #EEE, |
16 | | - grey-background: #EEE, |
17 | | - |
18 | | - blue-1: #08C, |
19 | | - |
20 | | - yellow-1: #fff1ba, |
21 | | - yellow-2: #fff4cc, |
22 | | - |
23 | | - red-1: #DD4B39, |
24 | | - red-2: #EEA59C, |
25 | | - |
26 | | - black-search: #2a2a2e, |
27 | | - white-search: #f9f9fa, |
28 | | - grey-search: #b1b1b3, |
29 | | - |
30 | | - blue-menu: #F4FCFF, |
31 | | - ), |
32 | | - accessibility: ( |
33 | | - black-1: white, |
34 | | - black-transparent: rgba(255, 255, 255, 0.5), |
35 | | - white-1: black, |
36 | | - white-transparent: rgba(0,0,0,0.5), |
37 | | - |
38 | | - grey-1: white, |
39 | | - grey-2: white, |
40 | | - grey-3: white, |
41 | | - grey-background: black, |
42 | | - |
43 | | - blue-1: yellow, |
44 | | - |
45 | | - yellow-1: yellow, |
46 | | - yellow-2: yellow, |
47 | | - |
48 | | - red-1: red, |
49 | | - red-2: red, |
50 | | - |
51 | | - black-search: white, |
52 | | - white-search: black, |
53 | | - grey-search: white, |
54 | | - |
55 | | - blue-menu: cyan, |
56 | | - ), |
| 7 | + normal: ( |
| 8 | + black-1: black, |
| 9 | + black-transparent: rgba(0, 0, 0, 0.5), |
| 10 | + white-1: white, |
| 11 | + white-transparent: rgba(255, 255, 255, 0.5), |
| 12 | + grey-1: grey, |
| 13 | + grey-2: #ccc, |
| 14 | + grey-3: #eee, |
| 15 | + grey-background: #eee, |
| 16 | + blue-1: #08c, |
| 17 | + yellow-1: #fff1ba, |
| 18 | + yellow-2: #fff4cc, |
| 19 | + red-1: #dd4b39, |
| 20 | + red-2: #eea59c, |
| 21 | + black-search: #2a2a2e, |
| 22 | + white-search: #f9f9fa, |
| 23 | + grey-search: #b1b1b3, |
| 24 | + blue-menu: #f4fcff |
| 25 | + ), |
| 26 | + accessibility: ( |
| 27 | + black-1: white, |
| 28 | + black-transparent: rgba(255, 255, 255, 0.5), |
| 29 | + white-1: black, |
| 30 | + white-transparent: rgba(0, 0, 0, 0.5), |
| 31 | + grey-1: white, |
| 32 | + grey-2: white, |
| 33 | + grey-3: white, |
| 34 | + grey-background: black, |
| 35 | + blue-1: yellow, |
| 36 | + yellow-1: yellow, |
| 37 | + yellow-2: yellow, |
| 38 | + red-1: red, |
| 39 | + red-2: red, |
| 40 | + black-search: white, |
| 41 | + white-search: black, |
| 42 | + grey-search: white, |
| 43 | + blue-menu: cyan |
| 44 | + ) |
57 | 45 | ); |
58 | 46 |
|
59 | 47 | $theme-map: null; |
60 | 48 |
|
61 | 49 | @mixin themify($themes: $themes) { |
62 | | - @each $theme, $map in $themes { |
63 | | - .theme-#{$theme} & { |
64 | | - $theme-map: () !global; |
65 | | - @each $key, $submap in $map { |
66 | | - $value: map-get(map-get($themes, $theme), '#{$key}'); |
67 | | - $theme-map: map-merge($theme-map, ($key: $value)) !global; |
68 | | - } |
69 | | - @content; |
70 | | - $theme-map: null !global; |
71 | | - } |
| 50 | + @each $theme, $map in $themes { |
| 51 | + .theme-#{$theme} & { |
| 52 | + $theme-map: () !global; |
| 53 | + @each $key, $submap in $map { |
| 54 | + $value: map-get(map-get($themes, $theme), "#{$key}"); |
| 55 | + $theme-map: map-merge( |
| 56 | + $theme-map, |
| 57 | + ( |
| 58 | + $key: $value |
| 59 | + ) |
| 60 | + ) !global; |
| 61 | + } |
| 62 | + @content; |
| 63 | + $theme-map: null !global; |
72 | 64 | } |
| 65 | + } |
73 | 66 | } |
74 | 67 |
|
75 | 68 | @function themed($key) { |
76 | | - @return map-get($theme-map, $key); |
| 69 | + @return map-get($theme-map, $key); |
77 | 70 | } |
78 | 71 |
|
79 | 72 | // Shared |
80 | 73 | @mixin hover-black { |
81 | | - &:hover { |
82 | | - svg { |
83 | | - @include themify($themes) { |
84 | | - fill: themed('black-1'); |
85 | | - } |
86 | | - } |
| 74 | + &:hover { |
| 75 | + svg { |
| 76 | + @include themify($themes) { |
| 77 | + fill: themed("black-1"); |
| 78 | + } |
87 | 79 | } |
| 80 | + } |
88 | 81 | } |
89 | 82 |
|
90 | 83 | @mixin icon-special($size, $color) { |
91 | | - svg { |
92 | | - vertical-align: middle; |
93 | | - fill: $color; |
94 | | - height: $size; |
95 | | - width: $size; |
96 | | - } |
| 84 | + svg { |
| 85 | + vertical-align: middle; |
| 86 | + fill: $color; |
| 87 | + height: $size; |
| 88 | + width: $size; |
| 89 | + } |
97 | 90 | } |
98 | 91 |
|
99 | 92 | // Classes |
100 | 93 | .button { |
101 | | - margin: 10px; |
102 | | - padding: 20px; |
103 | | - border-radius: 2px; |
104 | | - position: relative; |
105 | | - text-align: center; |
106 | | - font-size: 16px; |
107 | | - @include themify($themes) { |
108 | | - background: themed('white-1'); |
109 | | - border: themed('grey-2') 1px solid; |
110 | | - color: themed('grey-1'); |
111 | | - } |
112 | | - cursor: pointer; |
| 94 | + margin: 10px; |
| 95 | + padding: 20px; |
| 96 | + border-radius: 2px; |
| 97 | + position: relative; |
| 98 | + text-align: center; |
| 99 | + font-size: 16px; |
| 100 | + @include themify($themes) { |
| 101 | + background: themed("white-1"); |
| 102 | + border: themed("grey-2") 1px solid; |
| 103 | + color: themed("grey-1"); |
| 104 | + } |
| 105 | + cursor: pointer; |
113 | 106 |
|
114 | | - &:hover { |
115 | | - @include themify($themes) { |
116 | | - color: themed('black-1'); |
117 | | - } |
| 107 | + &:hover { |
| 108 | + @include themify($themes) { |
| 109 | + color: themed("black-1"); |
118 | 110 | } |
| 111 | + } |
119 | 112 | } |
120 | 113 |
|
121 | 114 | .button-small { |
122 | | - @extend .button; |
123 | | - font-size: 12px; |
124 | | - margin: 20px 100px; |
125 | | - padding: 10px; |
| 115 | + @extend .button; |
| 116 | + font-size: 12px; |
| 117 | + margin: 20px 100px; |
| 118 | + padding: 10px; |
126 | 119 | } |
127 | 120 |
|
128 | 121 | .input { |
129 | | - display: block; |
130 | | - margin: 0 10px 10px 10px; |
131 | | - padding: 10px; |
132 | | - width: 260px; |
133 | | - @include themify($themes) { |
134 | | - color: themed('black-1'); |
135 | | - border: themed('grey-2') 1px solid; |
136 | | - background: themed('white-1'); |
137 | | - } |
138 | | - outline: none; |
| 122 | + display: block; |
| 123 | + margin: 0 10px 10px 10px; |
| 124 | + padding: 10px; |
| 125 | + width: 260px; |
| 126 | + @include themify($themes) { |
| 127 | + color: themed("black-1"); |
| 128 | + border: themed("grey-2") 1px solid; |
| 129 | + background: themed("white-1"); |
| 130 | + } |
| 131 | + outline: none; |
139 | 132 | } |
140 | 133 |
|
141 | 134 | a { |
142 | | - @include themify($themes) { |
143 | | - color: themed('blue-1'); |
144 | | - } |
| 135 | + @include themify($themes) { |
| 136 | + color: themed("blue-1"); |
| 137 | + } |
145 | 138 | } |
0 commit comments