2014-10-30 15:14:37 +00:00
|
|
|
// Drawing mixins
|
|
|
|
|
|
|
|
// generic drawing of more complex things
|
2015-04-27 22:33:17 +00:00
|
|
|
@function _widget_edge($c:$borders_edge) {
|
|
|
|
// outer highlight "used" on most widgets
|
|
|
|
@return 0 1px $c;
|
|
|
|
}
|
2014-10-30 15:14:37 +00:00
|
|
|
|
|
|
|
@mixin _shadows($shadow1, $shadow2:none, $shadow3:none, $shadow4:none) {
|
|
|
|
//
|
|
|
|
// Helper function to stack up to 4 box-shadows;
|
|
|
|
//
|
|
|
|
@if $shadow4!=none { box-shadow: $shadow1, $shadow2, $shadow3, $shadow4; }
|
|
|
|
@else if $shadow3!=none { box-shadow: $shadow1, $shadow2, $shadow3; }
|
|
|
|
@else if $shadow2!=none { box-shadow: $shadow1, $shadow2; }
|
|
|
|
@else { box-shadow: $shadow1; }
|
|
|
|
}
|
|
|
|
|
|
|
|
// entries
|
|
|
|
|
2014-12-01 18:06:02 +00:00
|
|
|
@function entry_focus_border($fc) {
|
|
|
|
@return $fc;
|
|
|
|
}
|
|
|
|
|
|
|
|
@function entry_focus_glow($fc) {
|
|
|
|
$_focus_glow_color: transparentize($fc,0.85);
|
|
|
|
@return inset 0 0 0 1px $_focus_glow_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
@function entry_gradient($c) {
|
|
|
|
@return linear-gradient(to bottom, darken($c,3%), $c 90%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin entry($t, $fc:$selected_bg_color, $edge: $borders_edge) {
|
2014-10-30 15:14:37 +00:00
|
|
|
//
|
|
|
|
// Entries drawing function
|
|
|
|
//
|
|
|
|
// $t: entry type
|
|
|
|
// $fc: focus color
|
2014-12-01 18:06:02 +00:00
|
|
|
// $edge:none set to true not to draw the bottom edge hilight
|
2014-10-30 15:14:37 +00:00
|
|
|
//
|
|
|
|
// possible $t values:
|
|
|
|
// normal, focus, insensitive, backdrop, backdrop-insensitive;
|
|
|
|
//
|
|
|
|
background-color: transparent;
|
|
|
|
border-style: solid;
|
|
|
|
background-image: linear-gradient(to bottom,
|
|
|
|
darken($base_color,3%),
|
|
|
|
$base_color 90%);
|
2014-12-01 18:06:02 +00:00
|
|
|
$_entry_edge: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
|
|
|
|
@if $t==normal {
|
|
|
|
border-color: $borders_color;
|
|
|
|
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
|
|
|
|
$_entry_edge);
|
|
|
|
}
|
|
|
|
@if $t==focus {
|
|
|
|
border-color: $fc;
|
|
|
|
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
|
|
|
|
inset 0 0 2px 1px mix($fc,$base_color,20%),
|
|
|
|
$_entry_edge);
|
|
|
|
}
|
|
|
|
@if $t==insensitive {
|
|
|
|
color: $insensitive_fg_color;
|
|
|
|
border-color: $borders_color;
|
|
|
|
background-image: linear-gradient(to bottom, $insensitive_bg_color);
|
|
|
|
@include _shadows($_entry_edge);
|
|
|
|
}
|
|
|
|
@if $t==backdrop {
|
|
|
|
color: $backdrop_fg_color;
|
|
|
|
background-image: linear-gradient(to bottom, $backdrop_base_color);
|
|
|
|
box-shadow: 0 1px transparentize(white,1);
|
|
|
|
}
|
|
|
|
@if $t==backdrop-insensitive {
|
2015-03-20 12:22:47 +00:00
|
|
|
color: $insensitive_fg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
background-image: linear-gradient(to bottom, $backdrop_bg_color);
|
|
|
|
box-shadow: 0 1px transparentize(white,1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// buttons
|
|
|
|
|
|
|
|
@mixin _button_border_color ($c) { border-color: darken($c,25%); } // colored buttons want the border form the base color
|
|
|
|
|
|
|
|
@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
|
|
|
|
//
|
|
|
|
|
|
|
|
$_dark: black;
|
|
|
|
$_bright: white;
|
|
|
|
|
|
|
|
@if lightness($tc) < 50% {
|
|
|
|
text-shadow: 0 1px $_bright;
|
2015-11-21 01:32:42 +00:00
|
|
|
-gtk-icon-shadow: 0 1px $_bright;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
@else {
|
|
|
|
text-shadow: 0 -1px $_dark;
|
2015-11-21 01:32:42 +00:00
|
|
|
-gtk-icon-shadow: 0 -1px $_dark;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-01 18:06:02 +00:00
|
|
|
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_color) {
|
2014-10-30 15:14:37 +00:00
|
|
|
//
|
|
|
|
// Button drawing function
|
|
|
|
//
|
|
|
|
// $t: button type,
|
|
|
|
// $c: base button color for colored* types
|
|
|
|
// $tc: optional text color for colored* types
|
2014-12-01 18:06:02 +00:00
|
|
|
// $noedge:none set to true not to draw the bottom edge hilight
|
2014-10-30 15:14:37 +00:00
|
|
|
//
|
|
|
|
// possible $t values:
|
|
|
|
// normal, hover, active, insensitive, insensitive-active,
|
|
|
|
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active
|
|
|
|
//
|
|
|
|
border-width: 2px;
|
|
|
|
border-style: solid;
|
|
|
|
|
|
|
|
$_top_hilight: if(lightness($c)> 70%, white, transparentize(white,0.9)); //not just dark/light but colored buttons
|
|
|
|
|
|
|
|
@if $t==normal {
|
|
|
|
//
|
|
|
|
// normal button
|
|
|
|
//
|
|
|
|
color: $tc;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
|
|
|
background-color: $c;
|
2014-10-30 15:14:37 +00:00
|
|
|
|
|
|
|
@if $c!=$bg_color { @include _button_border_color($c); }
|
|
|
|
@else { border-color: $borders_color; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==hover {
|
|
|
|
//
|
|
|
|
// hovered button
|
|
|
|
//
|
2015-03-17 14:46:22 +00:00
|
|
|
color: $tc; //fg_color
|
|
|
|
background-color: $c;
|
2014-10-30 15:14:37 +00:00
|
|
|
@if $c!=$bg_color { @include _button_border_color($c); }
|
|
|
|
@else { border-color: $borders_color; }
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==active {
|
|
|
|
//
|
|
|
|
// pushed button
|
|
|
|
//
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
|
|
|
color: invert($tc);
|
|
|
|
background-color: invert($c);
|
2014-10-30 15:14:37 +00:00
|
|
|
@if $c!=$bg_color { @include _button_border_color($c); }
|
|
|
|
@else { border-color: $borders_color; }
|
|
|
|
}
|
|
|
|
@else if $t==insensitive {
|
|
|
|
//
|
|
|
|
// insensitive button
|
|
|
|
//
|
|
|
|
color: $insensitive_fg_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-color: $insensitive_bg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $insensitive_borders_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:32:42 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
@else if $t==insensitive-active {
|
|
|
|
//
|
|
|
|
// insensitive pushed button
|
|
|
|
//
|
|
|
|
color: $insensitive_fg_color;
|
|
|
|
border-color: $insensitive_borders_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
|
|
|
background-color: $insensitive_bg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop {
|
|
|
|
//
|
|
|
|
// backdrop button
|
|
|
|
//
|
|
|
|
color: if($c!=$bg_color, $tc, $backdrop_fg_color);
|
2015-03-17 14:46:22 +00:00
|
|
|
background-color: if($c!=$bg_color, $c, $backdrop_bg_color);
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: if($c!=$bg_color, $c, $backdrop_borders_color);
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
text-shadow: none;
|
2015-11-21 01:32:42 +00:00
|
|
|
-gtk-icon-shadow: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-active {
|
|
|
|
//
|
|
|
|
// backdrop pushed button
|
|
|
|
//
|
2015-03-20 12:22:47 +00:00
|
|
|
color: invert($backdrop_fg_color);
|
|
|
|
background-color: $backdrop_borders_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $backdrop_borders_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-insensitive {
|
|
|
|
//
|
|
|
|
// backdrop insensitive button
|
|
|
|
//
|
2015-03-20 12:22:47 +00:00
|
|
|
color: $insensitive_fg_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-color: $insensitive_bg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $backdrop_borders_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop-insensitive-active {
|
|
|
|
//
|
|
|
|
// backdrop insensitive pushed button
|
|
|
|
//
|
2015-03-20 12:22:47 +00:00
|
|
|
color: $insensitive_fg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $backdrop_borders_color;
|
2015-03-17 14:46:22 +00:00
|
|
|
background-image: none;
|
|
|
|
background-color: mix($backdrop_borders_color,$backdrop_bg_color, 8%);
|
2014-10-30 15:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==osd {
|
|
|
|
//
|
|
|
|
// normal osd button
|
|
|
|
//
|
2015-03-17 14:46:22 +00:00
|
|
|
color: $osd_fg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
background-image: none;
|
|
|
|
background-color: $osd_bg_color;
|
|
|
|
border-color: $osd_borders_color;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
@else if $t==osd-hover {
|
|
|
|
//
|
|
|
|
// active osd button
|
|
|
|
//
|
2015-03-17 14:46:22 +00:00
|
|
|
color: $osd_fg_color;
|
|
|
|
background-color: lighten($osd_bg_color,30%);
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $osd_borders_color;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
@else if $t==osd-active {
|
|
|
|
//
|
|
|
|
// active osd button
|
|
|
|
//
|
2015-03-17 14:46:22 +00:00
|
|
|
color: $osd_bg_color;
|
|
|
|
background-color: $osd_fg_color;
|
2014-10-30 15:14:37 +00:00
|
|
|
border-color: $osd_borders_color;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
@else if $t==osd-insensitive {
|
|
|
|
//
|
|
|
|
// insensitive osd button
|
|
|
|
//
|
|
|
|
border-color: $osd_borders_color;
|
|
|
|
color: $insensitive_fg_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-12-01 11:33:23 +00:00
|
|
|
@mixin overshoot($p, $t:normal, $c:$fg_color) {
|
|
|
|
//
|
|
|
|
// overshoot
|
|
|
|
//
|
|
|
|
// $p: position
|
|
|
|
// $t: type
|
|
|
|
// $c: base color
|
|
|
|
//
|
|
|
|
// possible $p values:
|
|
|
|
// top, bottom, right, left
|
|
|
|
//
|
|
|
|
// possible $t values:
|
|
|
|
// normal, backdrop
|
|
|
|
//
|
|
|
|
|
|
|
|
$_small_gradient_length: 5%;
|
|
|
|
$_big_gradient_length: 100%;
|
|
|
|
|
|
|
|
$_position: center top;
|
|
|
|
$_small_gradient_size: 100% $_small_gradient_length;
|
|
|
|
$_big_gradient_size: 100% $_big_gradient_length;
|
|
|
|
|
|
|
|
@if $p==bottom {
|
|
|
|
$_position: center bottom;
|
|
|
|
$_linear_gradient_direction: to top;
|
|
|
|
}
|
|
|
|
|
|
|
|
@else if $p==right {
|
|
|
|
$_position: right center;
|
|
|
|
$_small_gradient_size: $_small_gradient_length 100%;
|
|
|
|
$_big_gradient_size: $_big_gradient_length 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
@else if $p==left {
|
|
|
|
$_position: left center;
|
|
|
|
$_small_gradient_size: $_small_gradient_length 100%;
|
|
|
|
$_big_gradient_size: $_big_gradient_length 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
$_small_gradient_color: $c;
|
|
|
|
$_big_gradient_color: $c;
|
|
|
|
|
|
|
|
@if $c==$fg_color {
|
|
|
|
$_small_gradient_color: darken($borders_color, 50%);
|
|
|
|
$_big_gradient_color: $fg_color;
|
|
|
|
|
|
|
|
@if $t==backdrop { $_small_gradient_color: $backdrop_borders_color; }
|
|
|
|
}
|
|
|
|
|
|
|
|
$_small_gradient: -gtk-gradient(radial,
|
|
|
|
$_position, 0,
|
|
|
|
$_position, 0.5,
|
|
|
|
to($_small_gradient_color),
|
|
|
|
to(transparentize($_small_gradient_color, 1)));
|
|
|
|
|
|
|
|
$_big_gradient: -gtk-gradient(radial,
|
|
|
|
$_position, 0,
|
|
|
|
$_position, 0.6,
|
|
|
|
from(transparentize($_big_gradient_color, 0.5)),
|
|
|
|
to(transparentize($_big_gradient_color, 1)));
|
|
|
|
|
|
|
|
@if $t==normal {
|
|
|
|
background-image: $_small_gradient, $_big_gradient;
|
|
|
|
background-size: $_small_gradient_size, $_big_gradient_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
@else if $t==backdrop {
|
|
|
|
background-image: $_small_gradient;
|
|
|
|
background-size: $_small_gradient_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: $_position;
|
|
|
|
|
|
|
|
background-color: transparent; // reset some properties to be sure to not inherit them somehow
|
|
|
|
border: none; //
|
|
|
|
box-shadow: none; //
|
|
|
|
}
|
2015-08-08 20:27:29 +00:00
|
|
|
|
|
|
|
@mixin undershoot($p) {
|
|
|
|
//
|
|
|
|
// undershoot
|
|
|
|
//
|
|
|
|
// $p: position
|
|
|
|
//
|
|
|
|
// possible $p values:
|
|
|
|
// top, bottom, right, left
|
|
|
|
//
|
|
|
|
|
|
|
|
$_undershoot_color_dark: transparentize(black, 0.8);
|
|
|
|
$_undershoot_color_light: transparentize(white, 0.8);
|
|
|
|
|
|
|
|
$_gradient_dir: left;
|
|
|
|
$_dash_bg_size: 10px 1px;
|
|
|
|
$_gradient_repeat: repeat-x;
|
|
|
|
$_bg_pos: center $p;
|
|
|
|
|
|
|
|
background-color: transparent; // shouldn't be needed, but better to be sure;
|
|
|
|
|
|
|
|
@if ($p == left) or ($p == right) {
|
|
|
|
$_gradient_dir: top;
|
|
|
|
$_dash_bg_size: 1px 10px;
|
|
|
|
$_gradient_repeat: repeat-y;
|
|
|
|
$_bg_pos: $p center;
|
|
|
|
}
|
|
|
|
|
|
|
|
background-image: linear-gradient(to $_gradient_dir, // this is the dashed line
|
|
|
|
$_undershoot_color_light 50%,
|
|
|
|
$_undershoot_color_dark 50%);
|
|
|
|
|
|
|
|
padding-#{$p}: 1px;
|
|
|
|
background-size: $_dash_bg_size;
|
|
|
|
background-repeat: $_gradient_repeat;
|
|
|
|
background-origin: content-box;
|
|
|
|
background-position: $_bg_pos;
|
2015-11-04 12:36:49 +00:00
|
|
|
border: none;
|
|
|
|
box-shadow: none;
|
2015-08-08 20:27:29 +00:00
|
|
|
}
|
|
|
|
|