sidebar.scss 3.5 KB
Newer Older
1
.page-with-sidebar {
2
  padding-top: $header-height;
3
  padding-bottom: 25px;
4
  transition: padding $sidebar-transition-duration;
5

6 7 8 9 10 11
  &.page-sidebar-pinned {
    .sidebar-wrapper {
      @include box-shadow(none);
    }
  }

12 13 14
  .sidebar-wrapper {
    position: fixed;
    top: 0;
15
    bottom: 0;
16 17
    left: 0;
    height: 100%;
18 19
    overflow: hidden;
    transition: width $sidebar-transition-duration;
20
    @include box-shadow(2px 0 16px 0 #bbb);
21
  }
22 23 24
}

.sidebar-wrapper {
25
  z-index: 1000;
26
  background: $background-color;
P
Phil Hughes 已提交
27 28 29 30 31

  .nicescroll-rails-hr {
    // TODO: Figure out why nicescroll doesn't hide horizontal bar
    display: none!important;
  }
32 33 34 35
}

.content-wrapper {
  width: 100%;
36
  transition: padding $sidebar-transition-duration;
37 38

  .container-fluid {
39
    background: #fff;
40
    padding: 0 $gl-padding;
41 42 43 44 45 46

    &.container-blank {
      background: none;
      padding: 0;
      border: none;
    }
47
  }
48 49 50
}

.nav-sidebar {
P
Phil Hughes 已提交
51 52
  position: absolute;
  top: 50px;
53
  bottom: 0;
54
  width: $sidebar_width;
P
Phil Hughes 已提交
55 56
  overflow-y: auto;
  overflow-x: hidden;
57

P
Phil Hughes 已提交
58
  @media (min-width: $sidebar-breakpoint) {
59
    bottom: 50px;
P
Phil Hughes 已提交
60 61
  }

62
  &.navbar-collapse {
63
    padding: 0 !important;
64
  }
65

66 67 68 69
  li {
    &.separate-item {
      padding-top: 10px;
      margin-top: 10px;
70 71
    }

72 73 74 75 76 77
    .icon-container {
      width: 34px;
      display: inline-block;
      text-align: center;
    }

78
    a {
79
      padding: 7px 15px;
D
Dmitriy Zaporozhets 已提交
80
      font-size: $gl-font-size;
81
      line-height: 24px;
82
      display: block;
83
      text-decoration: none;
84
      font-weight: normal;
I
Iman Mohamadi 已提交
85
      outline: none;
86

87 88 89
      &:hover,
      &:active,
      &:focus {
90 91 92 93
        text-decoration: none;
      }

      i {
94
        font-size: 16px;
A
Annabel Dunstone 已提交
95 96
      }

97 98 99
      i,
      svg {
        margin-right: 13px;
100
      }
D
Dmitriy Zaporozhets 已提交
101
    }
102
  }
103 104 105 106 107 108

  .count {
    float: right;
    padding: 0 8px;
    @include border-radius(6px);
  }
109 110
}

P
Phil Hughes 已提交
111 112
.toggle-nav-collapse {
  width: $sidebar_width;
113
  position: absolute;
114
  top: 0;
P
Phil Hughes 已提交
115
  left: 0;
116
  min-height: 50px;
117 118
  padding: 5px 0;
  font-size: 18px;
P
Phil Hughes 已提交
119
  line-height: 30px;
P
Phil Hughes 已提交
120 121 122 123 124
}

.nav-header-btn {
  padding: 10px 5px;
  color: inherit;
P
Phil Hughes 已提交
125
  transition-duration: .3s;
126

P
Phil Hughes 已提交
127 128 129
  &:hover,
  &:focus {
    color: $white-light;
130 131
    text-decoration: none;
  }
132
}
133

P
Phil Hughes 已提交
134
.pin-nav-btn {
P
Phil Hughes 已提交
135
  display: none;
P
Phil Hughes 已提交
136
  position: absolute;
P
Phil Hughes 已提交
137 138 139 140 141 142 143 144 145
  left: 0;
  bottom: 0;
  height: 50px;
  width: $sidebar_width;
  line-height: 30px;

  @media (min-width: $sidebar-breakpoint) {
    display: block;
  }
P
Phil Hughes 已提交
146 147 148 149 150 151 152 153 154

  .fa {
    transition: transform .15s;
  }

  &.is-active {
    .fa {
      transform: rotate(90deg);
    }
A
Annabel Dunstone 已提交
155 156 157
  }
}

P
Phil Hughes 已提交
158
.page-sidebar-collapsed {
A
Annabel Dunstone 已提交
159
  padding-left: 0;
A
Annabel Dunstone 已提交
160

161
  .sidebar-wrapper {
A
Annabel Dunstone 已提交
162
    width: 0;
163 164
  }
}
165

P
Phil Hughes 已提交
166 167 168
.page-sidebar-expanded {
  .sidebar-wrapper {
    width: $sidebar_width;
P
Phil Hughes 已提交
169 170
  }
}
P
Phil Hughes 已提交
171

P
Phil Hughes 已提交
172 173 174
.page-sidebar-pinned {
  .content-wrapper,
  .layout-nav {
P
Phil Hughes 已提交
175
    @media (min-width: $sidebar-breakpoint) {
P
Phil Hughes 已提交
176
      padding-left: $sidebar_width;
P
Phil Hughes 已提交
177
    }
P
Phil Hughes 已提交
178 179
  }
}
P
Phil Hughes 已提交
180

P
Phil Hughes 已提交
181
header.header-pinned-nav {
P
Phil Hughes 已提交
182
  @media (min-width: $sidebar-breakpoint) {
P
Phil Hughes 已提交
183
    padding-left: ($sidebar_width + $gl-padding);
184 185 186 187 188 189 190 191

    .side-nav-toggle {
      display: none;
    }

    .header-content {
      padding-left: 0;
    }
P
Phil Hughes 已提交
192
  }
193 194
}

P
Phil Hughes 已提交
195
.right-sidebar-collapsed {
196
  padding-right: 0;
P
Phil Hughes 已提交
197

J
Jacob Schatz 已提交
198
  @media (min-width: $screen-sm-min) {
P
Phil Hughes 已提交
199
    padding-right: $sidebar_collapsed_width;
J
Jacob Schatz 已提交
200
  }
J
Jacob Schatz 已提交
201 202 203 204

  .sidebar-collapsed-icon {
    cursor: pointer;
  }
205 206
}

P
Phil Hughes 已提交
207 208 209 210
.right-sidebar-expanded {
  padding-right: 0;

  @media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
P
Phil Hughes 已提交
211 212 213
    &:not(.build-sidebar) {
      padding-right: $sidebar_collapsed_width;
    }
P
Phil Hughes 已提交
214 215 216 217 218
  }

  @media (min-width: $screen-md-min) {
    padding-right: $gutter_width;
  }
219 220 221 222

  &.with-overlay {
    padding-right: $sidebar_collapsed_width;
  }
223
}