nav.scss 6.9 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 52 53 54 55 56 57 58 59 60 61 62 63
      padding-bottom: 11px;
      margin-bottom: -1px;
      font-size: 15px;
      line-height: 28px;
      color: #959494;
      border-bottom: 2px solid transparent;

      &:hover, &:active, &:focus {
        text-decoration: none;
        outline: none;
      }
    }

    &.active a {
64 65
      border-bottom: 2px solid $link-underline-blue;
      color: $black;
66 67 68 69 70
    }

    .badge {
      font-weight: normal;
      background-color: #eee;
71
      color: $btn-transparent-color;
C
Clement Ho 已提交
72
      vertical-align: baseline;
73 74
    }
  }
A
Annabel Dunstone 已提交
75 76

  &.sub-nav {
77
    text-align: center;
78
    background-color: $dark-background-color;
A
Annabel Dunstone 已提交
79 80

    .container-fluid {
81
      background-color: $dark-background-color;
A
Annabel Dunstone 已提交
82
      margin-bottom: 0;
A
Annabel Dunstone 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
    }

    li {

      a {
        margin: 0;
        padding: 11px 10px 9px;
      }

      &.active a {
        border-bottom: none;
        color: $link-underline-blue;
      }
    }
  }
98
}
99 100

.top-area {
101
  @include clearfix;
102
  border-bottom: 1px solid $btn-gray-hover;
103 104 105 106 107 108 109

  .nav-text {
    padding-top: 16px;
    padding-bottom: 11px;
    display: inline-block;
    width: 50%;
    line-height: 28px;
110 111 112 113 114

    /* Small devices (phones, tablets, 768px and lower) */
    @media (max-width: $screen-sm-min) {
      width: 100%;
    }
115 116
  }

117 118
  .nav-search {
    display: inline-block;
119
    width: 100%;
120 121 122
    padding: 11px 0;

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

128 129 130
  .nav-links {
    display: inline-block;
    width: 50%;
131
    margin-bottom: 0;
132
    border-bottom: none;
133

134 135 136 137 138
    &.wide {
      width: 100%;
      display: block;
    }

A
Annabel Dunstone 已提交
139
    li a {
140
      padding: 16px 15px 11px;
A
Annabel Dunstone 已提交
141 142
    }

143
    /* Small devices (phones, tablets, 768px and lower) */
144
    @media (max-width: $screen-xs-max) {
145 146
      width: 100%;
    }
147 148 149 150 151 152 153 154
  }

  .nav-controls {
    width: 50%;
    display: inline-block;
    float: right;
    text-align: right;
    padding: 11px 0;
155
    margin-bottom: 0;
156 157

    > .dropdown {
158
      margin-right: $gl-padding-top;
159
      display: inline-block;
160
      vertical-align: top;
161 162 163 164

      &:last-child {
        margin-right: 0;
      }
165 166
    }

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

      &:last-child {
        margin-right: 0;
      }
    }

    > .btn-grouped {
      float: none;
179
    }
180

181 182 183 184
    > form {
      display: inline-block;
    }

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

189
    input {
P
Phil Hughes 已提交
190
      height: 35px;
191
      display: inline-block;
192
      position: relative;
193
      margin-right: $gl-padding-top;
194 195 196 197 198

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

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

201 202 203 204 205 206 207
      &.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; }
      }
208 209
    }

210 211
    @media (max-width: $screen-xs-max) {
      padding-bottom: 0;
212
      width: 100%;
213

214
      .btn, form, .dropdown, .dropdown-menu-toggle, .form-control {
215
        margin: 0 0 10px;
A
Alfredo Sumaran 已提交
216
        display: block;
217
        width: 100%;
A
Alfredo Sumaran 已提交
218 219 220 221 222
      }

      form {
        display: block;
        height: auto;
223
        margin-bottom: 14px;
224 225 226

        input {
          width: 100%;
A
Alfredo Sumaran 已提交
227
          margin: 0 0 10px;
228
        }
A
Alfredo Sumaran 已提交
229 230
      }

A
Alfredo Sumaran 已提交
231
      .input-short {
A
Alfredo Sumaran 已提交
232 233 234 235 236 237
        width: 100%;
      }

      .icon-label {
        display: inline-block;
      }
238 239 240 241 242 243

      // Applies on /dashboard/issues
      .project-item-select-holder {
        display: block;
        margin: 0;
      }
244
    }
