nav.css 6.51 KB
Newer Older
hyeryung's avatar
hyeryung committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
@media screen and (max-width: 1023.5px) {
  html.is-clipped--nav {
    overflow-y: hidden;
  }
}

.nav-container {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: 100%;
  font-size: calc(17 / var(--rem-base) * 1rem);
  z-index: var(--z-index-nav);
  visibility: hidden;
}

@media screen and (min-width: 769px) {
  .nav-container {
박민석's avatar
박민석 committed
19 20
    /* width: var(--nav-width); */
    width: 20.125rem;
hyeryung's avatar
hyeryung committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
  }
}

@media screen and (min-width: 1024px) {
  .nav-container {
    font-size: calc(15.5 / var(--rem-base) * 1rem);
    flex: none;
    position: static;
    top: 0;
    visibility: visible;
  }
}

.nav-container.is-active {
  visibility: visible;
}

.nav {
minseok.park's avatar
minseok.park committed
39 40
  /* background: var(--nav-background); */
  background: var(--color-white);
hyeryung's avatar
hyeryung committed
41 42 43
  position: relative;
  top: var(--toolbar-height);
  height: var(--nav-height);
hyeryung's avatar
hyeryung committed
44
  border-right: 1px solid var(--color-blue-30);
hyeryung's avatar
hyeryung committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
}

@media screen and (min-width: 769px) {
  .nav {
    box-shadow: 0.5px 0 3px var(--nav-border-color);
  }
}

@media screen and (min-width: 1024px) {
  .nav {
    top: var(--navbar-height);
    box-shadow: none;
    position: sticky;
    height: var(--nav-height--desktop);
  }
}

.nav a {
  color: inherit;
}

.nav .panels {
  display: flex;
  flex-direction: column;
  height: inherit;
}

.nav-panel-menu {
  overflow-y: scroll;
  overscroll-behavior: none;
  height: var(--nav-panel-menu-height);
박민석's avatar
박민석 committed
76
  padding: 1.25em;
minseok.park's avatar
minseok.park committed
77
  padding-top: 0;
hyeryung's avatar
hyeryung committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
}

.nav-panel-menu:not(.is-active) .nav-menu {
  opacity: 0.75;
}

