2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00
Files
Mark Otto b85169ef1c Add dark mode support
Heavily WIP still, but this begins the process of implementing dark mode for our docs and across the project itself.

- Color modes are toggled in the docs navbar with a custom toggler, which stores the select color mode in local storage.
- Color modes can also be set via data attribute thanks to `data-theme` (with light or dark options available currently).
- Docs are heavily WIP for demonstrating the dark mode.
- In order to best implement color modes, I've spiked out a number of new Sass and CSS variables (e.g., `--bs-secondary-bg` and `--bs-tertiary-bg`). In addition, I've added new global CSS variables like `--bs-border-color` and more. So, in addition to general color modes and theming support, we get greater real-time customization, too.

Todos and open questions:

- [ ] Do we refer to these as themes or color modes?
- [ ] Do we provide a color mode toggler JS plugin?
- [ ] Update all components to better utilize global CSS variables so they can be more easily themed (e.g., see `$dropdown-*` Sass variable changes in the diff).
2022-02-24 17:19:14 -08:00

61 lines
1.2 KiB
SCSS

.bd-sidebar {
@include media-breakpoint-up(lg) {
position: sticky;
top: 5rem;
// Override collapse behaviors
// stylelint-disable-next-line declaration-no-important
display: block !important;
height: subtract(100vh, 6rem);
// Prevent focus styles to be cut off:
padding-left: .25rem;
margin-left: -.25rem;
overflow-y: auto;
}
@include media-breakpoint-down(lg) {
.offcanvas-lg {
border-right-color: var(--bs-border-color);
box-shadow: $box-shadow-lg;
}
}
}
.bd-links-nav {
@include media-breakpoint-down(lg) {
font-size: .875rem;
}
@include media-breakpoint-between(xs, lg) {
column-count: 2;
column-gap: 1.5rem;
.bd-links-group {
break-inside: avoid;
}
.bd-links-span-all {
column-span: all;
}
}
}
.bd-links-link {
padding: .1875rem .5rem;
margin-top: .125rem;
margin-left: 1.125rem;
color: var(--bs-body-color);
text-decoration: if($link-decoration == none, null, none);
&:hover,
&:focus,
&.active {
color: var(--bs-heading-color);
text-decoration: if($link-hover-decoration == underline, none, null);
background-color: var(--bd-sidebar-link-bg);
}
&.active {
font-weight: 600;
}
}