From e58cd282e7def665ec8a65d95819a1e54b27898d Mon Sep 17 00:00:00 2001 From: Sam Hewitt Date: Thu, 25 Jan 2024 12:11:26 -0330 Subject: [PATCH] style: Be consistent with Adwaita flat elements in High Contrast - update drawing mixin for buttons to override HC inset in flat style - drop outlines for app icons in dash Part-of: --- data/theme/gnome-shell-sass/_drawing.scss | 34 ++++++++++++++----- .../theme/gnome-shell-sass/widgets/_dash.scss | 4 --- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss index 07020ee71..60fd49ab6 100644 --- a/data/theme/gnome-shell-sass/_drawing.scss +++ b/data/theme/gnome-shell-sass/_drawing.scss @@ -29,12 +29,28 @@ // // Draw the inset for High Contrast elements -@mixin draw_hc_inset($width: 1px, $fc: $hc_inset_color, $border: false) { - box-shadow: inset 0 0 0 $width $fc; +@mixin draw_hc_inset($width: 1px, $ic: $hc_inset_color, $border: false, $no_inset: false) { + // + // $width width of the inset, in pixels + // $ic color of the inset + // + // $border if true, use a border instead of a box-shadow to draw inset + // $no_inset if true, override the mixin to not draw an iset + // + + box-shadow: inset 0 0 0 $width $ic; + + // draw inset as border @if $border { - border: $width solid $fc; + border: $width solid $ic; box-shadow: none; } + + // don't draw an inset at all + @if $no_inset { + box-shadow: none; + border: none; + } } // Draw the focus ring @@ -217,7 +233,7 @@ } @if $style == 'default' { - @include draw_hc_inset($width:0px); + @include draw_hc_inset($no_inset: true); } } @@ -225,6 +241,11 @@ @if $type == 'normal' { color: $tc; background-color: $button_bg_color; + + // no inset in High Contrast when the style is flat + @if $style == 'flat' and $contrast == 'high' { + @include draw_hc_inset($no_inset: true); + } } // hover button @@ -261,7 +282,7 @@ // no outline in High Contrast for insensitive buttons @if $contrast == 'high' { - @include draw_hc_inset($fc:transparent); + @include draw_hc_inset($no_inset: true); } } @@ -328,9 +349,6 @@ &:insensitive { @include button(insensitive, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system);} } - @if $contrast == 'high' { - @include draw_hc_inset(); - } &:highlighted { // brighter background color than other states diff --git a/data/theme/gnome-shell-sass/widgets/_dash.scss b/data/theme/gnome-shell-sass/widgets/_dash.scss index 84c07672f..db378ca1e 100644 --- a/data/theme/gnome-shell-sass/widgets/_dash.scss +++ b/data/theme/gnome-shell-sass/widgets/_dash.scss @@ -58,10 +58,6 @@ $dash_spacing: $base_margin * 0.5; .overview-icon { @extend %tile; @include button(normal, $tc:$fg, $c:$bg, $style: flat, $always_dark: true); - - @if $contrast == 'high' { - @include draw_hc_inset(); - } } &:focus .overview-icon { @include button(focus, $tc:$fg, $c:$bg, $style: flat, $always_dark: true);}