.nav-panel-menu:not(.is-active)::after {
  content: "";
  background: rgba(0, 0, 0, 0.5);
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.nav-menu {
  min-height: 100%;
  position: relative;
박민석's avatar
박민석 committed
98 99
  padding: 0.5rem 0.5rem 0.5rem 0;
  line-height: 1.375;
hyeryung's avatar
hyeryung committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
}

.nav-menu-toggle {
  background: transparent url(../img/octicons-16.svg#view-unfold) no-repeat center / 100% 100%;
  border: none;
  float: right;
  height: 1em;
  margin-right: -0.5rem;
  opacity: 0.75;
  outline: none;
  padding: 0;
  position: sticky;
  top: calc((var(--nav-line-height) - 1 + 0.5) * 1rem);
  visibility: hidden;
  width: 1em;
}

.nav-menu-toggle.is-active {
  background-image: url(../img/octicons-16.svg#view-fold);
}

.nav-panel-menu.is-active:hover .nav-menu-toggle {
  visibility: visible;
}

.nav-menu h3.title {
  color: var(--nav-heading-font-color);
  font-size: inherit;
  font-weight: var(--body-font-weight-bold);
  margin: 0;
130
  padding: 0.25em 0 0.125em 0.75em;
hyeryung's avatar
hyeryung committed
131 132 133 134 135
}

.nav-list {
  list-style: none;
  padding: 0;
박민석's avatar
박민석 committed
136
  margin: 0;
hyeryung's avatar
hyeryung committed
137 138 139 140 141 142 143 144
}

.nav-menu > .nav-list + .nav-list {
  margin-top: 0.5rem;
}

.nav-item {
  margin-top: 0.5em;
박민석's avatar
박민석 committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
  position: relative;
}

.nav-item .nav-link {
  padding: 0.5rem 0 0.35rem 0.25rem;
  display: block;
  border-bottom: 1px solid transparent;
  border-radius: 3px;
}

.nav-item .nav-link:hover {
  border-bottom: 1px solid var(--color-bwg-main);
  border-radius: 0;
}

박민석's avatar
박민석 committed
160
.nav-item.is-current-page > a {
박민석's avatar
박민석 committed
161 162
  background: var(--color-bwg-main);
  color: var(--color-white);
hyeryung's avatar
hyeryung committed
163 164 165 166 167 168 169 170 171 172 173 174 175
}

/* adds some breathing room below a nested list */
.nav-item-toggle ~ .nav-list {
  padding-bottom: 0.125rem;
}

/* matches list without a title */
.nav-item[data-depth="0"] > .nav-list:first-child {
  display: block;
  margin: 0;
}

176
.nav-item[data-depth="0"] > .nav-link {
박민석's avatar
박민석 committed
177 178 179
  padding-left: 1.25rem;
}

180
.nav-item[data-depth="0"] > .nav-item-toggle {
박민석's avatar
박민석 committed
181 182 183
  left: 1rem;
}

184
.nav-item[data-depth="1"] > .nav-link {
박민석's avatar
박민석 committed
185 186 187
  padding-left: 1.75rem;
}

188
.nav-item[data-depth="1"] > .nav-item-toggle {
박민석's avatar
박민석 committed
189 190 191
  left: 1.5rem;
}

192
.nav-item[data-depth="2"] > .nav-link {
박민석's avatar
박민석 committed
193 194 195
  padding-left: 2.25rem;
}

196
.nav-item[data-depth="2"] > .nav-item-toggle {
박민석's avatar
박민석 committed
197 198 199
  left: 2rem;
}

200 201 202 203 204 205 206 207
.nav-item[data-depth="3"] > .nav-link {
  padding-left: 2.75rem;
}

.nav-item[data-depth="3"] > .nav-item-toggle {
  left: 2.5rem;
}

hyeryung's avatar
hyeryung committed
208 209 210 211 212 213 214 215 216 217 218 219 220
.nav-item:not(.is-active) > .nav-list {
  display: none;
}

.nav-item-toggle {
  background: transparent url(../img/caret.svg) no-repeat center / 50%;
  border: none;
  outline: none;
  line-height: inherit;
  padding: 0;
  position: absolute;
  height: calc(var(--nav-line-height) * 1em);
  width: calc(var(--nav-line-height) * 1em);
박민석's avatar
박민석 committed
221
  margin-top: 0.35em;
hyeryung's avatar
hyeryung committed
222
  margin-left: calc(var(--nav-line-height) * -1em);
박민석's avatar
박민석 committed
223
  top: 0.15rem;
hyeryung's avatar
hyeryung committed
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
}

.nav-item.is-active > .nav-item-toggle {
  transform: rotate(90deg);
}

.is-current-page > .nav-link,
.is-current-page > .nav-text {
  font-weight: var(--body-font-weight-bold);
}

.nav-panel-explore {
  background: var(--nav-background);
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.nav-panel-explore:not(:first-child) {
  top: auto;
  max-height: var(--nav-panel-explore-height);
}

.nav-panel-explore .context {
  font-size: calc(15 / var(--rem-base) * 1rem);
  flex-shrink: 0;
  color: var(--nav-muted-color);
  box-shadow: 0 -1px 0 var(--nav-panel-divider-color);
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
  height: var(--drawer-height);
}

.nav-panel-explore:not(:first-child) .context {
  cursor: pointer;
}

.nav-panel-explore .context .version {
  display: flex;
  align-items: inherit;
}

.nav-panel-explore .context .version::after {
  content: "";
  background: url(../img/chevron.svg) no-repeat center right / auto 100%;
  width: 1.25em;
  height: 0.75em;
}

.nav-panel-explore .components {
  line-height: var(--nav-line-height);
  flex-grow: 1;
  box-shadow: inset 0 1px 5px var(--nav-panel-divider-color);
  background: var(--nav-secondary-background);
  padding: 0.75rem 0.75rem 0 0.75rem;
  margin: 0;
  overflow-y: scroll;
  overscroll-behavior: none;
  max-height: 100%;
  display: block;
}

.nav-panel-explore:not(.is-active) .components {
  display: none;
}

.nav-panel-explore .component {
  display: block;
}

.nav-panel-explore .component + .component {
  margin-top: 0.75rem;
}

.nav-panel-explore .component:last-child {
  margin-bottom: 0.75rem;
}

.nav-panel-explore .component .title {
  font-weight: var(--body-font-weight-bold);
  text-indent: 0.375rem hanging;
}

.nav-panel-explore .versions {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin: -0.125rem -0.375rem 0 0.375rem;
  line-height: 1;
  list-style: none;
}

.nav-panel-explore .component .version {
  margin: 0.375rem 0.375rem 0 0;
}

.nav-panel-explore .component .version a {
  background: var(--nav-border-color);
  border-radius: 0.25rem;
  white-space: nowrap;
  padding: 0.25em 0.5em;
  display: inherit;
  opacity: 0.75;
}

.nav-panel-explore .component .is-current a {
  background: var(--nav-heading-font-color);
  color: var(--nav-secondary-background);
  font-weight: var(--body-font-weight-bold);
  opacity: 1;
}