2016-01-26 21:12:48 +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
|
|
|
|
|
|
|
|
.dropdown-menu {
|
2017-10-19 15:36:30 +03:00
|
|
|
display: none;
|
2016-08-03 00:58:18 +03:00
|
|
|
padding: .25rem 0;
|
2016-01-26 21:12:48 +03:00
|
|
|
border: 0;
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(0);
|
|
|
|
transform-origin: 0 0;
|
2017-10-19 15:36:30 +03:00
|
|
|
will-change: transform, opacity;
|
|
|
|
transition: transform $bmd-menu-expand-duration $bmd-animation-curve-default,
|
|
|
|
opacity $bmd-menu-fade-duration $bmd-animation-curve-default;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-08-03 00:58:18 +03:00
|
|
|
@include media-breakpoint-up(md) {
|
|
|
|
padding: .5rem 0;
|
|
|
|
}
|
|
|
|
|
2017-10-19 15:36:30 +03:00
|
|
|
&.showing {
|
|
|
|
animation-name: bmd-dropdown-animation;
|
|
|
|
animation-duration: $bmd-menu-expand-duration;
|
|
|
|
animation-fill-mode: forwards;
|
|
|
|
animation-timing-function: $bmd-animation-curve-default;
|
|
|
|
}
|
|
|
|
|
2017-08-31 16:36:40 +03:00
|
|
|
.open > &,
|
|
|
|
&.show {
|
2017-10-19 15:36:30 +03:00
|
|
|
display: block;
|
2016-01-26 21:12:48 +03:00
|
|
|
opacity: 1;
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
|
2017-10-19 15:36:30 +03:00
|
|
|
&.hiding {
|
|
|
|
display: block;
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2017-12-10 20:03:53 +03:00
|
|
|
&[x-placement="bottom-start"],
|
|
|
|
&.dropdown-menu-left {
|
2017-10-19 15:36:30 +03:00
|
|
|
transform-origin: 0 0;
|
2016-03-28 22:46:33 +03:00
|
|
|
}
|
|
|
|
|
2017-12-10 20:03:53 +03:00
|
|
|
&[x-placement="bottom-end"],
|
|
|
|
&.dropdown-menu-right {
|
2017-10-19 15:36:30 +03:00
|
|
|
transform-origin: 100% 0;
|
2016-03-28 22:46:33 +03:00
|
|
|
}
|
|
|
|
|
2017-10-19 15:36:30 +03:00
|
|
|
&[x-placement="top-start"] {
|
|
|
|
transform-origin: 0 100%;
|
|
|
|
}
|
2016-08-04 13:10:14 +03:00
|
|
|
|
2017-10-19 15:36:30 +03:00
|
|
|
&[x-placement="top-end"] {
|
|
|
|
transform-origin: 100% 100%;
|
2016-08-04 13:10:14 +03:00
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
|
|
|
|
// https://www.google.com/design/spec/components/menus.html#menus-specs
|
|
|
|
.dropdown-item {
|
2016-08-02 22:10:05 +03:00
|
|
|
// used to properly size the ripple container
|
|
|
|
position: relative;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
|
|
|
display: flex;
|
2016-02-08 22:42:01 +03:00
|
|
|
flex-flow: row wrap;
|
2016-04-29 23:27:08 +03:00
|
|
|
align-items: center;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-28 23:18:19 +03:00
|
|
|
min-width: $bmd-menu-item-min-width;
|
|
|
|
max-width: $bmd-menu-item-max-width;
|
|
|
|
min-height: $bmd-menu-item-min-height;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2017-08-11 17:59:31 +03:00
|
|
|
padding: $bmd-menu-item-padding-top $bmd-menu-item-padding-right
|
|
|
|
$bmd-menu-item-padding-bottom $bmd-menu-item-padding-left;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
|
|
|
// FIXME: multi-line menu word wrapping doesn't work - see the maximum width example in menus.md
|
|
|
|
overflow: hidden;
|
2016-03-28 23:18:19 +03:00
|
|
|
line-height: $bmd-menu-line-height;
|
2016-01-26 21:12:48 +03:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
2017-12-17 16:09:00 +03:00
|
|
|
&.active,
|
|
|
|
&:active {
|
|
|
|
background-color: inherit;
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
// 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) {
|
2016-03-28 23:18:19 +03:00
|
|
|
padding-right: $bmd-menu-item-padding-right-md;
|
|
|
|
padding-left: $bmd-menu-item-padding-left-md;
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-28 22:46:33 +03:00
|
|
|
// this could be in a .btn-group or .dropdown
|
|
|
|
.dropdown-toggle {
|
|
|
|
&.bmd-btn-icon,
|
|
|
|
&.bmd-btn-fab {
|
|
|
|
// remove the dropdown icon
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-28 22:46:33 +03:00
|
|
|
~ .dropdown-menu {
|
|
|
|
&.dropdown-menu-top-left,
|
|
|
|
&.dropdown-menu-top-right {
|
2016-03-28 23:18:19 +03:00
|
|
|
bottom: $bmd-btn-icon-size; // push up the bottom of the menu the height of the button
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
2016-03-28 22:46:33 +03:00
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-28 22:46:33 +03:00
|
|
|
&.bmd-btn-fab-sm {
|
|
|
|
~ .dropdown-menu {
|
|
|
|
&.dropdown-menu-top-left,
|
|
|
|
&.dropdown-menu-top-right {
|
2016-03-28 23:18:19 +03:00
|
|
|
bottom: $bmd-btn-fab-size-sm; // push up the bottom of the menu the height of the button
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
2016-03-28 22:46:33 +03:00
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-28 22:46:33 +03:00
|
|
|
&.bmd-btn-icon {
|
|
|
|
~ .dropdown-menu {
|
|
|
|
// collapse some spacing
|
|
|
|
margin: 0;
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
2017-12-17 16:09:00 +03:00
|
|
|
|
|
|
|
.show &.btn {
|
|
|
|
&,
|
|
|
|
&-secondary,
|
|
|
|
&-success,
|
|
|
|
&-info,
|
|
|
|
&-warning,
|
|
|
|
&-danger {
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
}
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
2017-10-19 15:36:30 +03:00
|
|
|
|
|
|
|
@keyframes bmd-dropdown-animation {
|
|
|
|
from {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|