nav.scss 7.6 KB
Newer Older
1
@mixin fade($gradient-direction, $gradient-color) {
2 3
  visibility: hidden;
  opacity: 0;
4
  z-index: 2;
5
  position: absolute;
6
  bottom: 12px;
7 8 9 10
  width: 43px;
  height: 30px;
  transition-duration: .3s;
  -webkit-transform: translateZ(0);
11
  background: linear-gradient(to $gradient-direction, $gradient-color 45%, rgba($gradient-color, 0.4));
12

13 14 15
  &.scrolling {
    visibility: visible;
    opacity: 1;
16 17
    transition-duration: .3s;
  }
18 19 20

  .fa {
    position: relative;
21 22
    top: 5px;
    font-size: 18px;
23
  }
24 25
}

A
Annabel Dunstone 已提交
26 27 28 29 30
@mixin scrolling-links() {
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
31

A
Annabel Dunstone 已提交
32 33 34 35 36
  &::-webkit-scrollbar {
    display: none;
  }
}

37 38 39 40
.nav-links {
  padding: 0;
  margin: 0;
  list-style: none;
41
  height: auto;
42 43 44 45 46 47 48
  border-bottom: 1px solid $border-color;

  li {
    display: inline-block;

    a {
      display: inline-block;
A
Annabel Dunstone 已提交
49
      padding: $gl-btn-padding;
50 51
      padding-bottom: 11px;
      margin-bottom: -1px;
52
      font-size: 14px;
53
      line-height: 28px;
T
tauriedavis 已提交
54
      color: $gl-text-color-secondary;
55 56
      border-bottom: 2px solid transparent;

57 58 59
      &:hover,
      &:active,
      &:focus {
60
        text-decoration: none;
T
tauriedavis 已提交
61 62 63 64 65 66
        border-bottom: 2px solid $gray-darkest;
        color: $black;

        .badge {
          color: $black;
        }
67 68 69 70
      }
    }

    &.active a {
71 72
      border-bottom: 2px solid $link-underline-blue;
      color: $black;
T
tauriedavis 已提交
73
      font-weight: 600;
74 75 76 77

      .badge {
        color: $black;
      }
78 79
    }
  }
A
Annabel Dunstone 已提交
80 81

  &.sub-nav {
82
    text-align: center;
A
Annabel Dunstone Gray 已提交
83
    background-color: $gray-normal;
A
Annabel Dunstone 已提交
84 85

    .container-fluid {
A
Annabel Dunstone Gray 已提交
86
      background-color: $gray-normal;
A
Annabel Dunstone 已提交
87
      margin-bottom: 0;
A
Annabel Dunstone 已提交
88 89 90 91
    }

    li {

T
tauriedavis 已提交
92 93
      &.active a {
        border-bottom: none;
T
tauriedavis 已提交
94
        color: $link-underline-blue;
T
tauriedavis 已提交
95 96
      }

A
Annabel Dunstone 已提交
97 98 99 100
      a {
        margin: 0;
        padding: 11px 10px 9px;

T
tauriedavis 已提交
101 102 103
        &:hover,
        &:active,
        &:focus {
104
          border-color: transparent;
T
tauriedavis 已提交
105
        }
A
Annabel Dunstone 已提交
106 107 108
      }
    }
  }
109
}
110 111

