Files

442 lines
13 KiB
SCSS

@import "../../themes/ionic.globals.md";
// Material Design Button
// --------------------------------------------------
/// @prop - Margin of the button
$button-md-margin: .4rem .2rem !default;
/// @prop - Padding of the button
$button-md-padding: 0 1.1em !default;
/// @prop - Height of the button
$button-md-height: 3.6rem !default;
/// @prop - Border radius of the button
$button-md-border-radius: 2px !default;
/// @prop - Font size of the button text
$button-md-font-size: 1.4rem !default;
/// @prop - Font weight of the button text
$button-md-font-weight: 500 !default;
/// @prop - Capitalization of the button text
$button-md-text-transform: uppercase !default;
/// @prop - Background color of the button
$button-md-background-color: color($colors-md, primary) !default;
/// @prop - Text color of the button
$button-md-text-color: color-contrast($colors-md, $button-md-background-color) !default;
/// @prop - Box shadow of the button
$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;
/// @prop - Duration of the transition of the button
$button-md-transition-duration: 300ms !default;
/// @prop - Speed curve of the transition of the button
$button-md-transition-timing-function: cubic-bezier(.4, 0, .2, 1) !default;
/// @prop - Background color of the button on hover
$button-md-background-color-hover: $button-md-background-color !default;
/// @prop - Background color of the activated button
$button-md-background-color-activated: color-shade($button-md-background-color) !default;
/// @prop - Opacity of the activated button
$button-md-opacity-activated: 1 !default;
/// @prop - Box shadow of the activated button
$button-md-box-shadow-activated: 0 3px 5px rgba(0, 0, 0, .14), 0 3px 5px rgba(0, 0, 0, .21), 0 0 0 0 transparent !default;
/// @prop - Background color of the ripple on the button
$button-md-ripple-background-color: #555 !default;
// Material Design Large Button
// --------------------------------------------------
/// @prop - Padding of the large button
$button-md-large-padding: 0 1em !default;
/// @prop - Height of the large button
$button-md-large-height: 2.8em !default;
/// @prop - Font size of the large button
$button-md-large-font-size: 2rem !default;
// Material Design Small Button
// --------------------------------------------------
/// @prop - Padding of the small button
$button-md-small-padding: 0 .9em !default;
/// @prop - Height of the small button
$button-md-small-height: 2.1em !default;
/// @prop - Font size of the small button
$button-md-small-font-size: 1.3rem !default;
/// @prop - Font size of an icon in the small button
$button-md-small-icon-font-size: 1.4em !default;
// Material Design Outline Button
// --------------------------------------------------
/// @prop - Border width of the outline button
$button-md-outline-border-width: 1px !default;
/// @prop - Border style of the outline button
$button-md-outline-border-style: solid !default;
/// @prop - Border color of the outline button
$button-md-outline-border-color: $button-md-background-color !default;
/// @prop - Text color of the outline button
$button-md-outline-text-color: $button-md-background-color !default;
/// @prop - Background color of the outline button
$button-md-outline-background-color: transparent !default;
/// @prop - Box shadow of the outline button
$button-md-outline-box-shadow: none !default;
/// @prop - Background color of the outline button on hover
$button-md-outline-background-color-hover: rgba(158, 158, 158, .1) !default;
/// @prop - Background color of the activated outline button
$button-md-outline-background-color-activated: transparent !default;
/// @prop - Box shadow of the activated outline button
$button-md-outline-box-shadow-activated: none !default;
/// @prop - Opacity of the activated outline button
$button-md-outline-opacity-activated: 1 !default;
/// @prop - Background color of the ripple on the outline button
$button-md-outline-ripple-background-color: $button-md-background-color !default;
// Material Design Clear Button
// --------------------------------------------------
/// @prop - Border color of the clear button
$button-md-clear-border-color: transparent !default;
/// @prop - Text color of the clear button
$button-md-clear-text-color: $button-md-background-color !default;
/// @prop - Background color of the clear button
$button-md-clear-background-color: transparent !default;
/// @prop - Box shadow of the clear button
$button-md-clear-box-shadow: none !default;
/// @prop - Opacity of the clear button
$button-md-clear-opacity: 1 !default;
/// @prop - Background color of the activated clear button
$button-md-clear-background-color-activated: rgba(158, 158, 158, .2) !default;
/// @prop - Box shadow of the activated clear button
$button-md-clear-box-shadow-activated: $button-md-clear-box-shadow !default;
/// @prop - Background color of the clear button on hover
$button-md-clear-background-color-hover: rgba(158, 158, 158, .1) !default;
/// @prop - Background color of the ripple on the clear button
$button-md-clear-ripple-background-color: #999 !default;
// Material Design Round Button
// --------------------------------------------------
/// @prop - Padding of the round button
$button-md-round-padding: $button-round-padding !default;
/// @prop - Border radius of the round button
$button-md-round-border-radius: $button-round-border-radius !default;
// Material Design Decorator Button
// --------------------------------------------------
/// @prop - Font weight of the strong button
$button-md-strong-font-weight: bold !default;
// Material Design Default Button
// --------------------------------------------------
.button-md {
overflow: hidden;
margin: $button-md-margin;
padding: $button-md-padding;
height: $button-md-height;
border-radius: $button-md-border-radius;
font-size: $button-md-font-size;
font-weight: $button-md-font-weight;
text-transform: $button-md-text-transform;
color: $button-md-text-color;
background-color: $button-md-background-color;
box-shadow: $button-md-box-shadow;
transition: box-shadow $button-md-transition-duration $button-md-transition-timing-function,
background-color $button-md-transition-duration $button-md-transition-timing-function,
color $button-md-transition-duration $button-md-transition-timing-function;
}
.button-md:hover:not(.disable-hover) {
background-color: $button-md-background-color-hover;
}
.button-md.activated {
background-color: $button-md-background-color-activated;
box-shadow: $button-md-box-shadow-activated;
}
.button-md .button-effect {
background-color: $button-md-text-color;
}
// Material Design Default Button Color Mixin
// --------------------------------------------------
@mixin md-button-default($color-name, $color-base, $color-contrast) {
$bg-color: $color-base;
$bg-color-activated: color-shade($bg-color);
$fg-color: $color-contrast;
.button-md-#{$color-name} {
color: $fg-color;
background-color: $bg-color;
}
.button-md-#{$color-name}:hover:not(.disable-hover) {
background-color: $bg-color;
}
.button-md-#{$color-name}.activated {
background-color: $bg-color-activated;
opacity: $button-md-opacity-activated;
}
.button-md-#{$color-name} .button-effect {
background-color: $fg-color;
}
}
// Material Design Button Sizes
// --------------------------------------------------
.button-large-md {
padding: $button-md-large-padding;
height: $button-md-large-height;
font-size: $button-md-large-font-size;
}
.button-small-md {
padding: $button-md-small-padding;
height: $button-md-small-height;
font-size: $button-md-small-font-size;
}
.button-small-md[icon-only] ion-icon {
font-size: $button-md-small-icon-font-size;
}
// Material Design Block Button
// --------------------------------------------------
.button-block-md {
margin-right: 0;
margin-left: 0;
}
// Material Design Full Button
// --------------------------------------------------
.button-full-md {
margin-right: 0;
margin-left: 0;
border-right-width: 0;
border-left-width: 0;
border-radius: 0;
}
// Material Design Outline Button
// --------------------------------------------------
.button-outline-md {
border-width: $button-md-outline-border-width;
border-style: $button-md-outline-border-style;
border-color: $button-md-outline-border-color;
color: $button-md-outline-text-color;
background-color: $button-md-outline-background-color;
box-shadow: $button-md-outline-box-shadow;
}
.button-outline-md:hover:not(.disable-hover) {
background-color: $button-md-outline-background-color-hover;
}
.button-outline-md.activated {
background-color: $button-md-outline-background-color-activated;
box-shadow: $button-md-outline-box-shadow-activated;
opacity: $button-md-outline-opacity-activated;
}
.button-outline-md .button-effect {
background-color: $button-md-outline-ripple-background-color;
}
// Material Design Outline Button Color Mixin
// --------------------------------------------------
@mixin md-button-outline($color-name, $color-base, $color-contrast) {
$fg-color: color-shade($color-base, 5%);
.button-outline-md-#{$color-name} {
border-color: $fg-color;
color: $fg-color;
background-color: $button-md-outline-background-color;
}
.button-outline-md-#{$color-name}:hover:not(.disable-hover) {
background-color: $button-md-outline-background-color-hover;
}
.button-outline-md-#{$color-name}.activated {
background-color: $button-md-outline-background-color-activated;
}
.button-outline-md-#{$color-name} .button-effect {
background-color: $fg-color;
}
}
// Material Design Clear Button
// --------------------------------------------------
.button-clear-md {
border-color: $button-md-clear-border-color;
color: $button-md-background-color;
background-color: $button-md-clear-background-color;
box-shadow: $button-md-clear-box-shadow;
opacity: $button-md-clear-opacity;
}
.button-clear-md.activated {
background-color: $button-md-clear-background-color-activated;
box-shadow: $button-md-clear-box-shadow-activated;
}
.button-clear-md:hover:not(.disable-hover) {
background-color: $button-md-clear-background-color-hover;
}
.button-clear-md .button-effect {
background-color: $button-md-clear-ripple-background-color;
}
// Material Design Clear Button Color Mixin
// --------------------------------------------------
@mixin md-button-clear($color-name, $color-base, $color-contrast) {
$fg-color: $color-base;
.button-clear-md-#{$color-name} {
border-color: $button-md-clear-border-color;
color: $fg-color;
background-color: $button-md-clear-background-color;
}
.button-clear-md-#{$color-name}.activated {
background-color: $button-md-clear-background-color-activated;
box-shadow: $button-md-clear-box-shadow-activated;
}
.button-clear-md-#{$color-name}:hover:not(.disable-hover) {
color: $fg-color;
}
}
// Material Design Round Button
// --------------------------------------------------
.button-round-md {
padding: $button-md-round-padding;
border-radius: $button-md-round-border-radius;
}
.button-md [icon-only] {
padding: 0;
}
// Material Design Ripple Effect
// --------------------------------------------------
// Only Material uses the button effect, so by default
// it's display none, and .md sets to display block.
.button-effect {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: none;
border-radius: 50%;
background-color: $button-md-ripple-background-color;
opacity: .2;
transform-origin: center center;
transition-timing-function: ease-in-out;
pointer-events: none;
}
.md .button-effect {
display: block;
}
// Generate Material Design Button Colors
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
@include md-button-default($color-name, $color-base, $color-contrast);
@include md-button-outline($color-name, $color-base, $color-contrast);
@include md-button-clear($color-name, $color-base, $color-contrast);
}
// MD strong Button
// --------------------------------------------------
.button-strong-md {
font-weight: $button-md-strong-font-weight;
}