127 lines
3.6 KiB
SCSS
127 lines
3.6 KiB
SCSS
// Drawing mixins
|
|
|
|
// generic drawing of more complex things
|
|
|
|
//to allow some common mixins to know whether they've been called for a gtk3 or gtk4 widget, because there are some things that are different.
|
|
$gtk: 3;
|
|
|
|
|
|
@function _widget_edge($c:$borders_edge) {
|
|
// outer highlight "used" on most widgets
|
|
@if $c == none { @return none; }
|
|
@else { @return 0 1px $c; }
|
|
}
|
|
|
|
@mixin _shadows($list...) {
|
|
//
|
|
// Helper mixin to stack up to box-shadows;
|
|
//
|
|
$shadows: null;
|
|
|
|
@each $shadow in $list {
|
|
@if $shadow!=none { $shadows: $shadows, $shadow; }
|
|
}
|
|
|
|
box-shadow: $shadows;
|
|
}
|
|
|
|
// entries
|
|
@function entry_focus_border($fc:$selected_bg_color) {
|
|
//@if $variant == 'light' { @return $fc; }
|
|
//@else { @return if($fc==$selected_bg_color, $selected_borders_color, darken($fc, 35%)); }
|
|
@return $fc;
|
|
}
|
|
|
|
@function entry_focus_shadow($fc:$selected_bg_color) { @return inset 0 0 0 1px $fc; }
|
|
|
|
@mixin entry($t, $fc:$selected_bg_color, $edge: none) {
|
|
//
|
|
// Entries drawing function
|
|
//
|
|
// $t: entry type
|
|
// $fc: focus color
|
|
// $edge: set to none to not draw the bottom edge or specify a color to not
|
|
// use the default one
|
|
//
|
|
// possible $t values:
|
|
// normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop;
|
|
//
|
|
|
|
$entry_focus_inner_bs: inset 0 -8px 4px -6px $fc;
|
|
$entry_hover_inner_bs: inset 0 -8px 4px -6px transparentize($fc, 0.5);
|
|
$entry_normal_inner_bs: inset 0 -8px 4px -6px transparentize($fc, 1);
|
|
|
|
$_entry_shadow: 0 1px 2px transparentize($shadow_hard_color, 0.6);
|
|
$_blank_edge: if($edge == none, none, 0 1px transparentize($edge, 1));
|
|
$_entry_edge: if($edge == none, none, _widget_edge($edge));
|
|
$_hilight_color: _button_hilight_color($bg_color);
|
|
|
|
@if $t==normal {
|
|
color: $text_color;
|
|
border-color: mix($text_color,$base_color, 20%);//$borders_color;
|
|
background-color: $base_color;
|
|
@include _shadows($button_shadow_pressed, $entry_normal_inner_bs);
|
|
// for the transition to work the number of shadows in different states needs to match, hence the transparent shadow here.
|
|
}
|
|
@if t==hover { //gtk apparently does not create :hover on entries!?!
|
|
border-color: gtkalpha($fc, 0.5);
|
|
@include _shadows($button_shadow_pressed, $entry_hover_inner_bs);
|
|
}
|
|
@if $t==focus or $t==osd-focus {
|
|
@include _shadows($button_shadow_pressed, $entry_focus_inner_bs);
|
|
//border-color: entry_focus_border($fc);
|
|
}
|
|
@if $t==insensitive {
|
|
color: $insensitive_fg_color;
|
|
border-color: mix($insensitive_fg_color, $insensitive_bg_color, 50%);
|
|
background-color: $insensitive_bg_color;
|
|
}
|
|
|
|
@if $t==osd {
|
|
border-color: mix($osd_text_color,$osd_bg_color, 20%);//$borders_color;
|
|
color: $osd_text_color;
|
|
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
|
|
background-clip: padding-box;
|
|
-gtk-icon-shadow: 0 1px black;
|
|
}
|
|
// @if $t==osd-focus {
|
|
// @include _shadows(inset shadow(normal), inset shadow(glow, $osd_text_color));
|
|
// }
|
|
@if $t==osd-insensitive {
|
|
color: $osd_insensitive_fg_color;
|
|
border-color: mix($osd_borders_color, $osd_insensitive_bg_color);
|
|
background-color: $osd_insensitive_bg_color;
|
|
background-clip: padding-box;
|
|
}
|
|
@if $t==osd-backdrop {
|
|
color: $osd_text_color;
|
|
border-color: $osd_borders_color;
|
|
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
|
|
background-clip: padding-box;
|
|
//box-shadow: none;
|
|
text-shadow: none;
|
|
-gtk-icon-shadow: none;
|
|
}
|
|
}
|
|
|
|
// buttons
|
|
|
|
|
|
|
|
@import "../common/buttons.scss";
|
|
|
|
|
|
|
|
|
|
|
|
@import '../common/overshoot.scss';
|
|
|
|
|
|
/***************************
|
|
* Check and Radio buttons *
|
|
***************************/
|
|
|
|
|
|
|
|
|