245
  }
246 247 248 249 250 251

  &.adjust {
    .nav-text, .nav-controls {
      width: auto;
    }
  }
252
}
253 254

.layout-nav {
255
  position: fixed;
A
Annabel Dunstone 已提交
256
  top: $header-height;
257
  width: 100%;
P
Phil Hughes 已提交
258
  z-index: 11;
D
Dmitriy Zaporozhets 已提交
259
  background: $background-color;
260
  border-bottom: 1px solid $border-color;
261
  transition: padding $sidebar-transition-duration;
262
  text-align: center;
263

264 265 266 267
  .container-fluid {
    position: relative;
  }

268 269
  .controls {
    float: right;
270
    padding: 7px 0 0;
271

272
    @media (max-width: $screen-sm-max) {
273
      display: none;
A
Annabel Dunstone 已提交
274 275
    }

276 277 278 279 280 281 282 283 284 285 286 287 288
    i {
      color: $layout-link-gray;
    }

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

    .fa-caret-down {
      margin-left: 5px;
      color: $gl-icon-color;
    }
289 290

    .dropdown {
P
Phil Hughes 已提交
291 292 293
      position: absolute;
      top: 7px;
      right: 15px;
294
      z-index: 2;
295 296 297 298

      li.active {
        font-weight: bold;
      }
299
    }
300 301
  }

302 303
  .nav-links {
    border-bottom: none;
304
    height: 51px;
305

306 307
    li {

308 309 310 311 312 313 314 315 316
      a {
        padding-top: 10px;
      }

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

      &.active {
317

318 319 320
        a, i {
          color: $black;
        }
321 322 323 324 325 326 327

        svg {
          path,
          polygon {
            fill: $black;
          }
        }
328 329
      }

330 331 332 333 334
      &:hover {
        a, i {
          color: $black;
        }
      }
335
    }
336
  }
337 338
}

339 340 341 342 343
.scrolling-tabs-container {
  position: relative;

  .nav-links {
    @include scrolling-links();
344
  }
345

346
  .fade-right {
347
    @include fade(left, $background-color);
348 349 350 351
    right: -5px;

    .fa {
      right: -7px;
352
    }
353
  }
354

355
  .fade-left {
356
    @include fade(right, $background-color);
357 358 359 360
    left: -5px;

    .fa {
      left: -7px;
361 362
    }
  }
363 364 365 366

  &.sub-nav-scroll {

    .fade-right {
367
      @include fade(left, $dark-background-color);
368 369 370 371 372 373 374 375
      right: 0;

      .fa {
        right: -23px;
      }
    }

    .fade-left {
376
      @include fade(right, $dark-background-color);
377 378 379 380 381 382 383
      left: 0;

      .fa {
        left: 10px;
      }
    }
  }
384 385
}

A
Annabel Dunstone 已提交
386 387 388 389 390 391 392
.nav-block {
  position: relative;

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

    .fade-right {
393
      @include fade(left, $white-light);
394 395 396 397 398
      right: -5px;

      .fa {
        right: -7px;
      }
A
Annabel Dunstone 已提交
399 400 401
    }

    .fade-left {
402
      @include fade(right, $white-light);
403 404 405 406 407
      left: -5px;

      .fa {
        left: -7px;
      }
A
Annabel Dunstone 已提交
408 409 410 411
    }
  }
}

412
.page-with-layout-nav {
413
  margin-top: $header-height + 2;
A
Annabel Dunstone 已提交
414

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

.activities {

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

    .nav-links {
      border-bottom: none;
    }
  }
}