Skip to content

Commit

Permalink
Get rid of button_fill variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lassekongo83 committed Nov 24, 2020
1 parent 807e6c3 commit a89497c
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 88 deletions.
8 changes: 2 additions & 6 deletions gtk/src/Plano/gtk-3.0/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ $ease-out: cubic-bezier(0, 0, .2, 1);
$ease-in: cubic-bezier(.4, 0, 1, 1);
$ease-in-out: cubic-bezier(.4, 0, .6, 1);

$button_fill: null;

* {
padding: 0;
-GtkToolButton-icon-spacing: 4;
Expand Down Expand Up @@ -913,16 +911,14 @@ button {
$_border_bg: linear-gradient(to top, $alt-borders-color 25%, $borders-color 50%);

&:not(.flat):not(.osd):not(:checked):not(:active):not(:disabled):not(:backdrop) {
@include button(normal);
@include button(normal, $backimage: $_border_bg);

background-image: $button_fill, $_border_bg;
border-color: transparent;
}

&:hover:not(.osd):not(:checked):not(:active):not(:disabled):not(:backdrop) {
@include button(hover);
@include button(hover, $backimage: $_border_bg);

background-image: $button_fill, $_border_bg;
border-color: transparent;
}

Expand Down
57 changes: 18 additions & 39 deletions gtk/src/Plano/gtk-3.0/_drawing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
}
}

@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: none) {
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: none, $backimage: null) {
//
// Button drawing function
//
Expand All @@ -180,8 +180,6 @@
// normal, hover, active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
// This mixin sets the $button_fill global variable which containts the button background-image
//
$_hilight_color: _button_hilight_color($c);
$_button_edge: if($edge == none, none, _widget_edge($edge));
Expand All @@ -196,8 +194,7 @@
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c), darken($borders_color, 12%));
$button_fill: if($variant == 'light', lighten($c, 5%), lighten($c, 5%)) !global;
background-color: $button_fill;
background-color: if($variant == 'light', lighten($c, 5%), lighten($c, 5%));
//@include _button_text_shadow($tc, $c);
//@include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
}
Expand All @@ -210,16 +207,15 @@
outline-color: transparentize($tc, 0.7);
border-color: $selected_bg_color;
@if $variant == 'light' {
$button_fill: if($variant == 'light', lighten($c, 8%), lighten($c, 14%)) !global;
background-color: if($variant == 'light', lighten($c, 8%), lighten($c, 14%));
//@include _button_text_shadow($tc, lighten($c, 6%));
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge, $_button_shadow_hover);
}
@else {
$button_fill: if($variant == 'light', lighten($c, 8%), lighten($c, 14%)) !global;
background-color: if($variant == 'light', lighten($c, 8%), lighten($c, 14%));
//@include _button_text_shadow($tc,lighten($c, 6%));
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge, $_button_shadow_hover);
}
background-color: $button_fill;
}

@if $t==normal-alt {
Expand Down Expand Up @@ -248,15 +244,14 @@
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
@if $variant == 'light' {
$button_fill: if($variant == 'light', lighten($c, 8%), lighten($c, 14%)) !global;
background-image: if($variant == 'light', lighten($c, 8%), lighten($c, 14%));
//@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),$_button_edge, $_button_shadow);
}
@else {
$button_fill: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%) !global;
background-image: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%);
@include _shadows(inset 0 1px $_hilight_color,
$_button_edge, $_button_shadow);
}
background-image: $button_fill;
}

@else if $t==active {
Expand All @@ -266,16 +261,14 @@
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c), darken($borders_color, 12%));
$button_fill: if($variant == 'light', image(darken($c, 8%)), image(darken($c, 8%))) !global;
background-image: $button_fill;
background-image: if($variant == 'light', image(darken($c, 8%)), image(darken($c, 8%)));
@include _shadows(inset 0 1px transparentize($_hilight_color, 1), inset 0 0 0 2px transparentize(black, 0.92), $_button_edge);

text-shadow: none;
-gtk-icon-shadow: none;

&:hover {
$button_fill: if($variant == 'light', image(darken($c, 12%)), image(darken($c, 12%))) !global;
background-image: $button_fill;
background-image: if($variant == 'light', image(darken($c, 12%)), image(darken($c, 12%)));
}
}

Expand All @@ -287,8 +280,7 @@

color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color);
border-color: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
text-shadow: none;
-gtk-icon-shadow: none;
// white with 0 alpha to avoid an ugly transition, since no color means
Expand All @@ -305,8 +297,7 @@

color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color);
border-color: $_bc;
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
// white with 0 alpha to avoid an ugly transition, since no color means
// black with 0 alpha
@include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
Expand All @@ -321,8 +312,6 @@

color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
//border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
//$button_fill: image($_bg) !global;
//background-image: $button_fill;
text-shadow: none;
-gtk-icon-shadow: none;
//@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
Expand All @@ -337,8 +326,6 @@

color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
//color: if($c != $bg_color, $_bc, $backdrop_borders_color);
//$button_fill: image($_bg) !global;
//background-image: $button_fill;
//@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}

Expand All @@ -352,8 +339,7 @@

color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
text-shadow: none;
-gtk-icon-shadow: none;
// white with 0 alpha to avoid an ugly transition, since no color means
Expand All @@ -371,8 +357,7 @@

color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}

Expand All @@ -385,8 +370,7 @@
color: $osd_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: inset 0 1px transparentize(white, 0.9);
text-shadow: 0 1px black;
Expand All @@ -403,8 +387,7 @@
color: white;
border-color: $osd_borders_color;
background-color: transparent;
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: inset 0 1px transparentize(white, 0.9);
text-shadow: 0 1px black;
Expand All @@ -421,8 +404,7 @@
color: white;
border-color: $osd_borders_color;
background-color: transparent;
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
Expand All @@ -437,8 +419,7 @@
color: $osd_insensitive_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
$button_fill: image($osd_insensitive_bg_color) !global;
background-image: $button_fill;
background-image: image($osd_insensitive_bg_color);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
Expand All @@ -454,8 +435,7 @@
color: $osd_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
$button_fill: image($_bg) !global;
background-image: $button_fill;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
Expand All @@ -468,8 +448,7 @@
//
border-color: transparent;
background-color: transparent;
$button_fill: none !global;
background-image: $button_fill;
background-image: none;

@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);

Expand Down
Loading

0 comments on commit a89497c

Please sign in to comment.