0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-10 22:24:19 +01:00
Bootstrap/docs/assets/scss/_sidebar.scss
2017-05-27 20:10:02 -07:00

120 lines
1.8 KiB
SCSS

// scss-lint:disable VendorPrefix
//
// Side navigation
//
.bd-sidebar {
background-color: #f5f5f5;
border-right: 1px solid rgba(0,0,0,.1);
@include media-breakpoint-up(md) {
position: sticky;
top: 4rem;
max-height: calc(100vh - 4rem);
overflow-y: auto;
}
@include media-breakpoint-up(xl) {
max-width: 320px;
}
}
.bd-links {
margin-right: -15px;
margin-left: -15px;
}
.bd-search {
position: relative;
padding-top: 1rem;
padding-bottom: 1rem;
}
.bd-search-results {
right: 0;
display: block;
padding: 0;
overflow: hidden;
font-size: .85rem;
&:empty {
display: none;
}
.dropdown-item {
padding-right: .75rem;
padding-left: .75rem;
&:first-child { margin-top: .25rem; }
&:last-child { margin-bottom: .25rem; }
}
.no-results {
padding: .75rem 1rem;
color: #7a7a7a;
text-align: center;
white-space: normal; // Undo .dropdown-item defaults
}
}
.bd-sidenav {
display: none;
}
.bd-toc-link {
display: block;
padding: .75rem 1.5rem;
font-weight: 500;
color: $gray;
}
.bd-toc-link:hover {
color: $brand-primary;
text-decoration: none;
background-color: #fafafa;
}
.bd-toc-item {
&:first-child {
border-top: 1px solid $gray-lighter;
}
&:not(:last-child) {
border-bottom: 1px solid $gray-lighter;
}
&.active {
background-color: #fafafa;
> .bd-toc-link {
color: $gray-dark;
}
> .bd-sidenav {
display: block;
}
}
}
// All levels of nav
.bd-sidebar .nav > li > a {
display: block;
padding: .25rem 1.5rem;
font-size: 90%;
color: #99979c;
}
.bd-sidebar .nav > li > a:hover {
color: $brand-primary;
text-decoration: none;
background-color: transparent;
}
.bd-sidebar .nav > .active > a,
.bd-sidebar .nav > .active:hover > a {
font-weight: 500;
color: $gray-dark;
background-color: transparent;
}