mirror of
https://git.disroot.org/eudaimon/Simplewaita.git
synced 2026-03-10 04:21:07 +00:00
unified overshoot, added undershoot
This commit is contained in:
parent
51ae8fc420
commit
e7d412e451
9 changed files with 202 additions and 148 deletions
|
|
@ -359,7 +359,84 @@
|
|||
}
|
||||
|
||||
|
||||
@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, 10%);
|
||||
$_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.93)),
|
||||
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; //
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
61
source/common/overshoot.scss
Normal file
61
source/common/overshoot.scss
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
@mixin overshoot($p, $t:normal, $c:$selected_bg_color) {
|
||||
//
|
||||
// overshoot
|
||||
//
|
||||
// $p: position
|
||||
// $t: type
|
||||
// $c: base color
|
||||
//
|
||||
// possible $p values:
|
||||
// top, bottom, right, left
|
||||
//
|
||||
// possible $t values:
|
||||
// normal, backdrop
|
||||
//
|
||||
|
||||
$_small_gradient_length: 3%;
|
||||
$_big_gradient_length: 50%;
|
||||
|
||||
$_small_gradient_size: 100% $_small_gradient_length;
|
||||
$_big_gradient_size: 100% $_big_gradient_length;
|
||||
|
||||
@if $p==right or $p==left {
|
||||
$_small_gradient_size: $_small_gradient_length 100%;
|
||||
$_big_gradient_size: $_big_gradient_length 100%;
|
||||
}
|
||||
|
||||
$_small_gradient_color: $c;
|
||||
$_big_gradient_color: transparentize($c, 0.93);
|
||||
|
||||
@if $c==$fg_color {
|
||||
$_small_gradient_color: darken($borders_color, 10%);
|
||||
$_big_gradient_color: transparentize($fg_color, 0.93);
|
||||
|
||||
@if $t==backdrop { $_small_gradient_color: $backdrop_borders_color; }
|
||||
}
|
||||
|
||||
$_small_gradient: radial-gradient(farthest-side at $p,
|
||||
$_small_gradient_color 85%,
|
||||
transparentize($_small_gradient_color, 1));
|
||||
|
||||
$_big_gradient: radial-gradient(farthest-side at $p,
|
||||
$_big_gradient_color,
|
||||
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: $p;
|
||||
|
||||
background-color: transparent; // reset some properties to be sure to not inherit them somehow
|
||||
border: none; //
|
||||
box-shadow: none; //
|
||||
}
|
||||
18
source/common/undershoot.scss
Normal file
18
source/common/undershoot.scss
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
undershoot {
|
||||
background-origin: padding-box;
|
||||
&.top, &.bottom {
|
||||
background-image: linear-gradient(to right, currentColor 50%, transparent 50%);
|
||||
background-size: 0.5em 1px;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
&.right, &.left {
|
||||
background-image: linear-gradient(to bottom, currentColor 50%, transparent 50%);
|
||||
background-size: 1px 0.5em;
|
||||
background-repeat: repeat-y;
|
||||
}
|
||||
&.top {background-position: top;}
|
||||
&.bottom {background-position: bottom;}
|
||||
&.right {background-position: right;}
|
||||
&.left {background-position: left;}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue