Files
ionic-framework/src/components/button/button.wp.scss
2016-09-21 09:42:07 -05:00

325 lines
9.4 KiB
SCSS

@import "../../themes/ionic.globals.wp";
// Windows Button
// --------------------------------------------------
/// @prop - Margin of the button
$button-wp-margin: .4rem .2rem !default;
/// @prop - Padding of the button
$button-wp-padding: 0 1.1em !default;
/// @prop - Height of the button
$button-wp-height: 3.6rem !default;
/// @prop - Border width of the button
$button-wp-border-width: 3px !default;
/// @prop - Border style of the button
$button-wp-border-style: solid !default;
/// @prop - Border color of the button
$button-wp-border-color: transparent !default;
/// @prop - Border radius of the button
$button-wp-border-radius: 0 !default;
/// @prop - Font size of the button text
$button-wp-font-size: 1.4rem !default;
/// @prop - Background color of the button
$button-wp-background-color: color($colors-wp, primary) !default;
/// @prop - Text color of the button
$button-wp-text-color: color-contrast($colors-wp, $button-wp-background-color) !default;
/// @prop - Background color of the activated button
$button-wp-background-color-activated: color-shade($button-wp-background-color) !default;
// Windows Large Button
// --------------------------------------------------
/// @prop - Padding of the large button
$button-wp-large-padding: 0 1em !default;
/// @prop - Height of the large button
$button-wp-large-height: 2.8em !default;
/// @prop - Font size of the large button
$button-wp-large-font-size: 2rem !default;
// Windows Small Button
// --------------------------------------------------
/// @prop - Padding of the small button
$button-wp-small-padding: 0 .9em !default;
/// @prop - Height of the small button
$button-wp-small-height: 2.1em !default;
/// @prop - Font size of the small button
$button-wp-small-font-size: 1.3rem !default;
/// @prop - Font size of an icon in the small button
$button-wp-small-icon-font-size: 1.4em !default;
// Windows Outline Button
// --------------------------------------------------
/// @prop - Border width of the outline button
$button-wp-outline-border-width: 1px !default;
/// @prop - Border style of the outline button
$button-wp-outline-border-style: solid !default;
/// @prop - Border color of the outline button
$button-wp-outline-border-color: $button-wp-background-color !default;
/// @prop - Text color of the outline button
$button-wp-outline-text-color: $button-wp-background-color !default;
/// @prop - Background color of the outline button
$button-wp-outline-background-color: transparent !default;
/// @prop - Background color of the activated outline button
$button-wp-outline-background-color-activated: $button-wp-background-color !default;
/// @prop - Opacity of the background color of the activated outline button
$button-wp-outline-background-color-opacity-activated: .16 !default;
// Windows Clear Button
// --------------------------------------------------
/// @prop - Text color of the clear button
$button-wp-clear-text-color: $button-wp-background-color !default;
/// @prop - Background color of the clear button
$button-wp-clear-background-color: transparent !default;
/// @prop - Background color of the activated clear button
$button-wp-clear-background-color-activated: rgba(158, 158, 158, .2) !default;
/// @prop - Background color of the clear button on hover
$button-wp-clear-background-color-hover: rgba(158, 158, 158, .1) !default;
// Windows Round Button
// --------------------------------------------------
/// @prop - Padding of the round button
$button-wp-round-padding: $button-round-padding !default;
/// @prop - Border radius of the round button
$button-wp-round-border-radius: $button-round-border-radius !default;
// Windows FAB Button
// --------------------------------------------------
/// @prop - Border radius of the FAB button
$button-wp-fab-border-radius: 50% !default;
// Windows Default Button
// --------------------------------------------------
.button-wp {
margin: $button-wp-margin;
padding: $button-wp-padding;
height: $button-wp-height;
border: $button-wp-border-width $button-wp-border-style $button-wp-border-color;
border-radius: $button-wp-border-radius;
font-size: $button-wp-font-size;
color: $button-wp-text-color;
background-color: $button-wp-background-color;
}
.button-wp:hover:not(.disable-hover) {
border-color: $button-wp-background-color-activated;
background-color: $button-wp-background-color;
}
.button-wp.activated {
background-color: $button-wp-background-color-activated;
}
// Windows Default Button Color Mixin
// --------------------------------------------------
@mixin wp-button-default($color-name, $color-base, $color-contrast) {
$bg-color: $color-base;
$bg-color-activated: color-shade($bg-color);
$fg-color: $color-contrast;
.button-wp-#{$color-name} {
color: $fg-color;
background-color: $bg-color;
}
.button-wp-#{$color-name}:hover:not(.disable-hover) {
border-color: $bg-color-activated;
background-color: $bg-color;
}
.button-wp-#{$color-name}.activated {
background-color: $bg-color-activated;
}
}
// Windows Button Sizes
// --------------------------------------------------
.button-large-wp {
padding: $button-wp-large-padding;
height: $button-wp-large-height;
font-size: $button-wp-large-font-size;
}
.button-small-wp {
padding: $button-wp-small-padding;
height: $button-wp-small-height;
font-size: $button-wp-small-font-size;
}
.button-small-wp[icon-only] ion-icon {
font-size: $button-wp-small-icon-font-size;
}
// Windows Block Button
// --------------------------------------------------
.button-block-wp {
margin-right: 0;
margin-left: 0;
}
// Windows Full Button
// --------------------------------------------------
.button-full-wp {
margin-right: 0;
margin-left: 0;
border-right-width: 0;
border-left-width: 0;
border-radius: 0;
}
// Windows Outline Button
// --------------------------------------------------
.button-outline-wp {
border-width: $button-wp-outline-border-width;
border-style: $button-wp-outline-border-style;
border-color: $button-wp-outline-border-color;
color: $button-wp-outline-text-color;
background-color: $button-wp-outline-background-color;
}
.button-outline-wp:hover:not(.disable-hover) {
background-color: $button-wp-clear-background-color-hover;
}
.button-outline-wp.activated {
background-color: rgba($button-wp-outline-background-color-activated, $button-wp-outline-background-color-opacity-activated);
}
// Windows Outline Button Color Mixin
// --------------------------------------------------
@mixin wp-button-outline($color-name, $color-base, $color-contrast) {
$fg-color: color-shade($color-base, 5%);
.button-outline-wp-#{$color-name} {
border-color: $fg-color;
color: $fg-color;
background-color: $button-wp-outline-background-color;
}
.button-outline-wp-#{$color-name}:hover:not(.disable-hover) {
border-color: $fg-color;
background-color: $button-wp-clear-background-color-hover;
}
.button-outline-wp-#{$color-name}.activated {
background-color: rgba($fg-color, $button-wp-outline-background-color-opacity-activated);
}
}
// Windows Clear Button
// --------------------------------------------------
.button-clear-wp {
color: $button-wp-clear-text-color;
background-color: $button-wp-clear-background-color;
}
.button-clear-wp.activated {
background-color: $button-wp-clear-background-color-activated;
}
.button-clear-wp:hover:not(.disable-hover) {
background-color: $button-wp-clear-background-color-hover;
}
// Windows Clear Button Color Mixin
// --------------------------------------------------
@mixin wp-button-clear($color-name, $color-base, $color-contrast) {
$fg-color: $color-base;
.button-clear-wp-#{$color-name} {
color: $fg-color;
background-color: $button-wp-clear-background-color;
}
.button-clear-wp-#{$color-name}.activated {
background-color: $button-wp-clear-background-color-activated;
}
.button-clear-wp-#{$color-name}:hover:not(.disable-hover) {
color: $fg-color;
}
}
// Windows Round Button
// --------------------------------------------------
.button-round-wp {
padding: $button-wp-round-padding;
border-radius: $button-wp-round-border-radius;
}
.button-wp [icon-only] {
padding: 0;
}
// Generate Windows Button Colors
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
@include wp-button-default($color-name, $color-base, $color-contrast);
@include wp-button-outline($color-name, $color-base, $color-contrast);
@include wp-button-clear($color-name, $color-base, $color-contrast);
}