.top-area {
112
  @include clearfix;
A
Annabel Dunstone Gray 已提交
113
  border-bottom: 1px solid $white-normal;
114 115 116 117 118 119

  .nav-text {
    padding-top: 16px;
    padding-bottom: 11px;
    display: inline-block;
    line-height: 28px;
120
    white-space: normal;
121 122

    /* Small devices (phones, tablets, 768px and lower) */
123
    @media (max-width: $screen-xs-max) {
124 125
      width: 100%;
    }
126 127
  }

128 129
  .nav-search {
    display: inline-block;
130
    width: 100%;
131 132 133
    padding: 11px 0;

    /* Small devices (phones, tablets, 768px and lower) */
134 135
    @media (min-width: $screen-sm-min) {
      width: 50%;
136 137 138
    }
  }

139 140 141
  .nav-links {
    display: inline-block;
    width: 50%;
142
    margin-bottom: 0;
143
    border-bottom: none;
144

145 146 147 148 149
    &.wide {
      width: 100%;
      display: block;
    }

A
Annabel Dunstone 已提交
150
    li a {
151
      padding: 16px 15px 11px;
A
Annabel Dunstone 已提交
152 153
    }

154
    /* Small devices (phones, tablets, 768px and lower) */
155
    @media (max-width: $screen-xs-max) {
156 157
      width: 100%;
    }
158 159 160 161 162 163 164
  }

  .nav-controls {
    display: inline-block;
    float: right;
    text-align: right;
    padding: 11px 0;
165
    margin-bottom: 0;
166

167 168
    > .btn,
    > .btn-container,
169 170 171
    > .dropdown,
    > input,
    > form {
172
      margin-right: $gl-padding-top;
173
      display: inline-block;
174
      vertical-align: top;
175 176 177

      &:last-child {
        margin-right: 0;
178
        float: right;
179 180 181 182 183
      }
    }

    > .btn-grouped {
      float: none;
184
    }
185

A
Alfredo Sumaran 已提交
186 187 188 189
    .icon-label {
      display: none;
    }

190 191 192 193 194
    .btn,
    .dropdown,
    .dropdown-toggle,
    input,
    form {
P
Phil Hughes 已提交
195
      height: 35px;
196 197 198
    }

    input {
199
      display: inline-block;
200
      position: relative;
201 202 203 204 205

      /* Medium devices (desktops, 992px and up) */
      @media (min-width: $screen-md-min) { width: 200px; }

      /* Large devices (large desktops, 1200px and up) */
206
      @media (min-width: $screen-lg-min) { width: 250px; }
207

208 209 210 211 212 213 214
      &.input-short {
        /* Medium devices (desktops, 992px and up) */
        @media (min-width: $screen-md-min) { width: 170px; }

        /* Large devices (large desktops, 1200px and up) */
        @media (min-width: $screen-lg-min) { width: 210px; }
      }
215 216
    }

217 218
    @media (max-width: $screen-xs-max) {
      padding-bottom: 0;
219
      width: 100%;
220

221 222 223
      .btn,
      form,
      .dropdown,
224
      .dropdown-toggle,
225 226
      .dropdown-menu-toggle,
      .form-control {
227
        margin: 0 0 10px;
A
Alfredo Sumaran 已提交
228
        display: block;
229
        width: 100%;
A
Alfredo Sumaran 已提交
230 231 232 233 234
      }

      form {
        display: block;
        height: auto;
235
        margin-bottom: 14px;
236 237 238

        input {
          width: 100%;
A
Alfredo Sumaran 已提交
239
          margin: 0 0 10px;
240
        }
A
Alfredo Sumaran 已提交
241 242
      }

A
Alfredo Sumaran 已提交
243
      .input-short {
A
Alfredo Sumaran 已提交
244 245 246 247 248 249
        width: 100%;
      }

      .icon-label {
        display: inline-block;
      }
250 251 252 253 254 255

      // Applies on /dashboard/issues
      .project-item-select-holder {
        display: block;
        margin: 0;
      }
256
    }
257
  }
258 259

  &.adjust {
260 261
    .nav-text,
    .nav-controls {
262
      width: auto;
263 264 265 266

      @media (max-width: $screen-xs-max) {
        width: 100%;
      }
267 268
    }
  }
A
Annabel Dunstone Gray 已提交
269 270 271 272 273 274 275 276 277 278

  &.multi-line {
    .nav-text {
      line-height: 20px;
    }

    .nav-controls {
      padding: 17px 0;
    }
  }
279 280 281 282

  pre {
    width: 100%;
  }
283
}
284 285

