2 * Copyright 2015 Google Inc. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 @import "../variables";
20 // The button component. Defaults to a flat button.
22 background: transparent;
24 border-radius: $button-border-radius;
25 color: $button-secondary-color;
27 height: $button-height;
29 min-width: $button-min-width;
30 padding: 0 $button-padding;
31 display: inline-block;
32 @include typo-button();
34 will-change: box-shadow;
35 transition: box-shadow 0.2s $animation-curve-fast-out-linear-in,
36 background-color 0.2s $animation-curve-default,
37 color 0.2s $animation-curve-default;
40 text-decoration: none;
42 line-height: $button-height;
43 vertical-align: middle;
50 background-color: $button-hover-color;
53 &:focus:not(:active) {
54 background-color: $button-focus-color;
58 background-color: $button-active-color;
61 &.mdl-button--colored {
62 color: $button-primary-color-alt;
64 &:focus:not(:active) {
65 background-color: $button-focus-color-alt;
70 input.mdl-button[type="submit"] {
71 -webkit-appearance:none;
76 background: $button-primary-color;
77 @include shadow-2dp();
80 @include shadow-4dp();
81 background-color: $button-active-color;
84 &:focus:not(:active) {
85 @include focus-shadow();
86 background-color: $button-active-color;
89 &.mdl-button--colored {
90 background: $button-primary-color-alt;
91 color: $button-secondary-color-alt;
94 background-color: $button-hover-color-alt;
98 background-color: $button-active-color-alt;
101 &:focus:not(:active) {
102 background-color: $button-active-color-alt;
106 background: $button-ripple-color-alt;
115 font-size: $button-fab-font-size;
116 height: $button-fab-size;
118 min-width: $button-fab-size;
119 width: $button-fab-size;
122 background: $button-primary-color;
123 box-shadow: 0 1px 1.5px 0 rgba(0,0,0,0.12), 0 1px 1px 0 rgba(0,0,0,0.24);
131 transform: translate(- $button-fab-font-size / 2, - $button-fab-font-size / 2);
132 line-height: $button-fab-font-size;
133 width: $button-fab-font-size;
136 &.mdl-button--mini-fab {
137 height: $button-fab-size-mini;
138 min-width: $button-fab-size-mini;
139 width: $button-fab-size-mini;
142 & .mdl-button__ripple-container {
144 // Fixes clipping bug in Safari.
145 -webkit-mask-image: -webkit-radial-gradient(circle, white, black);
149 @include shadow-4dp();
150 background-color: $button-active-color;
153 &:focus:not(:active) {
154 @include focus-shadow();
155 background-color: $button-active-color;
158 &.mdl-button--colored {
159 background: $button-fab-color-alt;
160 color: $button-fab-text-color-alt;
163 background-color: $button-fab-hover-color-alt;
166 &:focus:not(:active) {
167 background-color: $button-fab-active-color-alt;
171 background-color: $button-fab-active-color-alt;
175 background: $button-fab-ripple-color-alt;
184 font-size: $button-fab-font-size;
185 height: $button-icon-size;
188 min-width: $button-icon-size;
189 width: $button-icon-size;
199 transform: translate(- $button-fab-font-size / 2, - $button-fab-font-size / 2);
200 line-height: $button-fab-font-size;
201 width: $button-fab-font-size;
204 &.mdl-button--mini-icon {
205 height: $button-icon-size-mini;
206 min-width: $button-icon-size-mini;
207 width: $button-icon-size-mini;
210 top: ($button-icon-size-mini - $button-fab-font-size) / 2;
211 left: ($button-icon-size-mini - $button-fab-font-size) / 2;
215 & .mdl-button__ripple-container {
217 // Fixes clipping bug in Safari.
218 -webkit-mask-image: -webkit-radial-gradient(circle, white, black);
224 .mdl-button__ripple-container {
234 .mdl-button[disabled] & .mdl-ripple,
235 .mdl-button.mdl-button--disabled & .mdl-ripple {
236 background-color: transparent;
242 .mdl-button--primary.mdl-button--primary {
243 color: $button-primary-color-alt;
245 background: $button-secondary-color-alt;
247 &.mdl-button--raised, &.mdl-button--fab {
248 color: $button-secondary-color-alt;
249 background-color: $button-primary-color-alt;
253 .mdl-button--accent.mdl-button--accent {
254 color: $button-fab-color-alt;
256 background: $button-fab-text-color-alt;
258 &.mdl-button--raised, &.mdl-button--fab {
259 color: $button-fab-text-color-alt;
260 background-color: $button-fab-color-alt;
267 // Bump up specificity by using [disabled] twice.
268 &[disabled][disabled],
269 &.mdl-button--disabled.mdl-button--disabled {
270 color: $button-secondary-color-disabled;
272 background-color: transparent;
276 // Bump up specificity by using [disabled] twice.
277 &[disabled][disabled],
278 &.mdl-button--disabled.mdl-button--disabled {
279 background-color: $button-primary-color-disabled;
280 color: $button-secondary-color-disabled;
285 // Bump up specificity by using [disabled] twice.
286 &[disabled][disabled],
287 &.mdl-button--disabled.mdl-button--disabled {
288 background-color: $button-primary-color-disabled;
289 color: $button-secondary-color-disabled;
294 // Bump up specificity by using [disabled] twice.
295 &[disabled][disabled],
296 &.mdl-button--disabled.mdl-button--disabled {
297 color: $button-secondary-color-disabled;
302 // Align icons inside buttons with text
303 .mdl-button .material-icons {
304 vertical-align: middle;