From 4fd81a5f85dfb1357018f1f2c6cdad97596fb23d Mon Sep 17 00:00:00 2001 From: Sam Hewitt Date: Tue, 29 Aug 2023 13:50:36 -0230 Subject: [PATCH] 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 --- data/theme/gnome-shell-sass/_common.scss | 2 +- data/theme/gnome-shell-sass/_drawing.scss | 25 ++++++++++++++++--- .../widgets/_switcher-popup.scss | 17 ++++++++++--- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss index ecd39c757..33ff8c363 100644 --- a/data/theme/gnome-shell-sass/_common.scss +++ b/data/theme/gnome-shell-sass/_common.scss @@ -68,7 +68,7 @@ stage { color: inherit; @if $is_highcontrast { - border-color: $hc_inset_color; + border-color: $hc_inset_color !important; } } diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss index 3909f518f..9b8ba8a73 100644 --- a/data/theme/gnome-shell-sass/_drawing.scss +++ b/data/theme/gnome-shell-sass/_drawing.scss @@ -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 diff --git a/data/theme/gnome-shell-sass/widgets/_switcher-popup.scss b/data/theme/gnome-shell-sass/widgets/_switcher-popup.scss index 5136c3cfe..e2cb66f8e 100644 --- a/data/theme/gnome-shell-sass/widgets/_switcher-popup.scss +++ b/data/theme/gnome-shell-sass/widgets/_switcher-popup.scss @@ -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; + } } }