aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/sass/_multiselect.scss
blob: 9704d841d23ac39d74a3a7e50c4f6b44b2784f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.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;
        }
    }
}