You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
soapbox/app/styles/components/dropdown-menu.scss

160 lines
3.0 KiB

5 years ago
.dropdown-menu {
@include font-size(13);
@include line-height(26);
@include font-weight(normal);
4 years ago
z-index: 9999;
position: absolute;
background: var(--background-color);
border-radius: 6px;
4 years ago
padding: 4px 0;
color: var(--primary-text-color);
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.5);
max-width: 300px;
&.left { transform-origin: 100% 50%; }
&.top { transform-origin: 50% 100%; }
&.bottom { transform-origin: 50% 0; }
&.right { transform-origin: 0 50%; }
4 years ago
&__arrow {
position: absolute;
width: 0;
height: 0;
border: 0 solid transparent;
4 years ago
&.left {
right: -5px;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: var(--background-color);
4 years ago
}
4 years ago
&.top {
bottom: -5px;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: var(--background-color);
4 years ago
}
4 years ago
&.bottom {
top: -5px;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: var(--background-color);
4 years ago
}
4 years ago
&.right {
left: -5px;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: var(--background-color);
4 years ago
}
}
4 years ago
ul {
overflow: hidden;
padding: 6px 0;
}
4 years ago
&__item a {
display: block;
box-sizing: border-box;
overflow: hidden;
padding: 3px 10px 1px;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--primary-text-color);
4 years ago
&:focus,
&:hover,
&:active {
outline: 0;
color: #fff;
background: var(--brand-color) !important;
* {
color: #fff;
}
4 years ago
}
}
4 years ago
&__separator {
display: block;
margin: 10px !important;
height: 1px;
background: var(--foreground-color);
4 years ago
}
&__item .account {
line-height: normal;
}
5 years ago
}
// end .dropdown-menu
// NOTE - not sure what this relates to — but it doesn't involve the navbar dropdown
.dropdown {
4 years ago
display: inline-block;
5 years ago
}
.dropdown__content {
4 years ago
display: none;
position: absolute;
5 years ago
}
.dropdown--active .dropdown__content {
4 years ago
display: block;
line-height: 18px;
max-width: 311px;
right: 0;
text-align: left;
z-index: 9999;
& > ul {
list-style: none;
background: var(--background-color);
4 years ago
padding: 4px 0;
border-radius: 4px;
box-shadow: 0 0 15px rgba($base-shadow-color, 0.4);
min-width: 140px;
position: relative;
}
&.dropdown__right {
right: 0;
}
&.dropdown__left {
& > ul {
left: -98px;
}
}
& > ul > li > a {
font-size: 13px;
line-height: 18px;
display: block;
padding: 4px 14px;
box-sizing: border-box;
text-decoration: none;
background: var(--background-color);
4 years ago
color: var(--primary-text-color);
4 years ago
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&:focus {
outline: 0;
}
&:hover {
background: var(--brand-color);
color: var(--primary-text-color--faint);
4 years ago
}
}
5 years ago
}
.dropdown__icon {
4 years ago
vertical-align: middle;
5 years ago
}