mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 16:30:15 +00:00
Adwaita: drop text shadows for buttons
- People seem to misunderstand the unsharp-mask-like increase of visual contrast for "fuziness". That is not the reason for the change. The stylistic change of just going with flat text label allows to simplify the code and drop complexity. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2280
This commit is contained in:
parent
97ceb03008
commit
b6353a6369
@ -903,10 +903,8 @@ button {
|
||||
// the dot is drawn by using two radial gradient, the first one is the actuall dot, the other
|
||||
// simulates the shadow labels and icons normally have in buttons.
|
||||
animation: needs_attention 150ms ease-in;
|
||||
$_dot_shadow: _text_shadow_color(); // shadow color
|
||||
|
||||
background-image: radial-gradient(farthest-side, $_dot_color 96%, transparentize($_dot_color,1 )),
|
||||
radial-gradient(farthest-side, $_dot_shadow 95%, transparentize($_dot_shadow, 1));
|
||||
background-image: radial-gradient(farthest-side, $_dot_color 96%, transparentize($_dot_color,1 ));
|
||||
background-size: 6px 6px, 6px 6px;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
@ -1017,7 +1015,7 @@ button.color {
|
||||
&, > overlay { border-radius: 0; }
|
||||
|
||||
@if $variant == 'light' {
|
||||
box-shadow: 0 1px _text_shadow_color();
|
||||
box-shadow: 0 1px $shadow_color;
|
||||
|
||||
.osd & { box-shadow: none; }
|
||||
}
|
||||
@ -4165,7 +4163,6 @@ button.titlebutton {
|
||||
|
||||
@extend %button_basic_flat;
|
||||
|
||||
@include _button_text_shadow;
|
||||
|
||||
&:not(.menu) {
|
||||
border-radius: 9999px;
|
||||
|
@ -123,17 +123,6 @@
|
||||
@else { @return darken($c, 10%); }
|
||||
}
|
||||
|
||||
@function _text_shadow_color ($tc: $fg_color, $bg: $bg_color) {
|
||||
//
|
||||
// calculate the color of text shadows
|
||||
//
|
||||
// $tc is the text color
|
||||
// $bg is the background color
|
||||
//
|
||||
$_lbg: lightness($bg)/100%;
|
||||
@if lightness($tc)<50% { @return transparentize(white, 1-$_lbg/($_lbg*1.3)); }
|
||||
@else { @return transparentize(black, $_lbg*0.8); }
|
||||
}
|
||||
|
||||
@function _button_hilight_color($c) {
|
||||
//
|
||||
@ -149,26 +138,7 @@
|
||||
@else { @return transparentize(white, 0.98); }
|
||||
}
|
||||
|
||||
@mixin _button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
|
||||
//
|
||||
// helper function for the text emboss effect
|
||||
//
|
||||
// $tc is the optional text color, not the shadow color
|
||||
//
|
||||
// TODO: this functions needs a way to deal with special cases
|
||||
//
|
||||
|
||||
$_shadow: _text_shadow_color($tc, $bg);
|
||||
|
||||
@if lightness($tc)<50% {
|
||||
text-shadow: 0 1px $_shadow;
|
||||
-gtk-icon-shadow: 0 1px $_shadow;
|
||||
}
|
||||
@else {
|
||||
text-shadow: 0 -1px $_shadow;
|
||||
-gtk-icon-shadow: 0 -1px $_shadow;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: none) {
|
||||
//
|
||||
@ -202,7 +172,6 @@
|
||||
$button_fill: if($variant == 'light', linear-gradient(to top, darken($c, 4%) 2px, $c),
|
||||
linear-gradient(to top, darken($c,1%) 2px, $c)) !global;
|
||||
background-image: $button_fill;
|
||||
@include _button_text_shadow($tc, $c);
|
||||
@include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
|
||||
}
|
||||
|
||||
@ -215,12 +184,10 @@
|
||||
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
||||
@if $variant == 'light' {
|
||||
$button_fill: linear-gradient(to top, $c, lighten($c, 1%) 1px) !global;
|
||||
@include _button_text_shadow($tc, lighten($c, 6%));
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge, $_button_shadow);
|
||||
}
|
||||
@else {
|
||||
$button_fill: linear-gradient(to top, darken($c,1%), lighten($c, 1%) 1px) !global;
|
||||
@include _button_text_shadow($tc,lighten($c, 6%));
|
||||
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge, $_button_shadow);
|
||||
}
|
||||
background-image: $button_fill;
|
||||
@ -232,7 +199,6 @@
|
||||
//
|
||||
color: $tc;
|
||||
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
||||
@include _button_text_shadow($tc, $c);
|
||||
@if $variant == 'light' {
|
||||
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
|
||||
|
Loading…
Reference in New Issue
Block a user