0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-21 18:54:30 +01:00
Bootstrap/assets/scss/_sidebar.scss

152 lines
2.4 KiB
SCSS
Raw Normal View History

2016-12-29 13:22:45 -08:00
// scss-lint:disable VendorPrefix
//
// Side navigation
//
.bd-toc {
@supports (position: sticky) {
position: sticky;
top: 4rem;
max-height: calc(100vh - 4rem);
}
padding-top: 1.5rem;
padding-bottom: 1.5rem;
overflow-y: auto;
2017-05-28 18:01:24 -07:00
font-size: .875rem;
}
.section-nav {
padding-left: 0;
border-left: 1px solid #eee;
ul {
padding-left: 1rem;
2017-05-27 22:12:18 -07:00
ul {
display: none;
}
}
}
.toc-entry {
display: block;
a {
display: block;
padding: .25rem 1.5rem;
color: #99979c;
&:hover {
color: $brand-primary;
text-decoration: none;
}
}
}
.bd-sidebar {
2017-05-28 21:40:23 -07:00
background-color: #f5f2f9;
2017-05-28 18:01:24 -07:00
border-bottom: 1px solid rgba(0,0,0,.1);
2017-05-27 17:36:35 -07:00
@include media-breakpoint-up(md) {
@supports (position: sticky) {
position: sticky;
top: 4rem;
max-height: calc(100vh - 4rem);
}
2016-09-05 22:41:10 -07:00
overflow-y: auto;
2017-05-28 18:01:24 -07:00
border-right: 1px solid rgba(0,0,0,.1);
}
2017-05-27 18:47:45 -07:00
@include media-breakpoint-up(xl) {
max-width: 320px;
}
}
2016-10-24 16:06:32 -07:00
.bd-links {
2017-05-27 17:36:35 -07:00
margin-right: -15px;
margin-left: -15px;
2017-05-28 17:49:46 -07:00
// Override collapse behaviors
@include media-breakpoint-up(md) {
display: block !important;
}
2016-10-24 16:06:32 -07:00
}
.bd-search {
2017-05-28 18:50:53 +02:00
position: relative; // To contain the Algolia search
2017-05-27 18:30:58 -07:00
padding-top: 1rem;
padding-bottom: 1rem;
2017-05-28 22:23:27 -07:00
.form-control:focus {
border-color: $bd-purple-bright;
box-shadow: 0 0 0 3px rgba($bd-purple-bright, .25);
}
}
2017-05-28 17:49:46 -07:00
.bd-search-docs-toggle {
line-height: 1;
color: $gray-dark;
}
.bd-sidenav {
display: none;
}
.bd-toc-link {
display: block;
2017-05-27 17:36:35 -07:00
padding: .75rem 1.5rem;
2017-05-27 18:30:58 -07:00
font-weight: 500;
color: $gray;
2017-05-27 18:30:58 -07:00
2017-05-28 21:40:23 -07:00
&:hover {
color: $brand-primary;
text-decoration: none;
background-color: rgba(0,0,0,.01);
}
}
2016-10-24 16:06:32 -07:00
.bd-toc-item {
2017-05-28 21:40:23 -07:00
border-bottom: 1px solid rgba(0,0,0,.05);
2017-05-27 18:30:58 -07:00
&:first-child {
2017-05-28 21:40:23 -07:00
border-top: 1px solid rgba(0,0,0,.05);
2016-10-24 16:06:32 -07:00
}
2017-05-27 18:30:58 -07:00
&.active {
> .bd-toc-link {
color: $gray-dark;
2017-05-28 21:40:23 -07:00
&:hover {
background-color: transparent;
}
2017-05-27 18:30:58 -07:00
}
> .bd-sidenav {
display: block;
padding-bottom: .75rem;
2017-05-27 18:30:58 -07:00
}
}
2016-10-24 16:06:32 -07:00
}
// All levels of nav
.bd-sidebar .nav > li > a {
display: block;
2017-05-27 17:36:35 -07:00
padding: .25rem 1.5rem;
font-size: 90%;
2017-05-28 21:40:23 -07:00
color: rgba(0,0,0,.65);
}
2017-05-27 18:30:58 -07:00
.bd-sidebar .nav > li > a:hover {
color: $brand-primary;
text-decoration: none;
background-color: transparent;
}
2017-05-27 18:30:58 -07:00
.bd-sidebar .nav > .active > a,
2017-05-27 18:30:58 -07:00
.bd-sidebar .nav > .active:hover > a {
font-weight: 500;
color: $gray-dark;
background-color: transparent;
}