mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
137 lines
3.1 KiB
SCSS
137 lines
3.1 KiB
SCSS
|
|
// 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,
|
|
[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;
|
|
}
|
|
|
|
&.activated {
|
|
box-shadow: $button-md-box-shadow-active;
|
|
}
|
|
|
|
&[full] {
|
|
border-radius: 0;
|
|
}
|
|
|
|
&[clear] {
|
|
opacity: 1;
|
|
box-shadow: none;
|
|
|
|
&.activated {
|
|
background-color: $button-md-clear-active-background-color;
|
|
}
|
|
}
|
|
|
|
&[outline] {
|
|
box-shadow: none;
|
|
|
|
&.activated {
|
|
opacity: 1;
|
|
}
|
|
|
|
md-ripple {
|
|
background: rgba( red($button-color), green($button-color), blue($button-color), 0.1);
|
|
}
|
|
}
|
|
|
|
&[round] {
|
|
border-radius: $button-round-border-radius;
|
|
padding: $button-round-padding;
|
|
}
|
|
|
|
&[large] {
|
|
padding: 0 $button-large-padding;
|
|
min-height: $button-large-height;
|
|
font-size: $button-large-font-size;
|
|
}
|
|
|
|
&[small] {
|
|
padding: 0 $button-small-padding;
|
|
min-height: $button-small-height;
|
|
font-size: $button-small-font-size;
|
|
}
|
|
|
|
&[fab] {
|
|
border-radius: 50%;
|
|
}
|
|
|
|
&.icon-only {
|
|
padding: 0;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Button Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin button-theme-md($color-name, $color-value) {
|
|
|
|
button[#{$color-name}],
|
|
[button][#{$color-name}] {
|
|
|
|
&.activated {
|
|
opacity: 1;
|
|
}
|
|
|
|
&[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 auxiliary-colors() {
|
|
|
|
@include button-theme-md($color-name, $color-value);
|
|
|
|
}
|