2016-01-12 00:43:11 +03:00
|
|
|
// Menus https://www.google.com/design/spec/components/menus.html#menus-specs
|
|
|
|
// Dropdown buttons (mobile and desktop) https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons
|
|
|
|
|
2016-01-12 02:13:01 +03:00
|
|
|
%menu-bottom-left {
|
|
|
|
top: 100%;
|
|
|
|
left: 0;
|
|
|
|
transform-origin: 0 0;
|
|
|
|
}
|
2016-01-12 00:43:11 +03:00
|
|
|
|
2016-01-12 02:13:01 +03:00
|
|
|
%menu-bottom-right {
|
|
|
|
right: 0;
|
|
|
|
left: auto;
|
|
|
|
transform-origin: 100% 0;
|
2016-01-12 00:43:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
display: block; // utilize transition transform instead of flipping display
|
|
|
|
padding: .5rem 0;
|
|
|
|
border: 0;
|
|
|
|
opacity: 0;
|
2016-01-12 02:13:01 +03:00
|
|
|
transition: transform $mdb-menu-expand-duration $mdb-animation-curve-default, opacity $mdb-menu-fade-duration $mdb-animation-curve-default;
|
2016-01-12 00:43:11 +03:00
|
|
|
transform: scale(0);
|
|
|
|
transform-origin: 0 0;
|
|
|
|
will-change: transform;
|
|
|
|
@include shadow-2dp();
|
|
|
|
|
|
|
|
.open > & {
|
|
|
|
//z-index: 999;
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
|
2016-01-12 02:13:01 +03:00
|
|
|
// Default the alignment on the button to bottom right
|
|
|
|
//@extend %menu-bottom-right;
|
|
|
|
// FIXME: bootstrap alignment issue - https://github.com/twbs/bootstrap/issues/18852
|
|
|
|
// FIXME: once the bug is fixed, want to default origin of menu open to the right of standard buttons
|
|
|
|
|
|
|
|
&.dropdown-menu-left {
|
|
|
|
@extend %menu-bottom-left;
|
|
|
|
}
|
|
|
|
|
2016-01-12 00:43:11 +03:00
|
|
|
&.dropdown-menu-right {
|
2016-01-12 02:13:01 +03:00
|
|
|
@extend %menu-bottom-right;
|
2016-01-12 00:43:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
&.dropdown-menu-top-left {
|
|
|
|
top: auto;
|
|
|
|
bottom: 0; // needs to be overridden with the toggle-button height, see mdb-btn-icon above
|
|
|
|
transform-origin: 0 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.dropdown-menu-top-right {
|
|
|
|
top: auto;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0; // needs to be overridden with the toggle-button height, see mdb-btn-icon above
|
|
|
|
left: auto;
|
|
|
|
transform-origin: 100% 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://www.google.com/design/spec/components/menus.html#menus-specs
|
|
|
|
.dropdown-item {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
min-width: $mdb-menu-item-min-width;
|
|
|
|
max-width: $mdb-menu-item-max-width;
|
|
|
|
min-height: $mdb-menu-item-min-height;
|
|
|
|
|
|
|
|
flex-flow: row wrap;
|
2016-01-14 21:08:28 +03:00
|
|
|
align-items: center;
|
2016-01-12 00:43:11 +03:00
|
|
|
|
|
|
|
padding-top: $mdb-menu-item-padding-top;
|
|
|
|
padding-right: $mdb-menu-item-padding-right;
|
|
|
|
padding-bottom: $mdb-menu-item-padding-bottom;
|
|
|
|
padding-left: $mdb-menu-item-padding-left;
|
|
|
|
|
2016-01-14 21:08:28 +03:00
|
|
|
|
2016-01-12 00:43:11 +03:00
|
|
|
// FIXME: multi-line menu word wrapping doesn't work - see the maximum width example in menus.md
|
|
|
|
overflow: hidden;
|
|
|
|
line-height: $mdb-menu-line-height;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
|
|
|
|
|
|
|
// Simple menus always maintain a 16dp margin (phone) or 24dp margin (tablet) to the left and right edges of the screen.
|
|
|
|
@include media-breakpoint-up(md) {
|
|
|
|
padding-right: $mdb-menu-item-padding-right-md;
|
|
|
|
padding-left: $mdb-menu-item-padding-left-md;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-01-12 02:13:01 +03:00
|
|
|
|
|
|
|
.dropdown {
|
|
|
|
|
|
|
|
.dropdown-toggle {
|
|
|
|
|
|
|
|
&.mdb-btn-icon,
|
|
|
|
&.mdb-btn-fab {
|
|
|
|
// remove the dropdown icon
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
~ .dropdown-menu {
|
|
|
|
&.dropdown-menu-top-left,
|
|
|
|
&.dropdown-menu-top-right {
|
|
|
|
bottom: $mdb-btn-icon-size; // push up the bottom of the menu the height of the button
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mdb-btn-fab-sm {
|
|
|
|
~ .dropdown-menu {
|
|
|
|
&.dropdown-menu-top-left,
|
|
|
|
&.dropdown-menu-top-right {
|
|
|
|
bottom: $mdb-btn-fab-size-sm; // push up the bottom of the menu the height of the button
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mdb-btn-icon {
|
|
|
|
~ .dropdown-menu {
|
|
|
|
// collapse some spacing
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|