2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00
Files
bootstrap/site/assets/scss/_masthead.scss
T
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

75 lines
1.3 KiB
SCSS

.bd-masthead {
padding: 3rem 0;
background: linear-gradient(165deg, rgba(var(--bd-violet-rgb), .05) 50%, var(--bs-body-bg) 50%);
h1 {
@include font-size(4rem);
}
.lead {
@include font-size(1rem);
font-weight: 400;
color: var(--bs-secondary-color);
}
.highlight {
padding: .5rem 4rem .5rem 1rem;
margin-bottom: 0;
line-height: 1.25;
@include border-radius(.5rem);
}
.btn-clipboard {
top: .5rem;
}
#carbonads { // stylelint-disable-line selector-max-id
margin-inline: auto;
}
@include media-breakpoint-up(md) {
.lead {
@include font-size(1.5rem);
}
}
}
.bd-masthead-followup {
.lead {
@include font-size(1rem);
}
.highlight {
@include border-radius(.5rem);
}
@include media-breakpoint-up(md) {
.lead {
@include font-size(1.25rem);
}
}
}
.bd-btn-lg {
padding: .8rem 2rem;
}
.masthead-followup-icon {
padding: 1rem;
background-color: currentColor;
background-image: linear-gradient(to bottom right, rgba(255, 255, 255, .01), currentColor);
background-blend-mode: multiply;
@include border-radius(1rem);
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .15);
svg { color: #fff; }
}
.masthead-followup-svg {
filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .125));
}
.masthead-notice {
--bg: #{to-rgb($teal)};
background-color: rgba(var(--bg), .2);
}