selects.scss 5.26 KB
Newer Older
1
/** Select2 selectbox style override **/
2 3 4 5
.select2-container {
  width: 100% !important;
}

6 7
.select2-container,
.select2-container.select2-drop-above {
8
  .select2-choice {
9
    background: $white-light;
10
    border-color: $input-border;
11
    height: 34px;
12
    padding: $gl-vert-padding $gl-input-padding;
13
    font-size: $gl-font-size;
14
    line-height: 1.42857143;
15
    border-radius: $border-radius-base;
16 17

    .select2-arrow {
18 19
      background-image: none;
      background-color: transparent;
20
      border: 0;
21 22 23
      padding-top: 12px;
      padding-right: 20px;
      font-size: 10px;
24 25

      b {
26 27 28 29 30 31 32 33 34 35
        display: none;
      }

      &::after {
        content: "\f078";
        position: absolute;
        z-index: 1;
        text-align: center;
        pointer-events: none;
        box-sizing: border-box;
36
        color: $gray-darkest;
37 38 39 40 41 42
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
43
      }
44
    }
45 46

    .select2-chosen {
47
      margin-right: 15px;
48 49
    }

50
    &:hover {
51
      border-color: $gray-darkest;
Alfredo Sumaran's avatar
Alfredo Sumaran committed
52
      color: $gl-text-color;
53
    }
54
  }
55
}
56

57 58 59 60 61
.select2-drop,
.select2-drop.select2-drop-above {
  box-shadow: 0 2px 4px $dropdown-shadow-color;
  border-radius: $border-radius-base;
  border: 1px solid $dropdown-border-color;
62
  min-width: 175px;
63 64
  color: $gl-text-color;
  z-index: 999;
65 66
}

67 68 69 70 71 72 73
.select2-drop-mask {
  z-index: 998;
}

.select2-drop.select2-drop-above.select2-drop-active {
  border-top: 1px solid $dropdown-border-color;
  margin-top: -6px;
74 75
}

76
.select2-container-active {
77 78
  .select2-choice,
  .select2-choices {
Clement Ho's avatar
Clement Ho committed
79
    box-shadow: none;
80 81 82
  }
}

83 84
.select2-dropdown-open,
.select2-dropdown-open.select2-drop-above {
85
  .select2-choice {
86
    border-color: $gray-darkest;
87 88 89 90
    outline: 0;
  }
}

91 92
.select2-container-multi {
  .select2-choices {
Clement Ho's avatar
Clement Ho committed
93
    border-radius: $border-radius-default;
94
    border-color: $input-border;
95
    background: none;
96

97
    .select2-search-field input {
Phil Hughes's avatar
Phil Hughes committed
98
      padding: 5px $gl-padding / 2;
99 100 101 102
      height: auto;
      font-family: inherit;
      font-size: inherit;
    }
103

104
    .select2-search-choice {
105
      margin: 5px 0 0 8px;
106 107 108 109
      box-shadow: none;
      border-color: $input-border;
      color: $gl-text-color;
      line-height: 15px;
110
      background-color: $gray-light;
111
      background-image: none;
112
      padding: 3px 18px 3px 5px;
113

114
      .select2-search-choice-close {
115 116 117
        top: 5px;
        left: initial;
        right: 3px;
118 119 120 121 122 123 124
      }

      &.select2-search-choice-focus {
        border-color: $gl-text-color;
      }
    }
  }
125 126
}

127
.select2-drop-active {
128
  margin-top: $dropdown-vertical-offset;
129
  font-size: 14px;
130

131 132
  .select2-results {
    max-height: 350px;
133
  }
134 135
}

136
.select2-search {
137
  padding: $grid-size;
138 139

  .select2-drop-auto-width & {
140
    padding: $grid-size;
141
  }
142

143
  input {
144
    padding: $grid-size;
145
    background: $white-light image-url('select2.png');
146 147
    background-clip: content-box;
    background-origin: content-box;
148
    background-repeat: no-repeat;
149
    background-position: right 0 bottom 0 !important;
150 151
    border: 1px solid $input-border;
    border-radius: $border-radius-default;
152
    line-height: 16px;
153 154 155 156 157 158 159 160 161
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;

    &:focus {
      border-color: $input-border-focus;
    }

    &.select2-active {
      background-color: $white-light;
      background-image: image-url('select2-spinner.gif') !important;
162
      background-origin: content-box;
163
      background-repeat: no-repeat;
164
      background-position: right 6px center !important;
165 166
      background-size: 16px 16px !important;
    }
167
  }
168 169 170 171

  + .select2-results {
    padding-top: 0;
  }
172 173
}

174 175
.select2-results {
  margin: 0;
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
  padding: #{$gl-padding / 2} 0;

  .select2-no-results,
  .select2-searching,
  .select2-ajax-error,
  .select2-selection-limit {
    background: transparent;
    padding: #{$gl-padding / 2} $gl-padding;
  }

  .select2-result-label,
  .select2-more-results {
    padding: #{$gl-padding / 2} $gl-padding;
  }

  .select2-highlighted {
    background: transparent;
    color: $gl-text-color;

    .select2-result-label {
      background: $dropdown-item-hover-bg;
    }
  }

  .select2-result {
    padding: 0 1px;
  }
203

204 205
  li.select2-result-with-children > .select2-result-label {
    font-weight: $gl-font-weight-bold;
206 207
    color: $gl-text-color;
  }
208
}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
209 210 211 212 213 214 215 216 217 218 219 220 221

.ajax-users-select {
  width: 400px;

  &.input-large {
    width: 210px;
  }

  &.input-clamp {
    max-width: 100%;
  }
}

222 223 224
.select2-highlighted {
  .group-result {
    .group-path {
225
      color: $white-light;
226 227 228 229
    }
  }
}

230 231 232 233
.group-result {
  .group-image {
    float: left;
  }
234

235
  .group-name {
236
    font-weight: $gl-font-weight-bold;
237
  }
238

239
  .group-path {
240
    color: $group-path-color;
241 242 243
  }
}

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
244
.user-result {
245 246
  min-height: 24px;

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
247 248 249
  .user-image {
    float: left;
  }
250 251 252 253 254

  &.no-username {
    .user-name {
      line-height: 24px;
    }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
255 256 257 258 259
  }
}

.namespace-result {
  .namespace-kind {
260
    color: $namespace-kind-color;
261
    font-weight: $gl-font-weight-normal;
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
262
  }
263

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
264 265
  .namespace-path {
    margin-left: 10px;
266
    font-weight: $gl-font-weight-bold;
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
267 268
  }
}
269 270

.ajax-users-dropdown {
271
  min-width: 250px !important;
272
}
273

274 275 276 277 278
.select2-result-selectable,
.select2-result-unselectable {
  .select2-match {
    font-weight: $gl-font-weight-bold;
    text-decoration: none;
279 280
  }
}