.multi-select-container { position: relative; display: inline-block; // shrink to width of .multi-select-button } .multi-select-menu { position: absolute; #{$left}: 0; top: 0.8em; z-index: 2; // stack above mysoc-footer float: #{$left}; // shrink to width of child elements min-width: 100%; // always at least as wide as its .multi-select-button sibling background: #fff; margin: 1em 0; border: 1px solid #aaa; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); display: none; } .multi-select-menuitem { display: block; font-size: 0.875em; padding: flip(0.6em 1em 0.6em 30px, 0.6em 30px 0.6em 1em); margin: 0; white-space: nowrap; & + & { padding-top: 0; } input { position: absolute; margin-top: 0.25em; margin-#{$left}: -20px; } } .multi-select-presets { border-bottom: 1px solid #ddd; } .multi-select-button { display: inline-block; font-size: 0.875em; padding: flip(0.2em 1.5em 0.2em 0.6em, 0.2em 0.6em 0.2em 1.5em); max-width: 20em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: -0.5em; background-color: #fff; border: 1px solid $form-control-border-color; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); cursor: default; position: relative; &:after { content: ""; display: block; width: 0; height: 0; border-style: solid; border-width: 0.4em 0.4em 0 0.4em; border-color: #999 transparent transparent transparent; position: absolute; #{$right}: 0.5em; top: 50%; margin: -0.2em 0 0 0; } } .multi-select-container--open { .multi-select-menu { display: block; } .multi-select-button:after { border-width: 0 0.4em 0.4em 0.4em; border-color: transparent transparent #999 transparent; } } .multi-select-container--positioned { .multi-select-menu { box-sizing: border-box; label { white-space: normal; } } }