contextual-sidebar.scss 8.3 KB
Newer Older
1
.page-with-contextual-sidebar {
A
Annabel Dunstone Gray 已提交
2
  transition: padding-left $sidebar-transition-duration;
3

A
Annabel Dunstone Gray 已提交
4
  @media (min-width: $screen-md-min) {
5
    padding-left: $contextual-sidebar-collapsed-width;
A
Annabel Dunstone Gray 已提交
6
  }
7 8

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

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

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

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

29
.context-header {
30
  position: relative;
31
  margin-right: 2px;
32
  width: $contextual-sidebar-width;
33

34
  a {
A
Annabel Dunstone Gray 已提交
35
    transition: padding $sidebar-transition-duration;
36
    font-weight: $gl-font-weight-bold;
37 38 39 40
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 10px;
    color: $gl-text-color;
41
  }
42

43 44
  &:hover,
  a:hover {
45 46
    background-color: $link-hover-background;
    color: $gl-text-color;
47
  }
48

49 50 51 52 53
  .avatar-container {
    flex: 0 0 40px;
    background-color: $white-light;
  }

54
  .sidebar-context-title {
55 56 57
    overflow: hidden;
    text-overflow: ellipsis;
  }
58 59 60 61 62
}

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

63 64 65
  svg {
    fill: $gl-text-color-secondary;
    margin: auto;
66 67 68
  }
}

69
.nav-sidebar {
A
Annabel Dunstone Gray 已提交
70
  transition: width $sidebar-transition-duration, left $sidebar-transition-duration;
71 72
  position: fixed;
  z-index: 400;
73
  width: $contextual-sidebar-width;
74
  top: $header-height;
75 76
  bottom: 0;
  left: 0;
77
  background-color: $gray-light;
78
  box-shadow: inset -2px 0 0 $border-color;
79
  transform: translate3d(0, 0, 0);
80

81
  &:not(.sidebar-collapsed-desktop) {
82 83 84 85 86 87
    @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;
    }
  }

88 89
  &.sidebar-collapsed-desktop {
    width: $contextual-sidebar-collapsed-width;
90

91 92 93 94
    .nav-sidebar-inner-scroll {
      overflow-x: hidden;
    }

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

    .sidebar-top-level-items > li > a {
      min-height: 44px;
103
    }
104 105 106 107

    .fly-out-top-item {
      display: block;
    }
108 109 110 111

    .avatar-container {
      margin-right: 0;
    }
112 113
  }

114
  &.sidebar-expanded-mobile {
115
    left: 0;
116 117
  }

118 119 120
  a {
    text-decoration: none;
  }
121 122

  ul {
123
    padding-left: 0;
124 125 126 127
    list-style: none;
  }

  li {
128 129
    white-space: nowrap;

130
    a {
A
Annabel Dunstone Gray 已提交
131
      transition: padding $sidebar-transition-duration;
132 133
      display: flex;
      align-items: center;
A
Annabel Dunstone Gray 已提交
134
      padding: 12px 15px;
135
      color: $gl-text-color-secondary;
136
    }
137

138 139 140
    .nav-item-name {
      flex: 1;
    }
141

142 143 144 145
    &.active {
      > a {
        font-weight: $gl-font-weight-bold;
      }
146
    }
147
  }
148 149

  @media (max-width: $screen-xs-max) {
150
    left: (-$contextual-sidebar-width);
151
  }
152 153 154 155 156

  .nav-icon-container {
    display: flex;
    margin-right: 8px;
  }
157 158 159 160

  .fly-out-top-item {
    display: none;
  }
161 162 163 164 165

  svg {
    height: 16px;
    width: 16px;
  }
166 167
}

