2015-11-25 01:34:17 +03:00
|
|
|
// specification: https://www.google.com/design/spec/components/buttons.html
|
|
|
|
|
|
|
|
// mdb default buttons are flat by default
|
2015-12-16 23:38:44 +03:00
|
|
|
.btn {
|
2015-11-02 23:39:13 +03:00
|
|
|
position: relative;
|
2015-12-17 02:19:02 +03:00
|
|
|
margin-bottom: $mdb-btn-margin-bottom; // just enough room so that focus shadows aren't covered up
|
2015-12-16 23:38:44 +03:00
|
|
|
font-size: $mdb-btn-font-size;
|
2015-11-02 23:39:13 +03:00
|
|
|
text-decoration: none;
|
2015-12-16 23:38:44 +03:00
|
|
|
text-transform: uppercase;
|
|
|
|
letter-spacing: 0;
|
2015-12-07 22:34:46 +03:00
|
|
|
cursor: pointer;
|
2015-12-16 23:38:44 +03:00
|
|
|
background-color: transparent;
|
2015-12-07 22:34:46 +03:00
|
|
|
border: 0;
|
|
|
|
outline: none;
|
2015-12-16 23:38:44 +03:00
|
|
|
box-shadow: none;
|
2015-12-07 22:34:46 +03:00
|
|
|
transition: box-shadow 0.2s $mdb-animation-curve-fast-out-linear-in, background-color 0.2s $mdb-animation-curve-default, color 0.2s $mdb-animation-curve-default;
|
|
|
|
will-change: box-shadow, transform;
|
|
|
|
|
2015-12-17 02:19:02 +03:00
|
|
|
@include undo-bs-tab-focus();
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-12-16 23:38:44 +03:00
|
|
|
//--
|
|
|
|
// Colors
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-16 23:38:44 +03:00
|
|
|
// flat removes bg, add color variations to text
|
|
|
|
@include mdb-button-color();
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-16 23:38:44 +03:00
|
|
|
// fab and raised are colored, add their text and bg
|
2015-12-09 00:08:18 +03:00
|
|
|
&.btn-fab,
|
2015-12-16 23:38:44 +03:00
|
|
|
&.btn-raised,
|
2015-12-09 00:08:18 +03:00
|
|
|
.btn-group-raised & {
|
2015-12-16 23:38:44 +03:00
|
|
|
@include mdb-button-colored();
|
2015-11-25 01:34:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
//---
|
|
|
|
// btn-raised
|
2015-12-09 00:08:18 +03:00
|
|
|
&.btn-raised,
|
|
|
|
.btn-group-raised & {
|
2015-11-22 19:23:34 +03:00
|
|
|
|
2015-12-17 02:19:02 +03:00
|
|
|
// baseline shadow
|
|
|
|
@include shadow-2dp();
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-17 02:19:02 +03:00
|
|
|
// contrast bg colors on hover, focus, active
|
|
|
|
@include mdb-hover-focus-active() {
|
|
|
|
@include mdb-button-colored-bg(true);
|
|
|
|
//border: 1px solid $red;
|
|
|
|
}
|
|
|
|
|
|
|
|
// enlarged shadow on hover, focus
|
|
|
|
@include hover-focus() {
|
|
|
|
//border: 1px solid $blue;
|
|
|
|
@include shadow-4dp();
|
|
|
|
}
|
|
|
|
|
|
|
|
// :active - momentary press: big shadow, release and it is gone
|
|
|
|
// .active - persistent big shadow
|
|
|
|
&.active,
|
|
|
|
&:active {
|
|
|
|
@include focus-shadow();
|
|
|
|
//border: 1px solid $green;
|
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-17 02:19:02 +03:00
|
|
|
// reverse any of the above for links
|
|
|
|
&.btn-link {
|
|
|
|
box-shadow: none;
|
|
|
|
@include mdb-hover-focus-active() {
|
|
|
|
box-shadow: none;
|
2015-11-22 19:23:34 +03:00
|
|
|
}
|
|
|
|
}
|
2015-12-17 02:19:02 +03:00
|
|
|
|
|
|
|
@include mdb-disabled() {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2015-11-22 19:23:34 +03:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
&.btn-fab {
|
|
|
|
// see above for color variations
|
2015-12-07 22:34:46 +03:00
|
|
|
position: relative;
|
2015-11-25 01:34:17 +03:00
|
|
|
width: $mdb-btn-fab-size;
|
2015-12-07 22:34:46 +03:00
|
|
|
min-width: $mdb-btn-fab-size;
|
|
|
|
height: $mdb-btn-fab-size;
|
2015-11-25 01:34:17 +03:00
|
|
|
padding: 0;
|
2015-12-07 22:34:46 +03:00
|
|
|
margin: auto;
|
2015-11-25 01:34:17 +03:00
|
|
|
overflow: hidden;
|
2015-12-07 22:34:46 +03:00
|
|
|
font-size: $mdb-btn-fab-font-size;
|
2015-11-25 01:34:17 +03:00
|
|
|
line-height: normal;
|
2015-12-07 22:34:46 +03:00
|
|
|
border-radius: 50%;
|
2015-12-17 02:19:02 +03:00
|
|
|
box-shadow: 0 1px 1.5px 0 $gray-lighter, 0 1px 1px 0 $gray-light;
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
.ripple-container {
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
&.btn-fab-mini,
|
|
|
|
.btn-group-sm & {
|
|
|
|
width: $mdb-btn-fab-size-mini;
|
2015-12-07 22:34:46 +03:00
|
|
|
min-width: $mdb-btn-fab-size-mini;
|
|
|
|
height: $mdb-btn-fab-size-mini;
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
&.material-icons {
|
|
|
|
top: ($mdb-btn-icon-size-mini - $mdb-btn-fab-font-size) / 2;
|
|
|
|
left: ($mdb-btn-icon-size-mini - $mdb-btn-fab-font-size) / 2;
|
|
|
|
}
|
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
i.material-icons {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
width: $mdb-btn-fab-font-size;
|
2015-12-07 22:34:46 +03:00
|
|
|
line-height: $mdb-btn-fab-font-size;
|
|
|
|
transform: translate(-($mdb-btn-fab-font-size / 2), -($mdb-btn-fab-font-size / 2));
|
2014-10-03 15:58:24 +04:00
|
|
|
}
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// Align icons inside buttons with text
|
|
|
|
i.material-icons {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
2015-11-02 23:39:13 +03:00
|
|
|
// Size variations
|
2015-11-25 01:34:17 +03:00
|
|
|
&.btn-lg,
|
|
|
|
.btn-group-lg & {
|
|
|
|
font-size: $mdb-btn-font-size-lg;
|
|
|
|
}
|
|
|
|
&.btn-sm,
|
|
|
|
.btn-group-sm & {
|
2015-11-02 23:39:13 +03:00
|
|
|
padding: 5px 20px;
|
2015-11-25 01:34:17 +03:00
|
|
|
font-size: $mdb-btn-font-size-sm;
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// Disabled buttons and button groups
|
|
|
|
.btn,
|
|
|
|
.input-group-btn .btn,
|
|
|
|
.btn-group,
|
|
|
|
.btn-group-vertical {
|
|
|
|
// have to ratchet up the specificity to kill drop shadows on disabled raised buttons
|
2015-12-17 02:19:02 +03:00
|
|
|
@include mdb-disabled() {
|
2015-12-16 23:38:44 +03:00
|
|
|
color: $mdb-btn-disabled;
|
2015-11-25 01:34:17 +03:00
|
|
|
.theme-dark & {
|
2015-12-16 23:38:44 +03:00
|
|
|
color: $mdb-btn-disabled-dark;
|
2014-10-03 15:58:24 +04:00
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-16 23:38:44 +03:00
|
|
|
// flat buttons shouldn't lose transparency on disabled hover/focus
|
|
|
|
&,
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: transparent;
|
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
|
|
|
// no box-shadow on raised - need specificity
|
2015-12-16 23:38:44 +03:00
|
|
|
//&.btn-raised,
|
|
|
|
//&.btn-group-raised {
|
|
|
|
// &,
|
|
|
|
// &.active,
|
|
|
|
// &:active,
|
|
|
|
// &:focus:not(:active) {
|
|
|
|
// box-shadow: none;
|
|
|
|
// }
|
|
|
|
//}
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
}
|
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// btn-group variations
|
|
|
|
.btn-group,
|
|
|
|
.btn-group-vertical {
|
|
|
|
|
2015-11-02 23:39:13 +03:00
|
|
|
position: relative;
|
|
|
|
margin: 10px 1px;
|
2014-10-03 15:58:24 +04:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// spec: https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons
|
|
|
|
&.open {
|
|
|
|
.dropdown-toggle {
|
|
|
|
//box-shadow: none;
|
|
|
|
}
|
|
|
|
|
2015-12-07 22:34:46 +03:00
|
|
|
> .dropdown-toggle.btn {
|
2015-12-16 23:38:44 +03:00
|
|
|
@include mdb-button-colored-bg();
|
2015-11-25 01:34:17 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
2015-12-10 20:53:55 +03:00
|
|
|
border-radius: 0 0 $border-radius $border-radius;
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-11-02 23:39:13 +03:00
|
|
|
&.btn-group-raised {
|
2015-11-25 01:34:17 +03:00
|
|
|
@include shadow-2dp();
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
2015-12-07 22:34:46 +03:00
|
|
|
.btn + .btn,
|
2015-11-25 01:34:17 +03:00
|
|
|
.btn,
|
|
|
|
.btn:active,
|
|
|
|
.btn-group {
|
2015-11-02 23:39:13 +03:00
|
|
|
margin: 0;
|
|
|
|
}
|
2014-10-03 15:58:24 +04:00
|
|
|
}
|