@import "../../globals.md"; @import "./button"; // Material Design Button // -------------------------------------------------- $button-md-margin: 0.4rem 0.2rem !default; $button-md-padding: 0 1.1em !default; $button-md-font-size: 1.4rem !default; $button-md-height: 3.6rem !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-md-large-font-size: 2rem !default; $button-md-large-height: 2.8em !default; $button-md-large-padding: 1.0em !default; $button-md-small-font-size: 1.3rem !default; $button-md-small-height: 2.1em !default; $button-md-small-padding: 0.9em !default; $button-md-small-icon-font-size: 1.4em !default; // Material Design Default Button // -------------------------------------------------- .button { margin: $button-md-margin; padding: $button-md-padding; min-height: $button-md-height; border-radius: $button-md-border-radius; font-weight: 500; font-size: $button-md-font-size; color: $button-md-text-color; background-color: $button-md-color; box-shadow: $button-md-box-shadow; text-transform: uppercase; 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; } &.activated { box-shadow: $button-md-box-shadow-active; background-color: $button-md-color-activated; } } // Material Design Default Button Color Mixin // -------------------------------------------------- @mixin md-button-default($color-name, $color-value) { .button-#{$color-name} { $bg-color: $color-value; $bg-color-activated: color-shade($bg-color); $fg-color: inverse($bg-color); color: $fg-color; background-color: $bg-color; &.activated { opacity: 1; background-color: $bg-color-activated; } } } // Material Design Button Sizes // -------------------------------------------------- .button-large { padding: 0 $button-md-large-padding; min-height: $button-md-large-height; font-size: $button-md-large-font-size; } .button-small { padding: 0 $button-md-small-padding; min-height: $button-md-small-height; font-size: $button-md-small-font-size; } .button-small.button-icon-only icon { font-size: $button-md-small-icon-font-size; } // Material Design Full Button // -------------------------------------------------- .button-full { border-radius: 0; margin-right: 0; margin-left: 0; border-right-width: 0; border-left-width: 0; } // Material Design Block Button // -------------------------------------------------- .button-block { margin-right: 0; margin-left: 0; } // Material Design Outline Button // -------------------------------------------------- .button-outline { border-width: 1px; border-style: solid; border-color: $button-md-color; background-color: transparent; color: $button-md-color; box-shadow: none; &.activated { opacity: 1; color: $background-md-color; background-color: $button-md-color; box-shadow: none; } md-ripple { background-color: ripple-background-color($button-md-color); } } // Material Design Outline Button Color Mixin // -------------------------------------------------- @mixin md-button-outline($color-name, $color-value) { .button-outline-#{$color-name} { $fg-color: color-shade($color-value, 5%); border-color: $fg-color; background-color: transparent; color: $fg-color; &.activated { color: $background-md-color; background-color: $fg-color; } } } // Material Design Clear Button // -------------------------------------------------- .button-clear { border-color: transparent; opacity: 1; box-shadow: none; background-color: transparent; color: color-shade($button-md-color); &.activated { background-color: $button-md-clear-active-background-color; box-shadow: none; } &:hover:not(.disable-hover) { color: color-shade($button-md-color); } } // Material Design Clear Button Color Mixin // -------------------------------------------------- @mixin md-button-clear($color-name, $color-value) { .button-clear-#{$color-name} { $fg-color: color-shade($color-value); border-color: transparent; background-color: transparent; color: $fg-color; &.activated { background-color: $button-md-clear-active-background-color; box-shadow: none; } &:hover:not(.disable-hover) { color: color-shade($fg-color); } } } // Material Design Round Button // -------------------------------------------------- .button-round { padding: $button-round-padding; border-radius: $button-round-border-radius; } // Material Design FAB Button // -------------------------------------------------- .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; } // Generate Material Design Button Colors // -------------------------------------------------- @each $color-name, $color-value in $colors-md { @include md-button-default($color-name, $color-value); @include md-button-outline($color-name, $color-value); @include md-button-clear($color-name, $color-value); } // Core Button Overrides // -------------------------------------------------- @import "./button-fab"; @import "./button-icon";