Files
Adam Bradley cc91591b2d update button
2015-12-05 10:16:28 -06:00

165 lines
4.0 KiB
SCSS

@import "../../../globals.md";
@import "../button";
@import "../button-fab";
@import "../button-icon";
@import "../button-size";
// Material Design Button
// --------------------------------------------------
$button-md-font-size: 1.4rem !default;
$button-md-min-height: 3.6rem !default;
$button-md-padding: 0 1.1em !default;
$button-md-box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12) !default;
$button-md-box-shadow-active: 0 3px 5px rgba(0, 0, 0, 0.14), 0 3px 5px rgba(0, 0, 0, 0.21) !default;
$button-md-border-radius: 2px !default;
$button-md-animation-curve: cubic-bezier(0.4, 0, 0.2, 1) !default;
$button-md-transition-duration: 300ms !default;
$button-md-clear-hover-background-color: rgba(158, 158, 158, 0.1) !default;
$button-md-clear-active-background-color: rgba(158, 158, 158, 0.2) !default;
$button-md-fab-box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.14), 0 4px 5px rgba(0, 0, 0, 0.1) !default;
$button-md-fab-box-shadow-active: 0 5px 15px 0 rgba(0, 0, 0, 0.4), 0 4px 7px 0 rgba(0, 0, 0, 0.1) !default;
$button-md-color: map-get($colors-md, primary) !default;
$button-md-color-activated: color-shade($button-md-color) !default;
$button-md-text-color: inverse($button-md-color) !default;
$button-md-hover-opacity: 0.8 !default;
.button {
border-radius: $button-md-border-radius;
min-height: $button-md-min-height;
padding: $button-md-padding;
text-transform: uppercase;
font-weight: 500;
font-size: $button-md-font-size;
box-shadow: $button-md-box-shadow;
transition: box-shadow $button-md-transition-duration $button-md-animation-curve,
background-color $button-md-transition-duration $button-md-animation-curve,
color $button-md-transition-duration $button-md-animation-curve;
&:hover:not(.disable-hover) {
background-color: $button-md-clear-hover-background-color;
}
}
.button-full {
border-radius: 0;
}
.button-round {
border-radius: $button-round-border-radius;
padding: $button-round-padding;
}
.button-large {
padding: 0 $button-large-padding;
min-height: $button-large-height;
font-size: $button-large-font-size;
}
.button-small {
padding: 0 $button-small-padding;
min-height: $button-small-height;
font-size: $button-small-font-size;
}
&.activated {
box-shadow: $button-md-box-shadow-active;
}
.button-fab {
border-radius: 50%;
box-shadow: $button-md-fab-box-shadow;
&.activated {
box-shadow: $button-md-fab-box-shadow-active;
}
}
.button-icon-only {
padding: 0;
}
.button-outline {
box-shadow: none;
&.activated {
opacity: 1;
}
md-ripple {
background-color: ripple-background-color($button-md-color);
}
}
.button-clear {
opacity: 1;
box-shadow: none;
background: transparent;
&.activated {
opacity: 0.4;
background-color: $button-md-clear-active-background-color;
}
}
// Outline Button
// --------------------------------------------------
.button-outline {
border: 1px solid $button-md-color;
background: transparent;
color: $button-md-color;
&.activated {
opacity: 1;
color: $background-md-color;
background-color: $button-md-color;
}
}
// Material Design Button Color Mixin
// --------------------------------------------------
@mixin button-theme-md($color-name, $color-value) {
.button-#{$color-name}.activated {
opacity: 1;
}
.button-outline {
md-ripple {
background: rgba( red($color-value), green($color-value), blue($color-value), 0.2);
}
&.activated {
opacity: 1;
md-ripple {
background: rgba(0, 0, 0, 0.1);
}
}
}
}
// Generate Material Design Button Auxiliary Colors
// --------------------------------------------------
@each $color-name, $color-value in $colors-md {
@include button-theme-md($color-name, $color-value);
}