// specification: https://www.google.com/design/spec/components/buttons.html // mdb default buttons are flat by default .btn { position: relative; margin-bottom: $mdb-btn-margin-bottom; // just enough room so that focus shadows aren't covered up font-size: $mdb-btn-font-size; text-decoration: none; text-transform: uppercase; letter-spacing: 0; cursor: pointer; background-color: transparent; border: 0; outline: 0; 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; @include undo-bs-tab-focus(); //-- // Colors // flat removes bg, add color variations to text @include mdb-flat-button-color(); // fab and raised // - colored, add their text and bg // - hover color contrasted // - shared shadow state on hover/active/focus &.mdb-btn-fab, &.btn-raised, .btn-group-raised & { @include mdb-raised-button-color(); // enlarged shadow on hover, focus @include hover-focus() { //border: 1px solid $blue; z-index: 1; // add to the z-index so that the expanded shadow is above anything below it i.e. another button @include box-shadow($mdb-shadow-4dp); } // :active - momentary press: big shadow, release and it is gone // .active - persistent big shadow &.active, &:active { z-index: 1; // add to the z-index so that the expanded shadow is above anything below it i.e. another button @include box-shadow($mdb-shadow-focus); //border: 1px solid $green; } } //--- // btn-raised &.btn-raised, .btn-group-raised & { // baseline shadow @include box-shadow($mdb-shadow-2dp); // reverse any of the above for links &.btn-link { box-shadow: none; @include mdb-hover-focus-active() { box-shadow: none; } } @include mdb-disabled() { box-shadow: none; } } // https://www.google.com/design/spec/components/buttons-floating-action-button.html &.mdb-btn-fab, &.mdb-btn-icon { padding: 0; overflow: hidden; font-size: $mdb-btn-fab-font-size; line-height: normal; border-radius: 50%; .btn-group-sm & { padding: 0; // need specificity } .material-icons { position: absolute; top: 50%; left: 50%; width: $mdb-btn-fab-font-size; line-height: $mdb-btn-fab-font-size; transform: translate(-($mdb-btn-fab-font-size / 2), -($mdb-btn-fab-font-size / 2)); } } &.mdb-btn-fab { // see above for color variations width: $mdb-btn-fab-size; min-width: $mdb-btn-fab-size; height: $mdb-btn-fab-size; //margin: auto; //margin: 2px; // use z-index focus/hover/active instead. This is not called for in the spec, but it ensures room for the box-shadow, which is nice to have. box-shadow: 0 1px 1.5px 0 $gray-lighter, 0 1px 1px 0 $gray-light; .ripple-container { border-radius: 50%; } &.mdb-btn-fab-sm, .btn-group-sm & { width: $mdb-btn-fab-size-sm; min-width: $mdb-btn-fab-size-sm; height: $mdb-btn-fab-size-sm; //margin: 1px; // use z-index focus/hover/active instead. This is not called for in the spec, but it ensures room for the box-shadow, which is nice to have. //.material-icons { // top: ($mdb-btn-icon-size-sm - $mdb-btn-fab-font-size) / 2; // left: ($mdb-btn-icon-size-sm - $mdb-btn-fab-font-size) / 2; //} } } // Icon buttons &.mdb-btn-icon { width: $mdb-btn-icon-size; min-width: $mdb-btn-icon-size; height: $mdb-btn-icon-size; margin: 0; color: inherit; &.mdb-btn-icon-sm, .btn-group-sm & { width: $mdb-btn-icon-size-sm; min-width: $mdb-btn-icon-size-sm; height: $mdb-btn-icon-size-sm; .material-icons { //$position: ($mdb-btn-icon-size-sm - $mdb-btn-icon-font-size-sm) / 2; //top: $position; //left: $position; width: $mdb-btn-icon-font-size-sm; font-size: $mdb-btn-icon-font-size-sm; line-height: 1; transform: translate(-($mdb-btn-icon-font-size-sm / 2), -($mdb-btn-icon-font-size-sm / 2)); } } } // Align icons inside buttons with text i.material-icons { vertical-align: middle; } // Size variations &.btn-lg, .btn-group-lg & { @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $mdb-btn-font-size-lg, $line-height-lg, $btn-border-radius-lg); } &.btn-sm, .btn-group-sm & { @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $mdb-btn-font-size-sm, $line-height-sm, $btn-border-radius-sm); font-size: $mdb-btn-font-size-sm; } } // 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 @include mdb-disabled() { color: $mdb-btn-disabled; .bg-inverse & { color: $mdb-inverse-btn-disabled; } // flat buttons shouldn't lose transparency on disabled hover/focus &, &:hover, &:focus { background: transparent; } } } // btn-group variations .btn-group, .btn-group-vertical { position: relative; margin: 10px 1px; // spec: https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons //&.open { // .dropdown-toggle { // } // // > .dropdown-toggle.btn { // @include mdb-raised-button-color-bg(); // } //} .dropdown-menu { border-radius: 0 0 $border-radius $border-radius; } &.btn-group-raised { @include box-shadow($mdb-shadow-2dp); } .btn + .btn, .btn, .btn:active, .btn-group { margin: 0; } }