.layout-nav {
286
  width: 100%;
A
Annabel Dunstone Gray 已提交
287
  background: $gray-light;
288
  border-bottom: 1px solid $border-color;
289
  transition: padding $sidebar-transition-duration;
290
  text-align: center;
291

292 293
  .container-fluid {
    position: relative;
294 295 296 297 298 299

    .nav-control {
      @media (max-width: $screen-sm-max) {
        margin-right: 75px;
      }
    }
300 301
  }

302 303
  .controls {
    float: right;
304
    padding: 7px 0 0;
305 306 307 308 309 310 311 312 313 314 315 316

    i {
      color: $layout-link-gray;
    }

    .fa-rss,
    .fa-cog {
      font-size: 16px;
    }

    .fa-caret-down {
      margin-left: 5px;
T
tauriedavis 已提交
317
      color: $gl-text-color-secondary;
318
    }
319 320

    .dropdown {
P
Phil Hughes 已提交
321 322 323
      position: absolute;
      top: 7px;
      right: 15px;
324
      z-index: 2;
325 326 327 328

      li.active {
        font-weight: bold;
      }
329
    }
330 331
  }

332 333
  .nav-links {
    border-bottom: none;
334
    height: 51px;
335

336
    li {
337 338 339
      a {
        padding-top: 10px;
      }
340
    }
341
  }
342 343
}

344 345 346 347 348
.scrolling-tabs-container {
  position: relative;

  .nav-links {
    @include scrolling-links();
349
  }
350

351
  .fade-right {
A
Annabel Dunstone Gray 已提交
352
    @include fade(left, $gray-light);
353 354 355 356
    right: -5px;

    .fa {
      right: -7px;
357
    }
358
  }
359

360
  .fade-left {
A
Annabel Dunstone Gray 已提交
361
    @include fade(right, $gray-light);
362
    left: -5px;
363
    text-align: center;
364 365 366

    .fa {
      left: -7px;
367 368
    }
  }
369 370 371 372

  &.sub-nav-scroll {

    .fade-right {
A
Annabel Dunstone Gray 已提交
373
      @include fade(left, $gray-normal);
374 375 376 377 378 379 380 381
      right: 0;

      .fa {
        right: -23px;
      }
    }

    .fade-left {
A
Annabel Dunstone Gray 已提交
382
      @include fade(right, $gray-normal);
383 384 385 386 387 388 389
      left: 0;

      .fa {
        left: 10px;
      }
    }
  }
390 391
}

A
Annabel Dunstone 已提交
392 393 394 395 396 397 398
.nav-block {
  position: relative;

  .nav-links {
    @include scrolling-links();

    .fade-right {
399
      @include fade(left, $white-light);
400 401 402 403 404
      right: -5px;

      .fa {
        right: -7px;
      }
A
Annabel Dunstone 已提交
405 406 407
    }

    .fade-left {
408
      @include fade(right, $white-light);
409 410 411 412 413
      left: -5px;

      .fa {
        left: -7px;
      }
A
Annabel Dunstone 已提交
414 415 416 417
    }
  }
}

418
.page-with-layout-nav {
A
Annabel Dunstone 已提交
419
  .right-sidebar {
420
    top: ($header-height * 2) + 2;
A
Annabel Dunstone 已提交
421
  }
422 423 424 425 426 427 428 429

  .build-sidebar {
    top: ($header-height * 3) + 3;

    &.affix {
      top: 0;
    }
  }
430
}
431 432 433 434 435 436 437 438 439

.activities {
  .nav-block {
    border-bottom: 1px solid $border-color;

    .nav-links {
      border-bottom: none;
    }
  }
440 441 442
}

@media (max-width: $screen-xs-max) {
443 444
  .top-area {
    flex-flow: row wrap;
445

446 447 448 449 450 451 452 453 454 455 456
    .nav-controls {
      $controls-margin: $btn-xs-side-margin - 2px;
      flex: 0 0 100%;

      &.controls-flex {
        display: flex;
        flex-flow: row wrap;
        align-items: center;
        justify-content: center;
        padding: 0 0 $gl-padding-top;
      }
457

458 459 460 461 462 463 464
      .controls-item,
      .controls-item-full,
      .controls-item:last-child {
        flex: 1 1 35%;
        display: block;
        width: 100%;
        margin: $controls-margin;
465

466 467 468 469
        .btn,
        .dropdown {
          margin: 0;
        }
470 471
      }

472 473 474
      .controls-item-full {
        flex: 1 1 100%;
      }
475 476 477
    }
  }
}