numix-gtk-theme/gtk-3.0/scss/_button.scss

174 lines
3.8 KiB
SCSS
Raw Normal View History

2014-07-05 19:54:53 +00:00
@import "functions";
2014-11-23 17:06:45 +00:00
@import "global";
/*********
! Buttons
**********/
2014-07-05 19:54:53 +00:00
@mixin linked_button($bg, $shadow) {
border: 1px solid border_normal($bg);
2014-07-05 19:54:53 +00:00
border-radius: 0;
border-right-style: none;
border-left-style: none;
box-shadow: inset -1px 0 border_normal($bg),
2014-12-06 09:59:35 +00:00
0 1px 2px -1px alpha($shadow, .3);
2014-07-05 19:54:53 +00:00
&:first-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: solid;
border-right-style: none;
2014-07-05 19:54:53 +00:00
border-top-right-radius: 0;
border-bottom-right-radius: 0;
&:dir(rtl) {
border-left-style: none;
border-right-style: solid;
}
2014-07-05 19:54:53 +00:00
}
&:last-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: none;
border-right-style: solid;
2014-07-05 19:54:53 +00:00
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&:dir(rtl) {
border-left-style: solid;
border-right-style: none;
}
2014-07-05 19:54:53 +00:00
}
&:only-child {
border-width: 1px;
border-radius: $roundness;
}
&:focus, &:hover {
box-shadow: inset -1px 0 border_focus($bg),
2014-12-06 09:59:35 +00:00
0 1px 2px -1px alpha($shadow, .3);
}
2014-07-05 19:54:53 +00:00
&:active, &:active:hover,
2014-11-23 17:06:45 +00:00
&:active:focus, &:active:hover:focus,
&:checked, &:checked:hover,
&:checked:focus, &:checked:hover:focus {
2014-07-05 19:54:53 +00:00
box-shadow: inset -1px 0 border_active($bg),
inset 1px 0 alpha($shadow, .07),
inset 0 1px alpha($shadow, .08),
inset 0 -1px alpha($shadow, .05);
}
&:insensitive { box-shadow: inset -1px 0 border_insensitive($bg); }
&:last-child, &:only-child,
&:insensitive:last-child, &:insensitive:only-child,
&:active:insensitive:last-child, &:active:insensitive:only-child,
&:checked:insensitive:last-child, &:checked:insensitive:only-child { box-shadow: none; }
2014-07-05 19:54:53 +00:00
2014-11-23 17:06:45 +00:00
&:active:last-child, &:active:only-child,
&:checked:last-child, &:checked:only-child {
2014-07-05 19:54:53 +00:00
box-shadow: inset 1px 0 alpha($shadow, .07),
inset 0 1px alpha($shadow, .08),
inset -1px 0 alpha($shadow, .07);
}
}
@mixin button($bg, $fg) {
@include linear-gradient(shade($bg, 1.05));
@include border(shade($bg, 1.05));
padding: ($spacing - 1px) ($spacing + 1px);
border-width: 1px;
border-radius: $roundness;
border-style: solid;
color: $fg;
transition: 100ms ease;
box-shadow: 0 1px 2px -1px alpha($dark_shadow, .3);
2014-07-05 19:54:53 +00:00
-GtkWidget-focus-padding: 1;
-GtkWidget-focus-line-width: 0;
&:focus, &:hover {
@include linear-gradient(shade($bg, 1.1));
box-shadow: 0 1px 3px -1px alpha($dark_shadow, .5);
}
2014-07-05 19:54:53 +00:00
&:checked, &:active {
2014-07-05 19:54:53 +00:00
@include linear-gradient(shade($bg, .95));
box-shadow: inset 1px 0 alpha($dark_shadow, .07),
inset 0 1px alpha($dark_shadow, .08),
inset -1px 0 alpha($dark_shadow, .07),
inset 0 -1px alpha($dark_shadow, .05);
}
&:insensitive {
@include linear-gradient(shade($bg, .95));
color: mix($bg, $fg, .5);
box-shadow: none;
2014-07-05 19:54:53 +00:00
}
&:active:insensitive,
&:checked:insensitive {
2014-07-05 19:54:53 +00:00
@include linear-gradient(shade($bg, .8));
box-shadow: none;
}
2014-12-06 09:59:35 +00:00
&.flat {
color: inherit;
&, &:hover, &:focus,
&:active, &:active:hover, &:active:focus,
&:checked, &:checked:hover, &:checked:focus {
border: none;
background-color: transparent;
background-image: none;
}
// TODO
}
2014-07-05 19:54:53 +00:00
&.separator, .separator {
color: shade($bg, .95);
border: 1px solid currentColor;
&:insensitive { color: shade($bg, .85); }
}
2014-12-06 09:59:35 +00:00
.linked & { @include linked_button($bg, $dark_shadow); }
2014-07-05 19:54:53 +00:00
}
%close_button {
border: 1px solid transparent;
background-color: transparent;
background-image: none;
box-shadow: none;
&:focus, &:hover {
border: 1px solid alpha(black, 0.3);
background-color: alpha(white, 0.2);
background-image: none;
box-shadow: none;
}
&:active, &:checked, &:active:hover, &:checked:hover {
border: 1px solid alpha(black, 0.3);
background-color: alpha(black, 0.1);
background-image: none;
box-shadow: none;
}
}
2014-07-05 19:54:53 +00:00
.button {
@include button($bg_color, $fg_color);
&.default { @include button($selected_bg_color, $selected_fg_color); }
}