react-toolbox/components/button/theme.scss

188 lines
3.9 KiB
SCSS
Raw Normal View History

2016-06-04 23:06:59 +03:00
@import "../colors";
@import "../globals";
@import "../mixins";
@import "./config";
2016-06-04 17:36:17 +03:00
@import "./mixins";
2016-05-20 20:53:03 +03:00
.button {
position: relative;
2016-10-08 01:16:51 +03:00
> input {
position: absolute;
2016-10-31 02:19:24 +03:00
top: 0;
left: 0;
2016-10-12 18:04:52 +03:00
z-index: 0;
width: 0.1px;
height: 0.1px;
padding: 0;
margin: 0;
overflow: hidden;
opacity: 0;
2016-10-08 01:16:51 +03:00
}
2016-05-20 20:53:03 +03:00
}
%button {
2015-11-21 14:23:24 +03:00
@include typo-button();
position: relative;
2016-06-19 22:34:30 +03:00
display: inline-block;
2015-10-07 10:56:34 +03:00
height: $button-height;
flex-direction: row;
align-content: center;
2015-10-21 01:48:24 +03:00
align-items: center;
justify-content: center;
2016-07-17 19:16:13 +03:00
line-height: $button-height;
text-align: center;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
border: 0;
outline: none;
2016-04-10 13:20:30 +03:00
transition: box-shadow .2s $animation-curve-fast-out-linear-in, background-color .2s $animation-curve-default, color .2s $animation-curve-default;
&::-moz-focus-inner {
border: 0;
}
2015-11-29 14:39:55 +03:00
> span:not([data-react-toolbox="tooltip"]) {
display: inline-block;
line-height: $button-height;
vertical-align: top;
}
> svg {
display: inline-block;
width: 1em;
2016-04-10 12:39:25 +03:00
height: $button-height;
2015-11-25 00:18:00 +03:00
font-size: 120%;
vertical-align: top;
fill: currentColor;
}
> * {
pointer-events: none;
}
> .rippleWrapper {
overflow: hidden;
2015-11-15 21:34:09 +03:00
}
2015-11-25 00:18:00 +03:00
&[disabled] {
color: $button-disabled-text-color;
pointer-events: none;
cursor: auto;
}
}
%squared {
2015-10-21 01:48:24 +03:00
min-width: $button-squared-min-width;
padding: $button-squared-padding;
border-radius: $button-border-radius;
.icon {
2015-10-21 01:48:24 +03:00
margin-right: $button-squared-icon-margin;
font-size: 120%;
vertical-align: middle;
}
> svg {
margin-right: .5 * $unit;
}
}
2015-11-25 00:18:00 +03:00
%solid {
&[disabled] {
@include shadow-2dp();
background-color: $button-disabled-background-color;
}
2015-11-25 00:18:00 +03:00
&:active {
@include shadow-4dp();
2015-10-06 23:08:37 +03:00
}
2015-11-25 00:18:00 +03:00
&:focus:not(:active) {
@include focus-shadow();
}
}
.raised {
@extend %button;
@extend %squared;
2015-11-25 00:18:00 +03:00
@extend %solid;
@include shadow-2dp();
2015-11-25 00:18:00 +03:00
}
.flat {
@extend %button;
@extend %squared;
background: transparent;
}
.floating {
@extend %button;
2015-11-25 00:18:00 +03:00
@extend %solid;
width: $button-floating-height;
height: $button-floating-height;
2015-10-21 01:48:24 +03:00
font-size: $button-floating-font-size;
border-radius: 50%;
2016-04-10 13:20:30 +03:00
box-shadow: 0 1px 1.5px 0 rgba(0, 0, 0, .12), 0 1px 1px 0 rgba(0, 0, 0, .24);
.icon {
line-height: $button-floating-height;
}
> .rippleWrapper {
2015-11-15 23:42:32 +03:00
border-radius: 50%;
}
2015-11-25 00:18:00 +03:00
&.mini {
width: $button-floating-mini-height;
height: $button-floating-mini-height;
font-size: $button-floating-mini-font-size;
.icon {
line-height: $button-floating-mini-height;
}
}
}
2015-11-24 02:29:02 +03:00
.toggle {
@extend %button;
width: $button-height;
background: transparent;
border-radius: 50%;
2015-11-25 00:18:00 +03:00
> .icon, svg {
2015-11-24 02:29:02 +03:00
font-size: $button-toggle-font-size;
line-height: $button-height;
vertical-align: top;
2015-11-24 02:29:02 +03:00
}
> .rippleWrapper {
2015-11-24 02:29:02 +03:00
border-radius: 50%;
}
}
.neutral:not([disabled]) {
2015-11-28 22:15:26 +03:00
&.raised, &.floating {
color: $button-neutral-color-contrast;
background-color: $button-neutral-color;
}
&.flat, &.toggle {
color: $button-neutral-color-contrast;
&:focus:not(:active) {
2015-11-24 02:29:02 +03:00
background: $button-neutral-color-hover;
}
}
2015-11-28 22:15:26 +03:00
&.flat:hover {
background: $button-neutral-color-hover;
}
2015-11-22 09:01:49 +03:00
&.inverse {
&.raised, &.floating {
color: $button-neutral-color;
background-color: $button-neutral-color-contrast;
}
2015-11-22 09:01:49 +03:00
&.flat, &.toggle {
color: $button-neutral-color;
&:focus:not(:active) {
background: $button-neutral-color-hover;
}
}
2015-11-24 02:29:02 +03:00
&.flat:hover {
background: $button-neutral-color-hover;
}
}
}
2016-11-27 15:20:46 +03:00
.neutral.inverse[disabled] {
color: $button-disabled-text-color-inverse;
background-color: $button-disabled-background-inverse;
}
2016-04-10 13:20:30 +03:00
@include btn-colors("primary", $button-primary-color-contrast, $button-primary-color, $button-primary-color-hover);
@include btn-colors("accent", $button-accent-color-contrast, $button-accent-color, $button-accent-color-hover);