mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
130 lines
2.8 KiB
SCSS
130 lines
2.8 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 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2); //0 1px 3px 0 rgba(0, 0, 0, 0.3); //0 2px 5px 0 rgba(0, 0, 0, 0.26) !default;
|
|
$button-md-border-radius: 2px !default;
|
|
$button-md-animation-curve: cubic-bezier(0.4, 0, 0.2, 1) !default;
|
|
|
|
$button-md-clear-hover-bg-color: rgba(158, 158, 158, 0.1);
|
|
$button-md-clear-active-bg-color: rgba(158, 158, 158, 0.2);
|
|
|
|
|
|
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 0.2s $button-md-animation-curve,
|
|
background-color 0.2s $button-md-animation-curve,
|
|
color 0.2s $button-md-animation-curve;
|
|
|
|
&.activated {
|
|
box-shadow: $button-md-box-shadow-active;
|
|
}
|
|
|
|
&[full] {
|
|
border-radius: 0;
|
|
}
|
|
|
|
&[clear] {
|
|
box-shadow: none;
|
|
|
|
&.activated {
|
|
background-color: $button-md-clear-active-bg-color;
|
|
}
|
|
}
|
|
|
|
&[outline] {
|
|
box-shadow: none;
|
|
|
|
&.activated {
|
|
opacity: 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;
|
|
}
|
|
|
|
}
|
|
|
|
&.enable-hover button[clear]:hover,
|
|
&.enable-hover [button][clear]:hover {
|
|
background-color: $button-md-clear-hover-bg-color;
|
|
}
|
|
|
|
|
|
// Material Design Button Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin button-theme-md($color-name, $color-value) {
|
|
|
|
button[#{$color-name}],
|
|
[button][#{$color-name}] {
|
|
|
|
&.activated {
|
|
opacity: 1;
|
|
}
|
|
|
|
&[outline] {
|
|
|
|
&.activated {
|
|
|
|
@if lightness(get-color($color-name, base)) > 90 {
|
|
$fg-color: get-color($color-name, inverse);
|
|
} @else {
|
|
$fg-color: get-color($color-name, base);
|
|
}
|
|
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Generate Material Design Button Auxiliary Colors
|
|
// --------------------------------------------------
|
|
|
|
@each $color-name, $value in auxiliary-colors() {
|
|
|
|
@include button-theme-md($color-name, $value);
|
|
|
|
}
|