@import '../constants/colors'; @import '../constants/dimensions'; @import '../constants/fonts'; .dropdown { position: relative; display: inline-block; box-sizing: border-box; text-align: left; &:focus { outline: none; } .dropdown__backdrop { position: fixed; z-index: 999; display: none; left: 0; right: 0; top: 0; bottom: 0; content: ' '; } ul { z-index: 1000; display: none; position: absolute; top: 100%; left: 0; min-width: @dropdown-min-width; border: 1px solid @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 the button a bit margin-top: @padding-xxs; margin-bottom: @padding-xxs; padding-top: @radius-md; padding-bottom: @radius-md; border-radius: @radius-md; overflow: auto; li { & > button { font-size: @font-size-md; text-align: left; padding: @padding-sm @padding-md @padding-sm @padding-sm; width: 100%; display: block; color: var(--color-font) !important; white-space: nowrap; margin: 0; &:hover:not(:disabled), &:focus:not(:disabled) { background: @hl-sm; } &:active:not(:disabled) { background: @hl-md; } i.fa:first-child { display: inline-block; width: 2.2em; text-align: center; } } } } &.dropdown--up ul { top: auto; bottom: 100%; } .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: @hl-xl; margin-left: auto; padding-left: @padding-lg; } } li.dropdown__divider { border-bottom: 1px solid @hl-lg; overflow: visible !important; height: 0; margin: @padding-md @padding-md @padding-md @padding-md; min-width: @dropdown-min-width - @padding-md * 2; .dropdown__divider__label { position: relative; left: -@padding-sm / 2; top: -0.7rem; color: @hl; padding-right: 1em; background: var(--color-bg); font-size: @font-size-xs; text-transform: uppercase; } &.dropdown__divider--no-name { margin: @padding-xs 0; .dropdown__divider__label { display: none; } } } &.dropdown--flip ul { bottom: 100%; top: auto; } &.dropdown--open { ul { display: block; animation: fadeIn 200ms ease-out; } .dropdown__backdrop { display: block; } } &.dropdown--right ul { right: 0; left: auto; } &.dropdown--wide ul { left: 0; right: 0; } }