168 169 170
.nav-sidebar-inner-scroll {
  height: 100%;
  width: 100%;
171 172 173 174 175
  overflow: auto;

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

178
.with-performance-bar .nav-sidebar {
179
  top: $header-height + $performance-bar-height;
180 181 182 183
}

.sidebar-sub-level-items {
  display: none;
184
  padding-bottom: 8px;
185 186 187

  > li {
    a {
188
      padding: 8px 16px 8px 40px;
189

190 191
      &:hover,
      &:focus {
192 193
        background: $link-active-background;
        color: $gl-text-color;
194 195 196 197
      }
    }

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

.sidebar-top-level-items {
210 211
  margin-bottom: 60px;

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

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

223
    &.is-showing-fly-out {
224
      > a {
225
        margin-right: 2px;
226 227
      }

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

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

P
Phil Hughes 已提交
252 253
          &.is-above {
            margin-top: 1px;
P
Phil Hughes 已提交
254 255
          }

256 257 258 259 260 261 262
          .divider {
            height: 1px;
            margin: 4px -1px;
            padding: 0;
            background-color: $dropdown-divider-color;
          }

263 264 265 266 267 268 269 270
          > .active {
            box-shadow: none;

            > a {
              background-color: transparent;
            }
          }

P
Phil Hughes 已提交
271
          a {
272
            padding: 8px 16px;
273 274
            color: $gl-text-color;

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

284
    .badge {
285
      background-color: $inactive-badge-background;
286
      color: $gl-text-color-secondary;
287 288 289
    }

    &.active {
290
      background: $link-active-background;
291

292 293
      > a {
        margin-left: 4px;
A
Annabel Dunstone Gray 已提交
294 295
        // Subtract width of left border on active element
        padding-left: 11px;
296 297
      }

298
      .badge {
299
        font-weight: $gl-font-weight-bold;
300 301
      }

302
      .sidebar-sub-level-items:not(.is-fly-out-only) {
303 304 305 306
        display: block;
      }
    }

307
    &.active > a:hover,
P
Phil Hughes 已提交
308
    &.is-over > a {
309
      background-color: $link-hover-background;
310 311 312 313
    }
  }
}

314 315 316

// Collapsed nav

A
Annabel Dunstone Gray 已提交
317 318
.toggle-sidebar-button,
.close-nav-button {
319
  width: $contextual-sidebar-width - 2px;
A
Annabel Dunstone Gray 已提交
320
  transition: width $sidebar-transition-duration;
321 322
  position: fixed;
  bottom: 0;
323
  padding: $gl-padding;
324
  background-color: $gray-light;
A
Annabel Dunstone Gray 已提交
325
  border: 0;
326 327 328 329
  border-top: 2px solid $border-color;
  color: $gl-text-color-secondary;
  display: flex;
  align-items: center;
330
  line-height: 1;
331

332
  svg {
333 334 335
    margin-right: 8px;
  }

336
  .icon-angle-double-right {
337 338 339 340 341 342 343 344 345
    display: none;
  }

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

A
Annabel Dunstone Gray 已提交
346 347 348 349 350 351
.toggle-sidebar-button {
  @media (max-width: $screen-xs-max) {
    display: none;
  }
}

352 353 354 355
.collapse-text {
  white-space: nowrap;
  overflow: hidden;
}
A
Annabel Dunstone Gray 已提交
356

357
.sidebar-collapsed-desktop {
358
  .context-header {
A
Annabel Dunstone Gray 已提交
359
    height: 60px;
360
    width: $contextual-sidebar-collapsed-width;
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378

    a {
      padding: 10px 4px;
    }
  }

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

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

P
Phil Hughes 已提交
379 380 381 382
  .nav-icon-container {
    margin-right: 0;
  }

383
  .toggle-sidebar-button {
T
Tim Zallmann 已提交
384
    padding: 16px;
A
Annabel Dunstone Gray 已提交
385
    width: $contextual-sidebar-collapsed-width - 2px;
386 387

    .collapse-text,
388
    .icon-angle-double-left {
389 390 391
      display: none;
    }

392
    .icon-angle-double-right {
393
      display: block;
394
      margin: 0;
395 396 397 398
    }
  }
}

399 400 401 402 403 404 405 406 407 408 409 410 411
.fly-out-top-item {
  > a {
    display: flex;
  }

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

.fly-out-top-item-name {
  flex: 1;
}
412 413 414

// Mobile nav

A
Annabel Dunstone Gray 已提交
415 416 417 418
.close-nav-button {
  display: none;
}

419 420 421 422 423
.toggle-mobile-nav {
  display: none;
  background-color: transparent;
  border: 0;
  padding: 6px 16px;
424
  margin: 0 0 0 -15px;
425 426 427 428 429 430 431 432
  height: 46px;

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

  @media (max-width: $screen-xs-max) {
433 434
    display: flex;
    align-items: center;
435 436 437 438

    i {
      font-size: 18px;
    }
439
  }
440 441 442

  @media (max-width: $screen-xs-max) {
    + .breadcrumbs-links {
443
      padding-left: $gl-padding;
444 445 446
      border-left: 1px solid $gl-text-color-quaternary;
    }
  }
447 448
}

A
Annabel Dunstone Gray 已提交
449 450 451 452 453 454
@media (max-width: $screen-xs-max) {
  .close-nav-button {
    display: flex;
  }
}

455 456 457 458 459
.mobile-overlay {
  display: none;

  &.mobile-nav-open {
    display: block;
460
    position: fixed;
461 462 463 464 465 466 467
    background-color: $black-transparent;
    height: 100%;
    width: 100%;
    z-index: 300;
  }
}

468 469 470 471

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

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

  @media (min-width: $screen-sm-min) {
475
    height: calc(100vh - 180px);
476 477
  }
}
478

479
.with-performance-bar .boards-list {
480
  height: calc(100vh - #{$header-height} - #{$performance-bar-height});
481
}