insomnia/packages/insomnia-app/app/ui/css/components/dropdown.less

171 lines
3.5 KiB
Plaintext

.dropdown {
position: relative;
display: inline-block;
box-sizing: border-box;
text-align: left;
&:focus {
outline: none;
}
& button {
cursor: pointer;
}
}
.dropdown__backdrop {
position: fixed;
z-index: 9999;
display: none;
left: 0;
right: 0;
top: 0;
bottom: 0;
content: ' ';
}
.dropdown__menu {
&.dropdown__menu--open .dropdown__backdrop {
display: block;
}
.dropdown__list {
z-index: 99999;
display: none;
position: fixed;
top: 0;
left: 0;
border: 1px solid var(--hl-sm);
box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.1);
box-sizing: border-box;
background: var(--color-bg);
// Separate it from it's surroundings a bit
margin: var(--padding-xxs) 3px;
padding-top: var(--radius-md);
padding-bottom: var(--radius-md);
border-radius: var(--radius-md);
overflow: auto;
.dropdown__filter {
border: 1px solid var(--hl-md);
margin: var(--padding-xs);
width: auto;
border-radius: var(--radius-sm);
display: flex;
flex-direction: row;
align-items: center;
padding-left: var(--padding-sm);
// Can't "display: none" this because we need to be able to type
// in it. So, we'll just store it off screen
position: absolute;
left: -9999999px;
input {
margin: 0;
padding: var(--padding-xs) var(--padding-sm);
color: var(--color-font);
}
color: var(--hl);
}
&.dropdown__list--filtering {
.dropdown__filter {
// Reposition the filter on screen
position: static;
left: auto;
}
}
&:focus {
outline: 0;
}
.dropdown__inner {
width: 100%;
}
.dropdown__text {
white-space: nowrap;
display: flex;
flex-direction: row;
align-items: center;
& > *:not(:first-child) {
margin-left: 0.3em;
}
.dropdown__hint,
.dropdown__right {
color: var(--hl-xl);
margin-left: auto;
padding-left: var(--padding-lg);
}
}
li > button {
min-width: 15rem;
font-size: var(--font-size-md);
text-align: left;
padding-right: var(--padding-md);
padding-left: var(--padding-sm);
height: var(--line-height-xs);
width: 100%;
display: block;
color: var(--color-font) !important;
white-space: nowrap;
margin: 0;
i.fa:first-child {
display: inline-block;
width: 2.2em;
text-align: center;
}
}
li > button:hover:not(:disabled),
li.active > button:not(:disabled) {
background: var(--hl-sm);
}
li > button:active:not(:disabled) {
background: var(--hl-md);
}
.dropdown__divider {
border-bottom: 1px solid var(--hl-lg);
overflow: visible !important;
height: 0;
margin: var(--padding-md) var(--padding-md) var(--padding-md) var(--padding-md);
.dropdown__divider__label {
position: relative;
left: calc(-1 * var(--padding-sm));
top: -0.7rem;
color: var(--hl);
padding-right: 1em;
background: var(--color-bg);
font-size: var(--font-size-xs);
text-transform: uppercase;
}
&.dropdown__divider--no-name {
margin: var(--padding-xs) 0;
.dropdown__divider__label {
display: none;
}
}
}
}
&.dropdown__menu--open .dropdown__list {
display: block;
animation: fadeIn 200ms ease-out;
}
}