Various tweaks

pull/242/head
Satyajit Sahoo 2015-08-07 01:09:22 +05:30
parent bf32925cb7
commit 7f0f008de0
14 changed files with 952 additions and 935 deletions

View File

@ -80,7 +80,7 @@
@include toolbar($selected_bg_color, $selected_fg_color);
.button {
@include button(shade($selected_bg_color, 1.68), shade($selected_bg_color, 0.8));
@include button($selected_bg_color, $selected_fg_color);
&.suggested-action { @extend .suggested-action.button; }
}

View File

@ -2,8 +2,6 @@
! Buttons
**********/
$shadow_strength: .3;
@include exports("button_extends") {
%button {
padding: $spacing ($spacing + 2px);
@ -75,13 +73,16 @@ $shadow_strength: .3;
}
@mixin linked_button($bg) {
$border_strength: if(lightness($bg) > 50, 0, .1);
$shadow_strength: if(lightness($bg) > 50, 0, .1);
@extend %linked_button;
box-shadow: inset -1px 0 border_normal(rgba(0,0,0,.12)),
box-shadow: inset -1px 0 border_normal(rgba(0,0,0,.12 + $border_strength)),
0 1px 2px -1px alpha($dark_shadow, .12 + $shadow_strength);
&:focus, &:hover {
box-shadow: inset -1px 0 border_focus(rgba(0,0,0,.12)),
box-shadow: inset -1px 0 border_focus(rgba(0,0,0,.12 + $border_strength)),
0 1px 2px -1px alpha($dark_shadow, .32 + $shadow_strength);
}
@ -89,7 +90,7 @@ $shadow_strength: .3;
&:active:focus, &:active:hover:focus,
&:checked, &:checked:hover,
&:checked:focus, &:checked:hover:focus {
box-shadow: inset -1px 0 border_active(rgba(0,0,0,.12)),
box-shadow: inset -1px 0 border_active(rgba(0,0,0,.12 + $border_strength)),
inset 0 1px alpha($dark_shadow, .07),
inset 0 -1px alpha($dark_shadow, .05);
}
@ -119,51 +120,63 @@ $shadow_strength: .3;
}
@mixin button($bg, $fg) {
$border_strength: if(lightness($bg) > 50, 0, .1);
$shadow_strength: if(lightness($bg) > 50, 0, .1);
$button_bg: if(hue($bg) == 0deg, shade($bg, 1.2), $bg);
@extend %button;
@include linear-gradient(shade($bg, 1.3));
@include border(rgba(0,0,0,.12));
@include linear-gradient($button_bg);
@include border(rgba(0,0,0,.12 + $border_strength));
color: $fg;
box-shadow: 0 1px 2px -1px alpha($dark_shadow, .12 + $shadow_strength);
border-color: alpha($bg, 0);
&.flat {
border-color: alpha($bg, 0);
background-color: alpha($bg, 0);
border-color: alpha($button_bg, 0);
background-color: alpha($button_bg, 0);
background-image: none;
box-shadow: none;
}
&, &.flat {
&:focus, &:hover {
@include linear-gradient(shade($bg, 1.4));
@include linear-gradient(shade($button_bg, 1.2));
@include border(rgba(0,0,0,.2 + $border_strength));
border-color: alpha($bg, 0);
box-shadow: 0 1px 2px -1px alpha($dark_shadow, .32 + $shadow_strength);
}
&:active, &:checked {
@include linear-gradient(shade($bg, .9), to top);
@include linear-gradient(shade($button_bg, .7), to top);
color: $fg;
color: white;
box-shadow: inset 1px 0 alpha($dark_shadow, .06),
inset 0 1px alpha($dark_shadow, .07),
inset -1px 0 alpha($dark_shadow, .06),
inset 0 -1px alpha($dark_shadow, .05);
&:focus, &:hover {
@include linear-gradient(shade($button_bg, .65), to top);
color: white;
}
}
&:focus, &:hover { color: $fg; }
&:active:insensitive, &:checked:insensitive {
@include linear-gradient(shade($bg, .8));
@include linear-gradient(shade($button_bg, .9));
color: $fg;
box-shadow: none;
}
&:insensitive:insensitive {
@if (lightness($bg) > 50) {
@include linear-gradient(shade($bg, .95));
@if (lightness($button_bg) > 50) {
@include linear-gradient(shade($button_bg, .95));
} @else {
@include linear-gradient(alpha($bg, .3));
@include linear-gradient(alpha($button_bg, .3));
}
color: mix($bg, $fg, .5);
@ -175,7 +188,7 @@ $shadow_strength: .3;
border: 1px solid currentColor;
color: shade($bg, ($contrast + .1));
&:insensitive { color: shade($bg, .85); }
&:insensitive { color: shade($button_bg, .85); }
}
}
@ -214,7 +227,7 @@ $shadow_strength: .3;
}
.button {
@include button($bg_color, $fg_color);
@include button(shade($bg_color, 1.2), $fg_color);
&.default { @include button($selected_bg_color, $selected_fg_color); }

View File

@ -117,18 +117,18 @@
color: shade($menu_bg_color, ($contrast + .1));
}
&.button {
&.button, &.button.flat {
&, &:focus, &:active, &:insensitive, &:active:insensitive {
background-color: transparent;
background-image: none;
border: none;
border: 0;
box-shadow: none;
color: currentColor;
}
&:hover, &:focus:hover, &:active:hover, &:selected {
background-color: $selected_bg_color;
background-image: none;
background-color: $selected_bg_color;
color: $selected_fg_color;
}
}
@ -175,7 +175,7 @@
background-color: $menu_bg_color;
background-image: none;
color: $menu_fg_color;
box-shadow: 0 2px 3px alpha(black, .5);
box-shadow: 0 3px 6px alpha(black, .16);
&.background {
background-image: none;

View File

@ -49,14 +49,18 @@
@include exports("notifications") {
.app-notification {
&, &.frame {
border-style: solid;
border-color: border_normal($base_color);
border-color: border_normal($osd_bg);
border-width: 0 1px 1px 1px;
border-radius: 0 0 $roundness $roundness;
padding: $spacing * 3;
background-color: $base_color;
padding: $spacing * 2;
background-color: $osd_bg;
background-image: none;
color: $text_color;
color: $osd_fg;
.button { @include button($osd_bg, $osd_fg); }
}
}
}

View File

@ -15,7 +15,7 @@
&.osd {
-GtkProgressBar-xspacing: 0;
-GtkProgressBar-yspacing: 0;
-GtkProgressBar-min-horizontal-bar-height: 4;
-GtkProgressBar-min-horizontal-bar-height: 3;
}
&.trough {
@ -119,8 +119,8 @@
&.slider {
@include linear-gradient($base_color);
@include border($base_color);
@include linear-gradient(shade($bg_color, 1.08));
@include border($bg_color);
border-radius: 8px;
border-width: 1px;
@ -146,13 +146,13 @@
&.trough {
@include linear-gradient(shade($bg_color, 1.08));
margin: 8px 0;
border: 0;
margin: 7px 0;
border: 1px solid alpha(border_normal($bg_color), 0.5);
border-radius: $roundness;
&:insensitive { @include linear-gradient(shade($bg_color, 0.9)); }
&.vertical { margin: 0 8px; }
&.vertical { margin: 0 7px; }
}
&.highlight {

View File

@ -102,7 +102,7 @@
&:hover, &:hover:focus {
background-image: none;
background-color: transparent;
color: $selected_bg-color;
color: $selected_bg_color;
box-shadow: none;
}

View File

@ -16,8 +16,8 @@
.window-frame {
@extend %window;
border: 0;
border-radius: $roundness + 1;
border: none;
border-radius: $roundness $roundness 0 0;
/* this is used for the resize cursor area */
margin: $spacing * 3;