From a8ddb5d8e40547675e7eeee73a1685d98e9dcf1d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 18 Jul 2017 18:20:40 +0100 Subject: rebase Redcore gtk theme on Numix --- Redcore-nighttime/gtk-3.20/scss/_functions.scss | 95 +++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Redcore-nighttime/gtk-3.20/scss/_functions.scss (limited to 'Redcore-nighttime/gtk-3.20/scss/_functions.scss') diff --git a/Redcore-nighttime/gtk-3.20/scss/_functions.scss b/Redcore-nighttime/gtk-3.20/scss/_functions.scss new file mode 100644 index 0000000..8eb18c6 --- /dev/null +++ b/Redcore-nighttime/gtk-3.20/scss/_functions.scss @@ -0,0 +1,95 @@ +$modules: () !default; + +@mixin exports($name) { + @if (not index($modules, $name)) { + $modules: append($modules, $name) !global; + + @content; + } +} + +@function alpha($color, $amount) { + @if type-of($color) == "color" { + @return fade-out($color, (1 - $amount)); + } @else { + @return unquote("alpha(#{$color},#{$amount})"); + } +} + +@function shade($color, $amount) { + @if type-of($color) == "color" { + @if ($amount > 1) { + @return lighten($color, ($amount - 1) * lightness($color)) + } @else { + @return darken($color, (1 - $amount) * lightness($color)) + } + } @else { + @return unquote("shade(#{$color},#{$amount})"); + } +} + +@function mix($color1, $color2, $amount) { + @return unquote("mix(#{$color1},#{$color2},#{$amount})"); +} + +@function border_normal($color) { + @return shade($color, $contrast); +} + +@function border_focus($color) { + @return if($variant == 'light', mix($selected_bg_color, $color, .3), darken($selected_bg_color, 20%)); +} + +@function border_active($color) { + @return shade($color, ($contrast - .1)); +} + +@function border_insensitive($color) { + @return shade($color, ($contrast + .05)); +} + +@mixin linear-gradient($color, $direction: to bottom) { + @if $gradient == 0 { + background-color: $color; + background-image: none; + } @else { + $amount: $gradient / 2; + + background-color: $color; + background-image: linear-gradient($direction, + shade($color, (1 + $amount)), + shade($color, (1 - $amount)) + ); + } +} + +@mixin border($color) { + border-color: border_normal($color); + + &:focus, &:hover { border-color: border_focus($color); } + + &:active, &:active:hover, + &:active:focus, &:active:hover:focus, + &:checked, &:checked:hover, + &:checked:focus, &:checked:hover:focus { border-color: border_active($color); } + + &:disabled { border-color: border_insensitive($color); } + + &:active:disabled, &:checked:disabled { border-color: border_normal($color); } +} + +@function _text_shadow_color($tc: $fg_color, $bg: $bg_color) { + // + // calculate the color of text shadows + // + // $tc is the text color + // $bg is the background color + // + $_lbg: lightness($bg) / 100%; + + @if lightness($tc) < 50% { + @return transparentize(white, 1 - $_lbg / ($_lbg * 1.3)); + } @else { + @return transparentize(black, $_lbg * .8); + } +} -- cgit v1.2.3