style: Fix contrast issue in app switcher

- update focus style for tile_button drawing
- override style for switcher selected state to use focus style
- fix contrast issue with checked state
This commit is contained in:
Sam Hewitt 2023-08-29 13:50:36 -02:30
parent 3cfc918976
commit 4fd81a5f85
3 changed files with 35 additions and 9 deletions

View file

@ -68,7 +68,7 @@ stage {
color: inherit;
@if $is_highcontrast {
border-color: $hc_inset_color;
border-color: $hc_inset_color !important;
}
}

View file

@ -259,21 +259,38 @@
background-color: transparent;
} @else {
background-color: transparentize($color, .84);
@if $is_highcontrast {
box-shadow: inset 999px 0 0 0 transparentize($color, .2); // bit of a hack
}
}
@if $is_highcontrast {
border-color: transparentize($color, .7) !important;
box-shadow: inset 999px 0 0 0 transparentize($color, .9);
}
&:hover { background-color: transparentize($color, .9);}
&:selected, &:focus {
&:focus {
$fc: mix($color, $selected_bg_color, 20%);
background-color: transparentize($fc, .7);
border-color: transparentize($selected_bg_color, .3);
&:active { background-color: transparentize($fc, .67);}
&:hover { background-color: transparentize($fc, .63);}
@if $is_highcontrast {
border-color: $selected_bg_color !important;
}
}
&:selected {
background-color: transparentize($color, .87);
&:hover { background-color: transparentize($color, .84);}
&:active { background-color: transparentize($color, .87);}
@if $is_highcontrast {
border-color: transparentize($color, .3) !important;
}
}
&:active { background-color: transparentize($color, .84);}
&:outlined, &:checked {
background-color: transparentize($color, .81);
&:active { background-color: transparentize($color, .78);}
&:hover { background-color: transparentize($color, .75);}
@if $is_highcontrast {
border-color: transparentize($color, .5) !important;
}
}
&:drop {
border: 2px solid transparentize($selected_bg_color, .2); //already 2px transparent so no jumping

View file

@ -25,10 +25,19 @@ $switcher_padding: $base_padding*2;
// each item in the list
.item-box {
@include tile_button($osd_fg_color);
// override over style so mouse doesn't steal focus
&:hover {background: none;}
@if $is_highcontrast {
box-shadow: inset 0 0 0 999px transparentize($hc_inset_color,0.2);
// override hover style so mouse doesn't steal focus
&:hover { background: none;}
// specific style bits for the highlighted item to use focus styling
&:selected {
$sc: mix($osd_fg_color, $selected_bg_color, 20%);
background-color: transparentize($sc, .7);
border-color: transparentize($selected_bg_color, .3);
&:active { background-color: transparentize($sc, .67);}
&:hover { background-color: transparentize($sc, .63);}
@if $is_highcontrast {
border-color: $selected_bg_color !important;
}
}
}