diff options
author | Horst3180 | 2015-07-17 14:34:04 +0200 |
---|---|---|
committer | Horst3180 | 2015-07-17 14:34:04 +0200 |
commit | 8aaf55c319f06160b14f402f012144b74baa8d01 (patch) | |
tree | 7b257c6091c615848d048fd86b6b193360f65e48 /common/gtk-3.0/3.16/sass/_drawing.scss | |
parent | 1d2d684363bfefd9fc2413ec7d8101464e727c0f (diff) | |
download | solarc-theme-8aaf55c319f06160b14f402f012144b74baa8d01.tar.gz solarc-theme-8aaf55c319f06160b14f402f012144b74baa8d01.tar.xz solarc-theme-8aaf55c319f06160b14f402f012144b74baa8d01.zip |
use libsass and update build system
Diffstat (limited to 'common/gtk-3.0/3.16/sass/_drawing.scss')
-rw-r--r-- | common/gtk-3.0/3.16/sass/_drawing.scss | 377 |
1 files changed, 377 insertions, 0 deletions
diff --git a/common/gtk-3.0/3.16/sass/_drawing.scss b/common/gtk-3.0/3.16/sass/_drawing.scss new file mode 100644 index 0000000..378e5d9 --- /dev/null +++ b/common/gtk-3.0/3.16/sass/_drawing.scss @@ -0,0 +1,377 @@ +// Drawing mixins + +// generic drawing of more complex things + +@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 + +@mixin entry($t) { +// +// Entries drawing function +// +// $t: entry type +// + + @if $t==normal { + // + // normal entry + // + color: $text_color; + border-color: $entry_border; + background-color: $entry_bg; + background-image: linear-gradient(to bottom, $entry_bg); + } + + @if $t==focus { + // + // focused entry + // + color: $text_color; + border-color: $selected_bg_color; + background-color: $entry_bg; + background-image: linear-gradient(to bottom, $entry_bg); + } + + @if $t==insensitive { + // + // insensitive entry + // + color: $insensitive_fg_color; + border-color: transparentize($entry_border, 0.45); + background-color: transparentize($entry_bg, 0.45); + background-image: linear-gradient(to bottom, transparentize($entry_bg, 0.45)); + } + + $_header_entry_bg: if($darker == 'true' or $variant == 'dark', transparentize(darken($header_bg, 4%), 0.1), transparentize($base_color, 0.1)); + $_header_entry_border: if($darker == 'true' or $variant == 'dark', darken($header_bg, 10%), transparentize($header_fg, 0.7)); + + @if $t==header-normal { + // + // normal header-bar entry + // + + color: $header_fg; + border-color: $_header_entry_border; + background-image: linear-gradient(to bottom, $_header_entry_bg); + background-color: transparent; + + &.image, &.image:hover { color: inherit; } + } + + @if $t==header-focus { + // + // focused header-bar entry + // + color: $selected_fg_color; + border-color: $selected_bg_color; + background-image: linear-gradient(to bottom, $selected_bg_color); + } + + @if $t==header-insensitive { + // + // insensitive header-bar entry + // + color: transparentize($header_fg, 0.45); + background-image: linear-gradient(to bottom, transparentize($_header_entry_bg, 0.35)); + } + + @else if $t==osd { + // + // normal osd button + // + color: $osd_fg_color; + border-color: transparentize($osd_fg_color, 0.7); + background-color: transparent; + background-image: linear-gradient(to bottom, darken($osd_bg_color, 5%)); + } + + @else if $t==osd-focus { + // + // active osd button + // + color: $selected_bg_color; + border-color: $selected_bg_color; + background-image: linear-gradient(to bottom, darken($osd_bg_color, 5%)); + } + + @else if $t==osd-insensitive { + // + // insensitive osd button + // + color: $osd_insensitive_fg_color; + border-color: transparentize($osd_fg_color, 0.8); + background-image: linear-gradient(to bottom, $osd_insensitive_bg_color); + } +} + +// Buttons + +@mixin button($t, $actionb_color:red) { +// +// Button drawing function +// +// $t: button type, +// $actionb_color: used for destructive and suggested action buttons + + @if $t==normal { + // + // normal button + // + color: $fg_color; + outline-color: transparentize($fg_color, 0.7); + border-color: $button_border; + background-color: $button_bg; + } + + @else if $t==hover { + // + // hovered button + // + color: $fg_color; + outline-color: transparentize($fg_color, 0.7); + border-color: $selected_bg_color; + background-color: $button_bg; + } + + @else if $t==active { + // + // pushed button + // + color: $selected_fg_color; + outline-color: transparentize($selected_fg_color, 0.7); + border-color: $selected_bg_color; + background-color: $selected_bg_color; + } + + @else if $t==insensitive { + // + // insensitive button + // + color: $insensitive_fg_color; + border-color: transparentize($button_border, 0.45); + background-color: transparentize($button_bg, 0.45); + + > GtkLabel { color: inherit; } + } + + @else if $t==insensitive-active { + // + // insensitive pushed button + // + color: transparentize($selected_fg_color, 0.45); + border-color: transparentize($selected_bg_color, 0.45); + background-color: transparentize($selected_bg_color, 0.45); + + opacity: 0.6; + + > GtkLabel { color: inherit; } + } + + $_header_button_bg: if($darker == 'true' or $variant == 'dark', transparentize(darken($header_bg, 3%), 0.1), transparentize($button_bg, 0.1)); + $_header_button_border: if($darker == 'true' or $variant == 'dark', darken($header_bg, 8%), transparentize($header_fg, 0.7)); + + @if $t==header-normal { + // + // normal header-bar button + // + color: $header_fg; + outline-color: transparentize($header_fg, 0.7); + outline-offset: -3px; + background-color: transparentize($header_bg, 1); + border-color: transparentize($header_bg, 1); + } + + @else if $t==header-hover { + // + // hovered header-bar button + // + color: $header_fg; + outline-color: transparentize($header_fg, 0.7); + border-color: $_header_button_border; + background-color: $_header_button_bg; + } + + @else if $t==header-active { + // + // pushed header-bar button + // + color: $selected_fg_color; + outline-color: transparentize($selected_fg_color, 0.7); + border-color: $selected_bg_color; + background-color: $selected_bg_color; + } + + @else if $t==header-insensitive { + // + // insensitive header-bar button + // + color: transparentize($header_fg, 0.45); + background-color: transparentize($header_bg, 1); + border-color: transparentize($header_bg, 1); + + > GtkLabel { color: inherit; } + } + + @else if $t==header-insensitive-active { + // + // header-bar insensitive pushed button + // + color: transparentize($selected_fg_color, 0.25); + border-color: transparentize($selected_bg_color, 0.35); + background-color: transparentize($selected_bg_color, 0.35); + } + + @else if $t==osd { + // + // normal osd button + // + color: $osd_fg_color; + outline-color: transparentize($osd_fg_color, 0.7); + border-color: transparentize($osd_fg_color, 0.7); + background-color: transparent; + background-image: linear-gradient(to bottom, darken($osd_bg_color, 5%)); + } + + @else if $t==osd-hover { + // + // active osd button + // + color: $selected_bg_color; + outline-color: transparentize($osd_fg_color, 0.7); + border-color: $selected_bg_color; + background-image: linear-gradient(to bottom, darken($osd_bg_color, 5%)); + } + + @else if $t==osd-active { + // + // active osd button + // + color: $selected_fg_color; + outline-color: transparentize($selected_fg_color, 0.7); + border-color: $selected_bg_color; + background-image: linear-gradient(to bottom, $selected_bg_color); + } + + @else if $t==osd-insensitive { + // + // insensitive osd button + // + color: $osd_insensitive_fg_color; + border-color: transparentize($osd_fg_color, 0.8); + background-image: linear-gradient(to bottom, $osd_insensitive_bg_color); + } + + @else if $t==suggested_destructive { + // + // suggested or destructive action buttons + // + background-clip: border-box; + + color: $selected_fg_color; + outline-color: transparentize($selected_fg_color, 0.7); + background-color: $actionb_color; + border-color: $actionb_color; + } + + @else if $t==undecorated { + // + // reset + // + border-color: transparent; + background-color: transparent; + background-image: none; + } +} + +// +// Overshoot +// +@mixin overshoot($p, $c:$selected_bg_color) { +// $p: position +// $c: base color +// +// possible $p values: +// top, bottom, right, left +// + + $_big_gradient_length: 60%; + + $_position: center top; + $_big_gradient_size: 100% $_big_gradient_length; + + @if $p==bottom { + $_position: center bottom; + } + + @else if $p==right { + $_position: right center; + $_big_gradient_size: $_big_gradient_length 100%; + } + + @else if $p==left { + $_position: left center; + $_big_gradient_size: $_big_gradient_length 100%; + } + + background-image: -gtk-gradient(radial, + $_position, 0, + $_position, 0.6, + from(transparentize($c, 0.8)), + to(transparentize($c, 1))); + + background-size: $_big_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; // +} + +// +// Undershoot +// +@mixin undershoot($p) { +// $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; +} |