|
16 | 16 | // $mc: mix color, defined in High Contrast specific stylesheet |
17 | 17 | // $mf: mix factor (%), defined in High Contrast specific stylesheet |
18 | 18 | // |
19 | | - @return mix($c, $mc, $mf); |
| 19 | + @return st-mix($c, $mc, $mf); |
20 | 20 | } |
21 | 21 |
|
22 | 22 | // Function to mix the color and make the focus background |
23 | | -@function focus_bg_color($bg, $fc:$focus_color) { |
24 | | - @return mix($fc, $bg, 5%); |
| 23 | +@function focus_bg_color($bg, $fc:$accent_color) { |
| 24 | + @return st-mix($fc, $bg, 5%); |
25 | 25 | } |
26 | 26 |
|
27 | 27 | // |
|
54 | 54 | } |
55 | 55 |
|
56 | 56 | // Draw the focus ring |
57 | | -@mixin focus_ring($width: 2px, $fc: $focus_border_color, $border: false) { |
58 | | - box-shadow: inset 0 0 0 $width $fc !important; |
| 57 | +@mixin focus_ring($width: 2px, $fc: $accent_color, $border: false) { |
| 58 | + |
| 59 | + $focus_color: st-transparentize($fc, $focus_border_opacity); |
| 60 | + |
| 61 | + box-shadow: inset 0 0 0 $width $focus_color !important; |
59 | 62 | @if $border { |
60 | | - border:$width solid $fc !important; |
| 63 | + border:$width solid $focus_color !important; |
61 | 64 | box-shadow: none; |
62 | 65 | } |
63 | 66 | } |
|
90 | 93 | // entry colors |
91 | 94 | $entry_fg_color: $c; |
92 | 95 | $entry_bg_color: mix($c, $bc, $background_mix_factor); |
93 | | - $entry_focus_color: $focus_color; |
| 96 | + $entry_focus_color: $accent_color; |
94 | 97 |
|
95 | 98 | // entry color overrides for lockscreen style |
96 | 99 | @if $style == 'lockscreen' { |
|
128 | 131 |
|
129 | 132 | // focus styles |
130 | 133 | @if $type == 'focus' { |
131 | | - @include focus_ring(); |
| 134 | + @include focus_ring($fc:$entry_focus_color); |
132 | 135 | background-color: focus_bg_color($entry_bg_color); |
133 | 136 | color: $entry_fg_color; |
134 | 137 |
|
|
160 | 163 | // - normal, focus, hover, active, checked, insensitive, default, undecorated |
161 | 164 | // $c: button bg color, derived from bg_color |
162 | 165 | // $tc: button text color, derived from fg_color |
163 | | - // $style: button style, possible values: card, bubble, flat, default |
| 166 | + // $style: button style, possible values: card, notification, dialog, flat, default |
164 | 167 | // $always_dark: override the light theme check to use dark colors, true or false |
165 | 168 | // |
166 | 169 |
|
167 | 170 | // mix input colors to get button background color |
168 | | - $button_bg_color: mix($tc, $c, $background_mix_factor); |
| 171 | + $button_bg_color: st-mix($tc, $c, $background_mix_factor); |
169 | 172 |
|
170 | 173 | // background color override for card elements |
171 | 174 | @if $style == 'card' { $button_bg_color: $card_bg_color;} |
|
187 | 190 | } |
188 | 191 |
|
189 | 192 | // button base state background colors |
190 | | - $hover_button_bg_color: if($variant == 'light', darken($button_bg_color, $hover_factor), lighten($button_bg_color, $hover_factor)); |
191 | | - $active_button_bg_color: if($variant == 'light', darken($button_bg_color, $active_factor), lighten($button_bg_color, $active_factor)); |
192 | | - $checked_button_bg_color: if($variant == 'light', darken($button_bg_color, $checked_factor), lighten($button_bg_color, $checked_factor)); |
193 | | - $insensitive_button_bg_color: if($variant == 'light', lighten($button_bg_color, $insensitive_factor), darken($button_bg_color, $insensitive_factor)); |
| 193 | + $hover_button_bg_color: if($variant == 'light', st-darken($button_bg_color, $hover_factor), st-lighten($button_bg_color, $hover_factor)); |
| 194 | + $active_button_bg_color: if($variant == 'light', st-darken($button_bg_color, $active_factor), st-lighten($button_bg_color, $active_factor)); |
| 195 | + $checked_button_bg_color: if($variant == 'light', st-darken($button_bg_color, $checked_factor), st-lighten($button_bg_color, $checked_factor)); |
| 196 | + $insensitive_button_bg_color: if($variant == 'light', st-lighten($button_bg_color, $insensitive_factor), st-darken($button_bg_color, $insensitive_factor)); |
194 | 197 |
|
195 | 198 | // button extended state background colors |
196 | | - $active_hover_button_bg_color: if($variant == 'light', darken($active_button_bg_color, $hover_factor), lighten($active_button_bg_color, $hover_factor)); |
197 | | - $checked_hover_button_bg_color: if($variant == 'light', darken($checked_button_bg_color, $hover_factor), lighten($checked_button_bg_color, $hover_factor)); |
198 | | - $checked_active_button_bg_color: if($variant == 'light', darken($checked_button_bg_color, $active_factor), lighten($checked_button_bg_color, $active_factor)); |
| 199 | + $active_hover_button_bg_color: if($variant == 'light', st-darken($active_button_bg_color, $hover_factor), st-lighten($active_button_bg_color, $hover_factor)); |
| 200 | + $checked_hover_button_bg_color: if($variant == 'light', st-darken($checked_button_bg_color, $hover_factor), st-lighten($checked_button_bg_color, $hover_factor)); |
| 201 | + $checked_active_button_bg_color: if($variant == 'light', st-darken($checked_button_bg_color, $active_factor), st-lighten($checked_button_bg_color, $active_factor)); |
199 | 202 |
|
200 | 203 | // override button background colours if element is always dark |
201 | 204 | @if $always_dark { |
202 | | - $hover_button_bg_color: lighten($button_bg_color, $hover_factor); |
203 | | - $active_button_bg_color: lighten($button_bg_color, $active_factor); |
204 | | - $checked_button_bg_color: lighten($button_bg_color, $checked_factor); |
205 | | - $insensitive_button_bg_color: darken($button_bg_color, $insensitive_factor); |
| 205 | + $hover_button_bg_color: st-lighten($button_bg_color, $hover_factor); |
| 206 | + $active_button_bg_color: st-lighten($button_bg_color, $active_factor); |
| 207 | + $checked_button_bg_color: st-lighten($button_bg_color, $checked_factor); |
| 208 | + $insensitive_button_bg_color: st-darken($button_bg_color, $insensitive_factor); |
206 | 209 | // extended |
207 | | - $active_hover_button_bg_color: lighten($active_button_bg_color, $hover_factor); |
208 | | - $checked_hover_button_bg_color: lighten($checked_button_bg_color, $hover_factor); |
209 | | - $checked_active_button_bg_color: lighten($checked_button_bg_color, $active_factor); |
| 210 | + $active_hover_button_bg_color: st-lighten($active_button_bg_color, $hover_factor); |
| 211 | + $checked_hover_button_bg_color: st-lighten($checked_button_bg_color, $hover_factor); |
| 212 | + $checked_active_button_bg_color: st-lighten($checked_button_bg_color, $active_factor); |
210 | 213 | } |
211 | 214 |
|
212 | 215 | // background color override for buttons that use transparency |
213 | | - // styles: notification bubbles, lockscreen |
214 | | - @if $style == 'bubble' or $style == 'lockscreen' { |
| 216 | + // styles: dialogs bubbles, lockscreen |
| 217 | + @if $style == 'dialog' or $style == 'lockscreen' { |
215 | 218 | $button_bg_color: transparentize($tc, .9); |
216 | 219 | $hover_button_bg_color: transparentize($tc, .87); |
217 | 220 | $active_button_bg_color: transparentize($tc, .84); |
218 | 221 | $active_hover_button_bg_color: transparentize($tc, .81); |
219 | 222 | } |
220 | 223 |
|
| 224 | + // background color overrides for notification style |
| 225 | + @if $style == 'notification' { |
| 226 | + $button_bg_color: transparentize($tc, .85); |
| 227 | + $hover_button_bg_color: transparentize($tc, .7); |
| 228 | + $insensitive_button_bg_color: transparentize($tc, .9); |
| 229 | + $active_button_bg_color: transparentize($tc, .8); |
| 230 | + $active_hover_button_bg_color: transparentize($tc, .8); |
| 231 | + } |
| 232 | + |
221 | 233 | // flat style overrides |
222 | 234 | @if $style == 'flat' { |
223 | 235 | $insensitive_button_bg_color: $button_bg_color; |
|
283 | 295 |
|
284 | 296 | // insensitive button |
285 | 297 | @else if $type == 'insensitive' { |
286 | | - $insensitive_button_fg_color: if($variant == 'light', transparentize($tc, .6), transparentize($tc, .5)); |
| 298 | + $insensitive_button_fg_color: if($variant == 'light', st-transparentize($tc, .6), st-transparentize($tc, .5)); |
287 | 299 | color: $insensitive_button_fg_color; |
288 | 300 | background-color: $insensitive_button_bg_color; |
289 | 301 |
|
|
300 | 312 |
|
301 | 313 | // use a different focus ring color for default style |
302 | 314 | @if $style == 'default' { |
303 | | - @include focus_ring($fc:$selected_borders_color); |
| 315 | + @include focus_ring($fc:$accent_borders_color); |
304 | 316 | } |
305 | 317 | // change background color if style is flat |
306 | 318 | @if $style == 'flat' { |
|
348 | 360 | &:insensitive { @include button(insensitive, $tc:$fg, $c:$bg, $always_dark: $system);} |
349 | 361 | } @else { |
350 | 362 | @include button(normal, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system); |
| 363 | + // override the mixin to have the flat button always be transparent |
| 364 | + // fixes issue with overlapping tiles |
| 365 | + background-color: transparent; |
351 | 366 | &:focus { @include button(focus, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system);} |
352 | 367 | &:hover { @include button(hover, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system);} |
353 | 368 | &:active { @include button(active, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system);} |
|
357 | 372 | } |
358 | 373 |
|
359 | 374 | &:drop { |
360 | | - background-color: transparentize($selected_bg_color, .8); |
361 | | - box-shadow: inset 0 0 0 2px transparentize($selected_bg_color, .2); |
| 375 | + background-color: st-transparentize(-st-accent-color, .8); |
| 376 | + box-shadow: inset 0 0 0 2px st-transparentize(-st-accent-color, .2); |
362 | 377 | } |
363 | 378 | } |
364 | 379 |
|
365 | 380 | // styling for all menuitems in popovers |
366 | | -@mixin menuitem($bg, $style: flat) { |
| 381 | +@mixin menuitem($bg) { |
367 | 382 |
|
368 | 383 | // extend common styles |
369 | 384 | @extend %menuitem; |
370 | 385 |
|
371 | | - // lighten the background color always |
372 | | - $bg: lighten($bg,5%); |
373 | | - |
374 | | - @if $style == 'flat' { |
375 | | - @include button(undecorated); |
376 | | - } @else { |
377 | | - @include button(normal, $c:$bg); |
378 | | - } |
379 | | - &:focus, |
380 | | - &:hover { |
381 | | - @include button(hover, $c:$bg); |
382 | | - } |
383 | | - &:active {@include button(active, $c:$bg);} |
384 | | - &:checked {@include button(checked, $c:$bg);} |
385 | | - &:insensitive {@include button(insensitive, $c:$bg);} |
| 386 | + @include button(undecorated, $c:$bg, $style: flat); |
| 387 | + &:active { @include button(active, $c:$bg, $style: flat);} |
| 388 | + &:hover, &:selected, &:checked { @include button(hover, $c:$bg, $style: flat);} |
| 389 | + &:insensitive { @include button(insensitive, $c:$bg, $style: flat);} |
386 | 390 | } |
387 | 391 |
|
388 | 392 | // Panel menu/button drawing function |
|
0 commit comments