2014-06-13 14:32:44 +00:00
|
|
|
// Drawing mixins
|
|
|
|
|
|
|
|
// generic drawing of more complex things
|
|
|
|
|
2014-09-03 12:27:07 +00:00
|
|
|
@function _widget_edge($c:$borders_edge) {
|
2014-09-03 17:41:50 +00:00
|
|
|
// outer highlight "used" on most widgets
|
2016-02-17 13:35:47 +00:00
|
|
|
@if $c == none { @return none; }
|
|
|
|
@else { @return 0 1px $c; }
|
2014-09-02 18:35:28 +00:00
|
|
|
}
|
2014-06-13 14:32:44 +00:00
|
|
|
|
2016-04-18 23:18:34 +00:00
|
|
|
@mixin _shadows($list...) {
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
2016-04-18 23:18:34 +00:00
|
|
|
// Helper mixin to stack up to box-shadows;
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
2016-04-19 19:24:37 +00:00
|
|
|
$shadows: null;
|
2016-04-18 23:18:34 +00:00
|
|
|
|
|
|
|
@each $shadow in $list {
|
|
|
|
@if $shadow!=none { $shadows: $shadows, $shadow; }
|
|
|
|
}
|
|
|
|
|
|
|
|
box-shadow: $shadows;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// entries
|
2015-04-22 12:42:58 +00:00
|
|
|
@function entry_focus_border($fc:$selected_bg_color) {
|
2014-10-04 18:23:10 +00:00
|
|
|
@if $variant == 'light' { @return $fc; }
|
2015-12-04 17:42:56 +00:00
|
|
|
@else { @return if($fc==$selected_bg_color, $selected_borders_color, darken($fc, 35%)); }
|
2014-10-04 18:23:10 +00:00
|
|
|
}
|
|
|
|
|
2016-04-18 23:18:34 +00:00
|
|
|
@function entry_focus_shadow($fc:$selected_bg_color) { @return inset 0 0 0 1px $fc; }
|
2014-10-04 18:23:10 +00:00
|
|
|
|
2016-02-17 13:35:47 +00:00
|
|
|
@mixin entry($t, $fc:$selected_bg_color, $edge: none) {
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
|
|
|
// Entries drawing function
|
|
|
|
//
|
|
|
|
// $t: entry type
|
2014-07-03 10:29:25 +00:00
|
|
|
// $fc: focus color
|
2014-09-03 11:18:39 +00:00
|
|
|
// $edge: set to none to not draw the bottom edge or specify a color to not
|
|
|
|
// use the default one
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
|
|
|
// possible $t values:
|
2014-10-29 17:10:39 +00:00
|
|
|
// normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop;
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
2015-04-20 16:36:10 +00:00
|
|
|
|
2015-12-04 17:42:56 +00:00
|
|
|
$_blank_edge: if($edge == none, none, 0 1px transparentize($edge, 1));
|
2014-09-03 12:27:07 +00:00
|
|
|
$_entry_edge: if($edge == none, none, _widget_edge($edge));
|
2014-08-21 12:41:29 +00:00
|
|
|
|
2014-06-13 14:32:44 +00:00
|
|
|
@if $t==normal {
|
2014-10-18 14:57:39 +00:00
|
|
|
color: $text_color;
|
2014-06-13 14:32:44 +00:00
|
|
|
border-color: $borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: $base_color;
|
2015-12-04 17:42:56 +00:00
|
|
|
@include _shadows(entry_focus_shadow(transparentize($fc, 1)), $_entry_edge);
|
2015-04-20 16:36:10 +00:00
|
|
|
// for the transition to work the number of shadows in different states needs to match, hence the transparent shadow here.
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@if $t==focus {
|
2015-04-20 16:36:10 +00:00
|
|
|
@include _shadows(entry_focus_shadow($fc), $_entry_edge);
|
2014-10-04 18:23:10 +00:00
|
|
|
border-color: entry_focus_border($fc);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@if $t==insensitive {
|
|
|
|
color: $insensitive_fg_color;
|
|
|
|
border-color: $borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: $insensitive_bg_color;
|
2015-04-20 16:36:10 +00:00
|
|
|
box-shadow: $_entry_edge;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@if $t==backdrop {
|
2014-10-18 14:57:39 +00:00
|
|
|
color: $backdrop_text_color;
|
2014-07-19 09:11:44 +00:00
|
|
|
border-color: $backdrop_borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: $backdrop_base_color;
|
2015-04-20 16:36:10 +00:00
|
|
|
box-shadow: $_blank_edge;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@if $t==backdrop-insensitive {
|
|
|
|
color: $backdrop_insensitive_color;
|
2014-07-19 09:11:44 +00:00
|
|
|
border-color: $backdrop_borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: $insensitive_bg_color;
|
2015-04-20 16:36:10 +00:00
|
|
|
box-shadow: $_blank_edge;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
2014-10-29 17:10:39 +00:00
|
|
|
@if $t==osd {
|
|
|
|
color: $osd_text_color;
|
|
|
|
border-color: $osd_borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-10-29 17:10:39 +00:00
|
|
|
box-shadow: none;
|
|
|
|
text-shadow: 0 1px black;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 1px black;
|
2014-10-29 17:10:39 +00:00
|
|
|
}
|
|
|
|
@if $t==osd-focus {
|
|
|
|
color: $osd_text_color;
|
|
|
|
border-color: $selected_bg_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2015-04-20 16:36:10 +00:00
|
|
|
box-shadow: entry_focus_shadow($fc);
|
2014-10-29 17:10:39 +00:00
|
|
|
text-shadow: 0 1px black;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 1px black;
|
2014-10-29 17:10:39 +00:00
|
|
|
}
|
2014-10-30 10:50:27 +00:00
|
|
|
@if $t==osd-insensitive {
|
|
|
|
color: $osd_insensitive_fg_color;
|
|
|
|
border-color: $osd_borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: $osd_insensitive_bg_color;
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
|
|
|
box-shadow: none;
|
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-10-30 10:50:27 +00:00
|
|
|
}
|
2014-10-29 17:10:39 +00:00
|
|
|
@if $t==osd-backdrop {
|
|
|
|
color: $osd_text_color;
|
|
|
|
border-color: $osd_borders_color;
|
2016-04-16 11:35:48 +00:00
|
|
|
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-10-29 17:10:39 +00:00
|
|
|
box-shadow: none;
|
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-10-29 17:10:39 +00:00
|
|
|
}
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// buttons
|
|
|
|
|
2016-04-17 13:06:13 +00:00
|
|
|
@function _border_color($c, $darker: false) {
|
|
|
|
@if $darker == true { @return darken($c, 30%); }
|
|
|
|
@else { @return darken($c, 20%); }
|
|
|
|
}
|
2014-06-13 14:32:44 +00:00
|
|
|
|
2015-12-04 17:42:56 +00:00
|
|
|
@function _text_shadow_color ($tc: $fg_color, $bg: $bg_color) {
|
2014-07-22 17:50:15 +00:00
|
|
|
//
|
|
|
|
// calculate the color of text shadows
|
|
|
|
//
|
|
|
|
// $tc is the text color
|
|
|
|
// $bg is the background color
|
|
|
|
//
|
|
|
|
$_lbg: lightness($bg)/100%;
|
2015-12-04 17:42:56 +00:00
|
|
|
@if lightness($tc)<50% { @return transparentize(white, 1-$_lbg/($_lbg*1.3)); }
|
|
|
|
@else { @return transparentize(black, $_lbg*0.8); }
|
2014-07-22 17:50:15 +00:00
|
|
|
}
|
|
|
|
|
2014-09-03 18:40:43 +00:00
|
|
|
@function _button_hilight_color($c) {
|
|
|
|
//
|
|
|
|
// calculate the right top hilight color for buttons
|
|
|
|
//
|
|
|
|
// $c: base color;
|
|
|
|
//
|
2015-12-05 16:52:37 +00:00
|
|
|
@if lightness($c)>95% { @return white; }
|
|
|
|
@else if lightness($c)>90% { @return transparentize(white, 0.2); }
|
|
|
|
@else if lightness($c)>80% { @return transparentize(white, 0.4); }
|
|
|
|
@else if lightness($c)>50% { @return transparentize(white, 0.6); }
|
|
|
|
@else if lightness($c)>40% { @return transparentize(white, 0.8); }
|
|
|
|
@else { @return transparentize(white, 0.95); }
|
2014-09-03 18:40:43 +00:00
|
|
|
}
|
|
|
|
|
2014-06-13 14:32:44 +00:00
|
|
|
@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
|
|
|
|
//
|
|
|
|
|
2014-07-22 17:50:15 +00:00
|
|
|
$_shadow: _text_shadow_color($tc, $bg);
|
2014-06-13 14:32:44 +00:00
|
|
|
|
2014-07-22 17:50:15 +00:00
|
|
|
@if lightness($tc)<50% {
|
|
|
|
text-shadow: 0 1px $_shadow;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 1px $_shadow;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else {
|
2014-07-22 17:50:15 +00:00
|
|
|
text-shadow: 0 -1px $_shadow;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 -1px $_shadow;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-17 13:35:47 +00:00
|
|
|
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: none) {
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
|
|
|
// Button drawing function
|
|
|
|
//
|
2014-09-03 12:22:10 +00:00
|
|
|
// $t: button type,
|
|
|
|
// $c: base button color for colored* types
|
|
|
|
// $tc: optional text color for colored* types
|
|
|
|
// $edge: set to none to not draw the bottom edge or specify a color to not
|
|
|
|
// use the default one
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
|
|
|
// possible $t values:
|
|
|
|
// normal, hover, active, insensitive, insensitive-active,
|
2014-07-08 16:24:28 +00:00
|
|
|
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
|
2014-08-22 10:55:30 +00:00
|
|
|
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
|
|
|
|
2014-09-03 18:40:43 +00:00
|
|
|
$_hilight_color: _button_hilight_color($c);
|
2014-09-03 12:27:07 +00:00
|
|
|
$_button_edge: if($edge == none, none, _widget_edge($edge));
|
|
|
|
$_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
|
2014-09-03 12:22:10 +00:00
|
|
|
|
2014-06-13 14:32:44 +00:00
|
|
|
@if $t==normal {
|
|
|
|
//
|
|
|
|
// normal button
|
|
|
|
//
|
|
|
|
color: $tc;
|
2014-09-04 13:03:09 +00:00
|
|
|
outline-color: transparentize($tc, 0.7);
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
|
|
|
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
2015-12-05 16:52:37 +00:00
|
|
|
@if $variant == 'light' { background-image: linear-gradient(to bottom, $c, darken($c, 4%) 60%, darken($c, 10%)); }
|
|
|
|
@else { background-image: linear-gradient(to bottom, darken($c, 2%), darken($c, 4%) 60%, darken($c, 6%)); }
|
|
|
|
@include _button_text_shadow($tc, $c);
|
2014-09-03 18:40:43 +00:00
|
|
|
@include _shadows(inset 0 1px $_hilight_color, $_button_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==hover {
|
|
|
|
//
|
|
|
|
// hovered button
|
|
|
|
//
|
|
|
|
color: $tc;
|
2014-09-04 13:03:09 +00:00
|
|
|
outline-color: transparentize($tc, 0.7);
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
|
|
|
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
2015-12-05 16:52:37 +00:00
|
|
|
@if $variant == 'light' {
|
|
|
|
background-image: linear-gradient(to bottom, lighten($c, 6%), $c 60%, darken($c, 4%));
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _button_text_shadow($tc, lighten($c, 6%));
|
2015-12-05 16:52:37 +00:00
|
|
|
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge);
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
background-image: linear-gradient(to bottom, lighten($c, 1%), darken($c, 2%) 60%, darken($c, 4%));
|
|
|
|
@include _button_text_shadow($tc,lighten($c, 6%));
|
|
|
|
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge);
|
|
|
|
}
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
2016-02-17 14:18:59 +00:00
|
|
|
@if $t==normal-alt {
|
|
|
|
//
|
|
|
|
// normal button alternative look
|
|
|
|
//
|
|
|
|
color: $tc;
|
|
|
|
outline-color: transparentize($tc, 0.7);
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
2016-02-19 17:03:38 +00:00
|
|
|
@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%)),
|
|
|
|
inset 0 -2px lighten($c, 2%),
|
|
|
|
inset 0 -1px darken($c, 12%),
|
|
|
|
$_button_edge);
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
background-image: linear-gradient(to bottom, darken($c, 3%) 20%, darken($c, 6%) 90%);
|
|
|
|
@include _shadows(inset 0 1px $_hilight_color,
|
|
|
|
inset 0 -2px darken($c, 4%),
|
|
|
|
inset 0 -1px darken($c, 9%),
|
|
|
|
$_button_edge);
|
|
|
|
}
|
2016-02-17 14:18:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==hover-alt {
|
|
|
|
//
|
|
|
|
// hovered button alternative look
|
|
|
|
//
|
|
|
|
color: $tc;
|
|
|
|
outline-color: transparentize($tc, 0.7);
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
2016-02-17 14:18:59 +00:00
|
|
|
@if $variant == 'light' {
|
2016-02-19 17:03:38 +00:00
|
|
|
background-image: linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%);
|
|
|
|
box-shadow: inset 0 1px _button_hilight_color(lighten($c, 6%)),
|
|
|
|
inset 0 -2px lighten($c, 5%),
|
|
|
|
inset 0 -1px darken($c, 10%),
|
|
|
|
$_button_edge;
|
2016-02-17 14:18:59 +00:00
|
|
|
}
|
|
|
|
@else {
|
2016-02-19 17:03:38 +00:00
|
|
|
background-image: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%);
|
|
|
|
@include _shadows(inset 0 1px $_hilight_color,
|
|
|
|
inset 0 -2px darken($c, 3%),
|
2016-02-17 14:18:59 +00:00
|
|
|
inset 0 -1px darken($c, 6%),
|
|
|
|
$_button_edge);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-13 14:32:44 +00:00
|
|
|
@else if $t==active {
|
|
|
|
//
|
|
|
|
// pushed button
|
|
|
|
//
|
|
|
|
color: $tc;
|
2014-09-04 13:03:09 +00:00
|
|
|
outline-color: transparentize($tc, 0.7);
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
2016-04-19 19:58:24 +00:00
|
|
|
background-image: none;
|
2016-04-21 14:43:35 +00:00
|
|
|
background-color: if($variant == 'light', darken($c, 8%), darken($c, 6%));
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize($_hilight_color, 1), $_button_edge);
|
2016-04-17 16:39:07 +00:00
|
|
|
|
2016-04-17 13:21:31 +00:00
|
|
|
text-shadow: none;
|
|
|
|
-gtk-icon-shadow: none;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else if $t==insensitive {
|
|
|
|
//
|
|
|
|
// insensitive button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, mix($c, $base_color, 85%), $insensitive_bg_color);
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: $_bg;
|
|
|
|
background-image: none;
|
2014-06-13 14:32:44 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-07-10 09:55:51 +00:00
|
|
|
// white with 0 alpha to avoid an ugly transition, since no color means
|
|
|
|
// black with 0 alpha
|
2015-12-04 17:42:56 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else if $t==insensitive-active {
|
|
|
|
//
|
|
|
|
// insensitive pushed button
|
|
|
|
//
|
2016-04-21 14:43:35 +00:00
|
|
|
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 6%));
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bc: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label, & { color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2014-07-28 10:42:23 +00:00
|
|
|
border-color: $_bc;
|
2016-04-21 14:43:35 +00:00
|
|
|
background-color: $_bg;
|
|
|
|
background-image: none;
|
2014-07-10 09:55:51 +00:00
|
|
|
// white with 0 alpha to avoid an ugly transition, since no color means
|
|
|
|
// black with 0 alpha
|
2015-12-04 17:42:56 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop {
|
|
|
|
//
|
|
|
|
// backdrop button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, $c, $backdrop_bg_color);
|
|
|
|
$_bc: if($variant == 'light', $c, _border_color($c));
|
2014-07-28 10:42:23 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
|
2016-04-19 21:00:54 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($_bg);
|
2014-06-13 14:32:44 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-active {
|
|
|
|
//
|
2016-04-21 15:01:45 +00:00
|
|
|
// backdrop pushed button
|
2014-06-13 14:32:44 +00:00
|
|
|
//
|
2016-04-21 15:01:45 +00:00
|
|
|
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
|
|
|
|
$_bc: if($variant == 'light', $_bg ,_border_color($c));
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: $_bg;
|
|
|
|
background-image: none;
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-insensitive {
|
|
|
|
//
|
|
|
|
// backdrop insensitive button
|
|
|
|
//
|
2014-07-28 10:42:23 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, mix($c, $base_color, 85%), $insensitive_bg_color);
|
|
|
|
$_bc: if($variant == 'light', $_bg,_border_color($c));
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label, & { color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: $_bg;
|
|
|
|
background-image: none;
|
2014-07-28 10:42:23 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-07-28 10:42:23 +00:00
|
|
|
// white with 0 alpha to avoid an ugly transition, since no color means
|
|
|
|
// black with 0 alpha
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-insensitive-active {
|
|
|
|
//
|
|
|
|
// backdrop insensitive pushed button
|
|
|
|
//
|
2014-10-04 18:23:10 +00:00
|
|
|
|
2016-04-21 15:01:45 +00:00
|
|
|
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bc: if($variant == 'light', $_bg, _border_color($c));
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
label { color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color); }
|
2016-03-19 17:55:13 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: $_bg;
|
|
|
|
background-image: none;
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
2014-07-19 08:50:01 +00:00
|
|
|
|
2014-06-13 14:32:44 +00:00
|
|
|
@else if $t==osd {
|
|
|
|
//
|
|
|
|
// normal osd button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, transparentize($c, 0.5), $osd_bg_color);
|
2014-09-04 13:03:09 +00:00
|
|
|
|
|
|
|
color: $osd_fg_color;
|
2014-06-13 14:32:44 +00:00
|
|
|
border-color: $osd_borders_color;
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($_bg);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-10-29 17:10:39 +00:00
|
|
|
box-shadow: inset 0 1px transparentize(white, 0.9);
|
2014-08-22 10:55:30 +00:00
|
|
|
text-shadow: 0 1px black;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 1px black;
|
2014-10-30 10:50:27 +00:00
|
|
|
outline-color: transparentize($osd_fg_color, 0.7);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else if $t==osd-hover {
|
|
|
|
//
|
|
|
|
// active osd button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, transparentize($c, 0.3), lighten($osd_bg_color, 12%));
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2014-08-22 10:55:30 +00:00
|
|
|
color: white;
|
2014-06-13 14:32:44 +00:00
|
|
|
border-color: $osd_borders_color;
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($_bg);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-10-29 17:10:39 +00:00
|
|
|
box-shadow: inset 0 1px transparentize(white, 0.9);
|
2014-08-26 14:54:19 +00:00
|
|
|
text-shadow: 0 1px black;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: 0 1px black;
|
2014-10-30 10:50:27 +00:00
|
|
|
outline-color: transparentize($osd_fg_color, 0.7);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else if $t==osd-active {
|
|
|
|
//
|
|
|
|
// active osd button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, $c, $osd_borders_color);
|
2014-09-04 16:59:43 +00:00
|
|
|
|
2014-08-22 10:55:30 +00:00
|
|
|
color: white;
|
2014-06-13 14:32:44 +00:00
|
|
|
border-color: $osd_borders_color;
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($_bg);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-06-13 14:32:44 +00:00
|
|
|
box-shadow: none;
|
2014-08-22 10:55:30 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-10-30 10:50:27 +00:00
|
|
|
outline-color: transparentize($osd_fg_color, 0.7);
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
@else if $t==osd-insensitive {
|
|
|
|
//
|
|
|
|
// insensitive osd button
|
|
|
|
//
|
2014-10-29 17:10:39 +00:00
|
|
|
color: $osd_insensitive_fg_color;
|
2014-08-22 10:55:30 +00:00
|
|
|
border-color: $osd_borders_color;
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($osd_insensitive_bg_color);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-08-22 10:55:30 +00:00
|
|
|
box-shadow: none;
|
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-08-22 10:55:30 +00:00
|
|
|
}
|
|
|
|
@else if $t==osd-backdrop {
|
|
|
|
//
|
|
|
|
// backdrop osd button
|
|
|
|
//
|
2016-04-21 14:51:24 +00:00
|
|
|
$_bg: if($c != $bg_color, transparentize($c, 0.5), $osd_bg_color);
|
2014-09-04 16:59:43 +00:00
|
|
|
|
|
|
|
color: $osd_fg_color;
|
2014-10-29 17:10:39 +00:00
|
|
|
border-color: $osd_borders_color;
|
2016-04-19 19:58:24 +00:00
|
|
|
background-color: transparent;
|
|
|
|
background-image: image($_bg);
|
2014-10-30 10:50:27 +00:00
|
|
|
background-clip: padding-box;
|
2014-08-22 10:55:30 +00:00
|
|
|
box-shadow: none;
|
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
2014-07-08 16:24:28 +00:00
|
|
|
@else if $t==undecorated {
|
2014-07-10 10:22:41 +00:00
|
|
|
//
|
|
|
|
// reset
|
|
|
|
//
|
2014-07-08 16:24:28 +00:00
|
|
|
border-color: transparent;
|
|
|
|
background-color: transparent;
|
|
|
|
background-image: none;
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2016-04-21 14:51:24 +00:00
|
|
|
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
|
2014-09-04 13:03:09 +00:00
|
|
|
|
2014-07-08 16:24:28 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:30:54 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-07-19 08:50:01 +00:00
|
|
|
}
|
2014-06-13 14:32:44 +00:00
|
|
|
}
|
|
|
|
|
2016-05-05 16:36:03 +00:00
|
|
|
@mixin headerbar_fill($c:$headerbar_color, $hc:$top_hilight, $ov: none) {
|
2014-09-03 17:41:50 +00:00
|
|
|
//
|
|
|
|
// headerbar fill
|
|
|
|
//
|
|
|
|
// $c: base color
|
|
|
|
// $hc: top highlight color
|
2016-05-05 16:36:03 +00:00
|
|
|
// $ov: a background layer for background shorthand (hence no commas!)
|
2014-10-04 18:23:10 +00:00
|
|
|
//
|
2016-05-05 16:36:03 +00:00
|
|
|
$gradient: linear-gradient(to top, darken($c, 13%), darken($c, 2%) 2px, $c 3px);
|
2014-11-04 13:59:24 +00:00
|
|
|
|
2016-05-05 16:36:03 +00:00
|
|
|
@if $variant == 'dark' { $gradient: linear-gradient(to top, darken($c, 3%), darken($c, 1%) 2px, $c 3px); }
|
|
|
|
|
|
|
|
@if $ov != none { background: $c $ov, $gradient; }
|
|
|
|
@else { background: $c $gradient; }
|
2014-09-02 13:21:42 +00:00
|
|
|
|
2016-03-19 16:23:39 +00:00
|
|
|
box-shadow: inset 0 1px $hc; // top highlight
|
2014-09-01 15:31:36 +00:00
|
|
|
}
|
2014-11-13 17:31:18 +00:00
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
@mixin overshoot($p, $t:normal, $c:$fg_color) {
|
2014-11-13 17:31:18 +00:00
|
|
|
//
|
|
|
|
// overshoot
|
|
|
|
//
|
|
|
|
// $p: position
|
|
|
|
// $t: type
|
|
|
|
// $c: base color
|
|
|
|
//
|
|
|
|
// possible $p values:
|
|
|
|
// top, bottom, right, left
|
|
|
|
//
|
|
|
|
// possible $t values:
|
|
|
|
// normal, backdrop
|
|
|
|
//
|
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient_length: 5%;
|
2014-11-14 17:58:22 +00:00
|
|
|
$_big_gradient_length: 100%;
|
2014-11-13 17:31:18 +00:00
|
|
|
|
|
|
|
$_position: center top;
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient_size: 100% $_small_gradient_length;
|
|
|
|
$_big_gradient_size: 100% $_big_gradient_length;
|
2014-11-13 17:31:18 +00:00
|
|
|
|
|
|
|
@if $p==bottom {
|
|
|
|
$_position: center bottom;
|
2014-12-17 18:42:11 +00:00
|
|
|
$_linear_gradient_direction: to top;
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $p==right {
|
|
|
|
$_position: right center;
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient_size: $_small_gradient_length 100%;
|
|
|
|
$_big_gradient_size: $_big_gradient_length 100%;
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $p==left {
|
|
|
|
$_position: left center;
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient_size: $_small_gradient_length 100%;
|
|
|
|
$_big_gradient_size: $_big_gradient_length 100%;
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
2014-12-17 18:42:11 +00:00
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient_color: $c;
|
|
|
|
$_big_gradient_color: $c;
|
2014-11-13 17:31:18 +00:00
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
@if $c==$fg_color {
|
|
|
|
$_small_gradient_color: darken($borders_color, 10%);
|
|
|
|
$_big_gradient_color: $fg_color;
|
|
|
|
|
2014-11-14 17:58:22 +00:00
|
|
|
@if $t==backdrop { $_small_gradient_color: $backdrop_borders_color; }
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
$_small_gradient: -gtk-gradient(radial,
|
2014-11-13 17:31:18 +00:00
|
|
|
$_position, 0,
|
|
|
|
$_position, 0.5,
|
2014-11-14 14:37:02 +00:00
|
|
|
to($_small_gradient_color),
|
|
|
|
to(transparentize($_small_gradient_color, 1)));
|
2014-11-13 17:31:18 +00:00
|
|
|
|
2014-11-14 14:37:02 +00:00
|
|
|
$_big_gradient: -gtk-gradient(radial,
|
|
|
|
$_position, 0,
|
|
|
|
$_position, 0.6,
|
2014-11-14 17:58:22 +00:00
|
|
|
from(transparentize($_big_gradient_color, 0.93)),
|
2014-11-14 14:37:02 +00:00
|
|
|
to(transparentize($_big_gradient_color, 1)));
|
2014-11-13 17:31:18 +00:00
|
|
|
|
|
|
|
@if $t==normal {
|
2014-11-14 14:37:02 +00:00
|
|
|
background-image: $_small_gradient, $_big_gradient;
|
|
|
|
background-size: $_small_gradient_size, $_big_gradient_size;
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop {
|
2014-11-14 14:37:02 +00:00
|
|
|
background-image: $_small_gradient;
|
|
|
|
background-size: $_small_gradient_size;
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: $_position;
|
2014-11-13 17:47:42 +00:00
|
|
|
|
|
|
|
background-color: transparent; // reset some properties to be sure to not inherit them somehow
|
|
|
|
border: none; //
|
|
|
|
box-shadow: none; //
|
2014-11-13 17:31:18 +00:00
|
|
|
}
|
2014-12-17 18:42:11 +00:00
|
|
|
|
|
|
|
@mixin undershoot($p) {
|
|
|
|
//
|
|
|
|
// undershoot
|
|
|
|
//
|
|
|
|
// $p: position
|
|
|
|
//
|
|
|
|
// possible $p values:
|
|
|
|
// top, bottom, right, left
|
|
|
|
//
|
|
|
|
|
2015-01-29 09:49:59 +00:00
|
|
|
$_undershoot_color_dark: transparentize(black, 0.8);
|
|
|
|
$_undershoot_color_light: transparentize(white, 0.8);
|
2015-01-28 16:11:34 +00:00
|
|
|
|
2015-01-28 19:05:03 +00:00
|
|
|
$_gradient_dir: left;
|
|
|
|
$_dash_bg_size: 10px 1px;
|
2015-01-28 16:11:34 +00:00
|
|
|
$_gradient_repeat: repeat-x;
|
2015-01-28 19:05:03 +00:00
|
|
|
$_bg_pos: center $p;
|
2014-12-17 18:42:11 +00:00
|
|
|
|
|
|
|
background-color: transparent; // shouldn't be needed, but better to be sure;
|
|
|
|
|
2015-01-28 19:05:03 +00:00
|
|
|
@if ($p == left) or ($p == right) {
|
|
|
|
$_gradient_dir: top;
|
|
|
|
$_dash_bg_size: 1px 10px;
|
2015-01-28 16:11:34 +00:00
|
|
|
$_gradient_repeat: repeat-y;
|
2015-01-28 19:05:03 +00:00
|
|
|
$_bg_pos: $p center;
|
2014-12-17 18:42:11 +00:00
|
|
|
}
|
|
|
|
|
2015-01-29 09:49:59 +00:00
|
|
|
background-image: linear-gradient(to $_gradient_dir, // this is the dashed line
|
|
|
|
$_undershoot_color_light 50%,
|
|
|
|
$_undershoot_color_dark 50%);
|
2015-01-28 16:11:34 +00:00
|
|
|
|
2015-01-28 19:05:03 +00:00
|
|
|
padding-#{$p}: 1px;
|
2015-01-29 09:49:59 +00:00
|
|
|
background-size: $_dash_bg_size;
|
2015-01-28 19:05:03 +00:00
|
|
|
background-repeat: $_gradient_repeat;
|
2015-01-29 09:49:59 +00:00
|
|
|
background-origin: content-box;
|
2015-01-28 19:05:03 +00:00
|
|
|
background-position: $_bg_pos;
|
2015-11-04 12:30:19 +00:00
|
|
|
border: none;
|
|
|
|
box-shadow: none;
|
2014-12-17 18:42:11 +00:00
|
|
|
}
|