2015-11-24 20:33:04 +03:00
|
|
|
// specification: https://www.google.com/design/spec/components/buttons.html
|
|
|
|
|
2015-11-24 02:43:41 +03:00
|
|
|
.typo-button(@colorContrast: false) {
|
2015-11-24 23:27:01 +03:00
|
|
|
font-size: @mdb-btn-font-size-base;
|
2015-11-24 02:43:41 +03:00
|
|
|
font-weight: 500;
|
|
|
|
text-transform: uppercase;
|
|
|
|
//line-height: 1;
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
|
|
& when (@colorContrast) {
|
|
|
|
opacity: 0.87;
|
2015-11-04 23:23:20 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-24 20:33:04 +03:00
|
|
|
// mdb default buttons are flat by default
|
|
|
|
// synchronized with mdl 11/23/15
|
2015-11-24 02:43:41 +03:00
|
|
|
.btn,
|
|
|
|
.input-group-btn .btn {
|
|
|
|
border: none;
|
2015-11-24 23:13:29 +03:00
|
|
|
border-radius: @border-radius-base;
|
2014-12-18 15:59:34 +03:00
|
|
|
position: relative;
|
|
|
|
padding: 8px 30px;
|
|
|
|
margin: 10px 1px;
|
2015-11-24 02:43:41 +03:00
|
|
|
.typo-button();
|
|
|
|
will-change: box-shadow, transform;
|
|
|
|
transition: box-shadow 0.2s @mdb-animation-curve-fast-out-linear-in,
|
2015-11-24 20:33:04 +03:00
|
|
|
background-color 0.2s @mdb-animation-curve-default,
|
|
|
|
color 0.2s @mdb-animation-curve-default;
|
2015-12-24 20:38:08 +03:00
|
|
|
outline: 0;
|
2014-12-18 15:59:34 +03:00
|
|
|
cursor: pointer;
|
|
|
|
text-decoration: none;
|
2014-08-18 18:25:33 +04:00
|
|
|
|
2015-11-24 20:33:04 +03:00
|
|
|
&::-moz-focus-inner {
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
2015-11-24 02:43:41 +03:00
|
|
|
//---
|
|
|
|
// btn-flat
|
2015-11-24 20:33:04 +03:00
|
|
|
background: transparent;
|
|
|
|
&:not(.btn-raised) {
|
2015-11-24 02:43:41 +03:00
|
|
|
.variations(~".btn", ~"", color, @mdb-text-color-primary);
|
|
|
|
box-shadow: none;
|
|
|
|
|
2015-11-24 20:33:04 +03:00
|
|
|
&:not(.btn-link) {
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
// spec: flat/light bg Hover: 20% #999999
|
|
|
|
background-color: fade(#999999, 20%);
|
2015-11-24 02:43:41 +03:00
|
|
|
|
2015-11-24 20:33:04 +03:00
|
|
|
.theme-dark & {
|
|
|
|
// spec: dark bg Hover: 15% #CCCCCC
|
|
|
|
background-color: fade(#CCCCCC, 15%);
|
|
|
|
}
|
|
|
|
}
|
2015-11-22 19:23:34 +03:00
|
|
|
}
|
2014-12-18 15:59:34 +03:00
|
|
|
}
|
2015-11-22 19:23:34 +03:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
//--
|
|
|
|
// color variations
|
|
|
|
&.btn-raised,
|
2015-12-08 23:53:40 +03:00
|
|
|
&.btn-fab,
|
|
|
|
.btn-group-raised & {
|
2015-11-25 01:34:17 +03:00
|
|
|
.background-variations(~".btn", ~"", @mdb-btn-background-color);
|
|
|
|
}
|
|
|
|
|
2015-11-24 23:27:01 +03:00
|
|
|
//---
|
|
|
|
// btn-raised
|
2015-12-08 23:53:40 +03:00
|
|
|
&.btn-raised,
|
|
|
|
.btn-group-raised & {
|
2015-11-24 20:33:04 +03:00
|
|
|
&:not(.btn-link) {
|
|
|
|
.shadow-2dp();
|
2015-11-24 23:54:42 +03:00
|
|
|
|
2015-12-08 23:39:12 +03:00
|
|
|
// colors on hover, focus, active
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&.active,
|
|
|
|
&:active {
|
|
|
|
|
2015-12-24 20:43:57 +03:00
|
|
|
outline: 0;
|
|
|
|
|
2015-12-08 23:39:12 +03:00
|
|
|
// FIXME: SPEC - this should be the 600 color, how can we get that programmatically if at all? Or are we limited to the color palette only?
|
|
|
|
// SASS conversion note: please mirror any content change in _mixins-shared.scss button-variations-content
|
|
|
|
.generic-variations(~".btn", ~"", @mdb-btn-background-color, {
|
2015-12-08 23:53:40 +03:00
|
|
|
background-color: contrast(@variation-color, darken(@variation-color, 4%), lighten(@variation-color, 4%), @contrast-factor);
|
|
|
|
});
|
2015-11-24 20:33:04 +03:00
|
|
|
|
|
|
|
// Spec:
|
|
|
|
// - Raised Light/Light theme no hover.
|
|
|
|
// - Raised Dark/Dark theme Hover color: 600
|
|
|
|
.theme-dark & {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-08 23:39:12 +03:00
|
|
|
// shadow on active
|
2015-11-24 20:33:04 +03:00
|
|
|
&.active,
|
|
|
|
&:active {
|
2015-12-08 23:39:12 +03:00
|
|
|
&,
|
|
|
|
&:hover {
|
|
|
|
.shadow-4dp();
|
|
|
|
}
|
2015-11-24 20:33:04 +03:00
|
|
|
}
|
|
|
|
|
2015-12-08 23:39:12 +03:00
|
|
|
// shadow on focus
|
|
|
|
// Focus should take precedence over active, so specificity is needed
|
|
|
|
&:focus {
|
|
|
|
&,
|
|
|
|
&.active,
|
|
|
|
&:active {
|
|
|
|
&,
|
|
|
|
&:hover {
|
|
|
|
.focus-shadow();
|
|
|
|
}
|
|
|
|
}
|
2015-11-24 20:33:04 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-08-20 14:53:26 +04:00
|
|
|
|
2014-12-18 15:59:34 +03:00
|
|
|
&.btn-fab {
|
2015-11-25 01:34:17 +03:00
|
|
|
// see above for color variations
|
2015-11-24 02:43:41 +03:00
|
|
|
border-radius: 50%;
|
|
|
|
font-size: @mdb-btn-fab-font-size;
|
|
|
|
height: @mdb-btn-fab-size;
|
|
|
|
margin: auto;
|
|
|
|
min-width: @mdb-btn-fab-size;
|
|
|
|
width: @mdb-btn-fab-size;
|
|
|
|
padding: 0;
|
|
|
|
overflow: hidden;
|
2015-11-24 20:33:04 +03:00
|
|
|
box-shadow: 0 1px 1.5px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24);
|
2015-11-24 02:43:41 +03:00
|
|
|
position: relative;
|
|
|
|
line-height: normal;
|
2015-11-24 20:33:04 +03:00
|
|
|
|
2015-11-24 02:43:41 +03:00
|
|
|
.ripple-container {
|
|
|
|
border-radius: 50%;
|
2014-12-18 15:59:34 +03:00
|
|
|
}
|
2015-11-24 02:43:41 +03:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
&.btn-fab-mini,
|
|
|
|
.btn-group-sm & {
|
|
|
|
height: @mdb-btn-fab-size-mini;
|
|
|
|
min-width: @mdb-btn-fab-size-mini;
|
|
|
|
width: @mdb-btn-fab-size-mini;
|
2015-11-24 02:43:41 +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-12-18 15:59:34 +03:00
|
|
|
}
|
2015-11-24 02:43:41 +03:00
|
|
|
|
|
|
|
i.material-icons {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-(@mdb-btn-fab-font-size / 2), -(@mdb-btn-fab-font-size / 2));
|
|
|
|
line-height: @mdb-btn-fab-font-size;
|
|
|
|
width: @mdb-btn-fab-font-size;
|
2014-12-18 15:59:34 +03:00
|
|
|
}
|
|
|
|
}
|
2014-10-12 17:46:56 +04:00
|
|
|
|
2015-11-24 02:43:41 +03:00
|
|
|
// Align icons inside buttons with text
|
|
|
|
i.material-icons {
|
|
|
|
vertical-align: middle;
|
2014-12-18 15:59:34 +03:00
|
|
|
}
|
2015-11-25 01:34:17 +03:00
|
|
|
|
|
|
|
// Size variations
|
|
|
|
&.btn-lg,
|
|
|
|
.btn-group-lg & {
|
|
|
|
font-size: @mdb-btn-font-size-lg;
|
|
|
|
}
|
|
|
|
&.btn-sm,
|
|
|
|
.btn-group-sm & {
|
|
|
|
padding: 5px 20px;
|
|
|
|
font-size: @mdb-btn-font-size-sm;
|
|
|
|
}
|
|
|
|
&.btn-xs,
|
|
|
|
.btn-group-xs & {
|
|
|
|
padding: 4px 15px;
|
|
|
|
font-size: @mdb-btn-font-size-xs;
|
|
|
|
}
|
2015-11-24 23:54:42 +03:00
|
|
|
}
|
2015-11-24 20:33:04 +03:00
|
|
|
|
2015-11-24 23:54:42 +03:00
|
|
|
// Disabled buttons and button groups
|
|
|
|
.btn,
|
|
|
|
.input-group-btn .btn,
|
2015-11-25 01:34:17 +03:00
|
|
|
.btn-group,
|
|
|
|
.btn-group-vertical {
|
2015-11-24 23:54:42 +03:00
|
|
|
// have to ratchet up the specificity to kill drop shadows on disabled raised buttons
|
|
|
|
fieldset[disabled][disabled] &,
|
2015-11-24 20:33:04 +03:00
|
|
|
&.disabled,
|
2015-11-24 23:54:42 +03:00
|
|
|
&:disabled,
|
|
|
|
&[disabled][disabled] {
|
|
|
|
// spec: light theme: Disabled text: 26% #000000
|
2015-11-24 20:33:04 +03:00
|
|
|
color: fade(#000000, 26%);
|
|
|
|
.theme-dark & {
|
2015-11-24 23:54:42 +03:00
|
|
|
// spec: dark theme: Disabled text: 30% #FFFFFF
|
2015-11-24 20:33:04 +03:00
|
|
|
color: fade(#FFFFFF, 30%);
|
|
|
|
}
|
2015-11-24 23:13:29 +03:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// flat buttons lose transparency
|
2015-11-24 23:13:29 +03:00
|
|
|
background: transparent;
|
2015-11-24 23:54:42 +03:00
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// no box-shadow on raised - need specificity
|
2015-11-24 23:54:42 +03:00
|
|
|
&.btn-raised,
|
|
|
|
&.btn-group-raised {
|
|
|
|
&,
|
|
|
|
&.active,
|
|
|
|
&:active,
|
|
|
|
&:focus:not(:active) {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
2015-11-24 20:33:04 +03:00
|
|
|
}
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
|
|
|
|
2015-11-24 23:13:29 +03:00
|
|
|
// btn-group variations
|
|
|
|
.btn-group,
|
|
|
|
.btn-group-vertical {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
//border-radius: 2px;
|
|
|
|
margin: 10px 1px;
|
|
|
|
|
2015-11-25 01:34:17 +03:00
|
|
|
// spec: https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons
|
2015-11-24 23:13:29 +03:00
|
|
|
&.open {
|
|
|
|
.dropdown-toggle {
|
|
|
|
//box-shadow: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > .dropdown-toggle.btn {
|
|
|
|
.variations(~".btn", ~"", background-color, @mdb-btn-background-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
border-radius: 0 0 @border-radius-base @border-radius-base;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.btn-group-raised {
|
|
|
|
.shadow-2dp();
|
|
|
|
}
|
|
|
|
|
2015-11-24 23:54:42 +03:00
|
|
|
& .btn + .btn,
|
2015-11-24 23:13:29 +03:00
|
|
|
.btn,
|
|
|
|
.btn:active,
|
|
|
|
.btn-group {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|