contextual-sidebar.scss 7.9 KB
Newer Older
1
.page-with-contextual-sidebar {
A
Annabel Dunstone Gray 已提交
2
  @media (min-width: $screen-md-min) {
3
    padding-left: $contextual-sidebar-collapsed-width;
A
Annabel Dunstone Gray 已提交
4
  }
5 6

  @media (min-width: $screen-lg-min) {
7
    padding-left: $contextual-sidebar-width;
8 9
  }

10
  // Override position: absolute
11 12
  .right-sidebar {
    position: fixed;
13
    height: calc(100% - #{$header-height});
14
  }
B
Bryce Johnson 已提交
15 16 17 18

  .issues-bulk-update.right-sidebar.right-sidebar-expanded .issuable-sidebar-header {
    padding: 10px 0 15px;
  }
19 20
}

21 22
.page-with-icon-sidebar {
  @media (min-width: $screen-sm-min) {
23
    padding-left: $contextual-sidebar-collapsed-width;
24 25 26
  }
}

27
.context-header {
28
  position: relative;
29
  margin-right: 2px;
30

31
  a {
32
    font-weight: $gl-font-weight-bold;
33 34 35 36
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 10px;
    color: $gl-text-color;
37
  }
38

39 40
  &:hover,
  a:hover {
41 42
    background-color: $link-hover-background;
    color: $gl-text-color;
43
  }
44

45 46 47 48 49
  .avatar-container {
    flex: 0 0 40px;
    background-color: $white-light;
  }

50
  .sidebar-context-title {
51 52 53
    overflow: hidden;
    text-overflow: ellipsis;
  }
54 55 56 57 58
}

.settings-avatar {
  background-color: $white-light;

59 60 61
  svg {
    fill: $gl-text-color-secondary;
    margin: auto;
62 63 64
  }
}

65 66 67
.nav-sidebar {
  position: fixed;
  z-index: 400;
68
  width: $contextual-sidebar-width;
69
  transition: left $sidebar-transition-duration;
70
  top: $header-height;
71 72
  bottom: 0;
  left: 0;
73
  background-color: $gray-light;
74
  box-shadow: inset -2px 0 0 $border-color;
75
  transform: translate3d(0, 0, 0);
76

77 78 79 80 81 82 83
  &:not(.sidebar-icons-only) {
    @media (min-width: $screen-sm-min) and (max-width: $screen-md-max) {
      box-shadow: inset -2px 0 0 $border-color,
                  2px 1px 3px $dropdown-shadow-color;
    }
  }

84
  &.sidebar-icons-only {
85
    width: auto;
86
    min-width: $contextual-sidebar-collapsed-width;
87

88 89 90 91
    .nav-sidebar-inner-scroll {
      overflow-x: hidden;
    }

92 93
    .badge:not(.fly-out-badge),
    .sidebar-context-title,
94
    .nav-item-name {
95 96 97 98 99
      display: none;
    }

    .sidebar-top-level-items > li > a {
      min-height: 44px;
100
    }
101 102 103 104

    .fly-out-top-item {
      display: block;
    }
105 106 107 108

    .avatar-container {
      margin-right: 0;
    }
109 110
  }

111
  &.nav-sidebar-expanded {
112
    left: 0;
113 114
  }

115
  a {
116
    transition: none;
117 118
    text-decoration: none;
  }
119 120

  ul {
121
    padding-left: 0;
122 123 124 125
    list-style: none;
  }

  li {
126 127
    white-space: nowrap;

128
    a {
129 130
      display: flex;
      align-items: center;
131
      padding: 12px 16px;
132
      color: $gl-text-color-secondary;
133
    }
134

135 136 137
    .nav-item-name {
      flex: 1;
    }
138

139 140 141 142
    &.active {
      > a {
        font-weight: $gl-font-weight-bold;
      }
143
    }
144
  }
145 146

  @media (max-width: $screen-xs-max) {
147
    left: (-$contextual-sidebar-width);
148
  }
149 150 151 152 153

  .nav-icon-container {
    display: flex;
    margin-right: 8px;
  }
154 155 156 157

  .fly-out-top-item {
    display: none;
  }
158 159 160 161 162

  svg {
    height: 16px;
    width: 16px;
  }
163 164
}

165 166 167
.nav-sidebar-inner-scroll {
  height: 100%;
  width: 100%;
168 169 170 171 172
  overflow: auto;

  @media (min-width: $screen-sm-min) {
    overflow: hidden;
  }
173 174
}

175
.with-performance-bar .nav-sidebar {
176
  top: $header-height + $performance-bar-height;
177 178 179 180
}

.sidebar-sub-level-items {
  display: none;
181
  padding-bottom: 8px;
182 183 184

  > li {
    a {
185
      padding: 8px 16px 8px 40px;
186

187 188
      &:hover,
      &:focus {
189 190
        background: $link-active-background;
        color: $gl-text-color;
191 192 193 194
      }
    }

    &.active {
195 196 197 198
      a {
        &,
        &:hover,
        &:focus {
199
          background: $link-active-background;
200
        }
201 202 203 204 205 206
      }
    }
  }
}

.sidebar-top-level-items {
207 208
  margin-bottom: 60px;

209
  > li {
P
Phil Hughes 已提交
210 211 212 213
    > a {
      @media (min-width: $screen-sm-min) {
        margin-right: 2px;
      }
214 215 216 217

      &:hover {
        color: $gl-text-color;
      }
P
Phil Hughes 已提交
218 219
    }

220
    &.is-showing-fly-out {
221
      > a {
222
        margin-right: 2px;
223 224
      }

225 226 227
      .sidebar-sub-level-items {
        @media (min-width: $screen-sm-min) {
          position: fixed;
P
Phil Hughes 已提交
228
          top: 0;
229
          left: 0;
230
          min-width: 150px;
P
Phil Hughes 已提交
231
          margin-top: -1px;
232
          padding: 4px 1px;
P
Phil Hughes 已提交
233
          background-color: $white-light;
P
Phil Hughes 已提交
234
          box-shadow: 2px 1px 3px $dropdown-shadow-color;
P
Phil Hughes 已提交
235
          border: 1px solid $gray-darker;
236
          border-left: 0;
P
Phil Hughes 已提交
237
          border-radius: 0 3px 3px 0;
P
Phil Hughes 已提交
238

239 240 241
          &::before {
            content: "";
            position: absolute;
P
Phil Hughes 已提交
242 243
            top: -30px;
            bottom: -30px;
244
            left: -10px;
P
Phil Hughes 已提交
245
            right: -30px;
246 247 248
            z-index: -1;
          }

P
Phil Hughes 已提交
249 250
          &.is-above {
            margin-top: 1px;
P
Phil Hughes 已提交
251 252
          }

253 254 255 256 257 258 259
          .divider {
            height: 1px;
            margin: 4px -1px;
            padding: 0;
            background-color: $dropdown-divider-color;
          }

260 261 262 263 264 265 266 267
          > .active {
            box-shadow: none;

            > a {
              background-color: transparent;
            }
          }

P
Phil Hughes 已提交
268
          a {
269
            padding: 8px 16px;
270 271
            color: $gl-text-color;

P
Phil Hughes 已提交
272 273
            &:hover,
            &:focus {
P
Phil Hughes 已提交
274
              background-color: $gray-darker;
P
Phil Hughes 已提交
275
            }
276 277 278 279 280
          }
        }
      }
    }

281
    .badge {
282
      background-color: $inactive-badge-background;
283
      color: $gl-text-color-secondary;
284 285 286
    }

    &.active {
287
      background: $link-active-background;
288

289 290
      > a {
        margin-left: 4px;
291
        padding-left: 12px;
292 293
      }

294
      .badge {
295
        font-weight: $gl-font-weight-bold;
296 297
      }

298
      .sidebar-sub-level-items:not(.is-fly-out-only) {
299 300 301 302
        display: block;
      }
    }

303
    &.active > a:hover,
P
Phil Hughes 已提交
304
    &.is-over > a {
305
      background-color: $link-hover-background;
306 307 308 309
    }
  }
}

310 311 312

// Collapsed nav

A
Annabel Dunstone Gray 已提交
313 314
.toggle-sidebar-button,
.close-nav-button {
315
  width: $contextual-sidebar-width - 2px;
316 317 318
  position: fixed;
  bottom: 0;
  padding: 16px;
319
  background-color: $gray-light;
A
Annabel Dunstone Gray 已提交
320
  border: 0;
321 322 323 324 325
  border-top: 2px solid $border-color;
  color: $gl-text-color-secondary;
  display: flex;
  align-items: center;

326
  svg {
327 328 329
    margin-right: 8px;
  }

330
  .icon-angle-double-right {
331 332 333 334 335 336 337 338 339
    display: none;
  }

  &:hover {
    background-color: $border-color;
    color: $gl-text-color;
  }
}

A
Annabel Dunstone Gray 已提交
340 341 342 343 344 345 346
.toggle-sidebar-button {
  @media (max-width: $screen-xs-max) {
    display: none;
  }
}


347 348
.sidebar-icons-only {
  .context-header {
349
    height: 61px;
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371

    a {
      padding: 10px 4px;
    }
  }

  li a {
    padding: 12px 15px;
  }

  .sidebar-top-level-items > li {
    &.active a {
      padding-left: 12px;
    }

    .sidebar-sub-level-items {
      &:not(.flyout-list) {
        display: none;
      }
    }
  }

P
Phil Hughes 已提交
372 373 374 375
  .nav-icon-container {
    margin-right: 0;
  }

376
  .toggle-sidebar-button {
377
    width: $contextual-sidebar-collapsed-width - 2px;
T
Tim Zallmann 已提交
378
    padding: 16px;
379 380

    .collapse-text,
381
    .icon-angle-double-left {
382 383 384
      display: none;
    }

385
    .icon-angle-double-right {
386
      display: block;
387
      margin: 0;
388 389 390 391
    }
  }
}

392 393 394 395 396 397 398 399 400 401 402 403 404
.fly-out-top-item {
  > a {
    display: flex;
  }

  .fly-out-badge {
    margin-left: 8px;
  }
}

.fly-out-top-item-name {
  flex: 1;
}
405 406 407

// Mobile nav

A
Annabel Dunstone Gray 已提交
408 409 410 411
.close-nav-button {
  display: none;
}

412 413 414 415 416
.toggle-mobile-nav {
  display: none;
  background-color: transparent;
  border: 0;
  padding: 6px 16px;
417
  margin: 0 0 0 -15px;
418 419 420 421 422 423 424 425
  height: 46px;

  i {
    font-size: 20px;
    color: $gl-text-color-secondary;
  }

  @media (max-width: $screen-xs-max) {
426 427
    display: flex;
    align-items: center;
428 429 430 431

    i {
      font-size: 18px;
    }
432
  }
433 434 435

  @media (max-width: $screen-xs-max) {
    + .breadcrumbs-links {
436
      padding-left: $gl-padding;
437 438 439
      border-left: 1px solid $gl-text-color-quaternary;
    }
  }
440 441
}

A
Annabel Dunstone Gray 已提交
442 443 444 445 446 447
@media (max-width: $screen-xs-max) {
  .close-nav-button {
    display: flex;
  }
}

448 449 450 451 452
.mobile-overlay {
  display: none;

  &.mobile-nav-open {
    display: block;
453
    position: fixed;
454 455 456 457 458 459 460
    background-color: $black-transparent;
    height: 100%;
    width: 100%;
    z-index: 300;
  }
}

461 462 463 464

// Make issue boards full-height now that sub-nav is gone

.boards-list {
465
  height: calc(100vh - #{$header-height});
466 467

  @media (min-width: $screen-sm-min) {
468
    height: calc(100vh - 180px);
469 470
  }
}
471

472
.with-performance-bar .boards-list {
473
  height: calc(100vh - #{$header-height} - #{$performance-bar-height});
474
}