mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Merge ddcb9a358509ec575fb207905629144a83974e0b into ec96eacd0e6f297a64ee058b22ce9f567c0860e3
This commit is contained in:
commit
caad37b859
@ -144,10 +144,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".accordion-button::after") {
|
||||||
.accordion-button::after {
|
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
|
||||||
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
|
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
|
||||||
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,16 +221,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".carousel") {
|
||||||
@if $color-mode-type == "media-query" {
|
@include carousel-dark();
|
||||||
.carousel {
|
|
||||||
@include carousel-dark();
|
|
||||||
}
|
|
||||||
} @else {
|
|
||||||
.carousel,
|
|
||||||
&.carousel {
|
|
||||||
@include carousel-dark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,9 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".btn-close") {
|
||||||
.btn-close {
|
@include btn-close-white();
|
||||||
@include btn-close-white();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,8 +266,7 @@
|
|||||||
@include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true);
|
@include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-dark,
|
@mixin navbar-dark() {
|
||||||
.navbar[data-bs-theme="dark"] {
|
|
||||||
// scss-docs-start navbar-dark-css-vars
|
// scss-docs-start navbar-dark-css-vars
|
||||||
--#{$prefix}navbar-color: #{$navbar-dark-color};
|
--#{$prefix}navbar-color: #{$navbar-dark-color};
|
||||||
--#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
|
--#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
|
||||||
@ -280,10 +279,16 @@
|
|||||||
// scss-docs-end navbar-dark-css-vars
|
// scss-docs-end navbar-dark-css-vars
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-dark {
|
||||||
|
@include navbar-dark();
|
||||||
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".navbar") {
|
||||||
.navbar-toggler-icon {
|
@include navbar-dark();
|
||||||
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
|
}
|
||||||
}
|
|
||||||
|
@include color-mode(dark, ".navbar-toggler-icon") {
|
||||||
|
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
|
||||||
// scss-docs-start root-dark-mode-vars
|
// scss-docs-start root-dark-mode-vars
|
||||||
|
@ -181,9 +181,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".form-switch .form-check-input:not(:checked):not(:focus)") {
|
||||||
.form-switch .form-check-input:not(:checked):not(:focus) {
|
--#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
|
||||||
--#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,9 +72,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-dark-mode {
|
@if $enable-dark-mode {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".form-select") {
|
||||||
.form-select {
|
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
|
||||||
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// scss-docs-start color-mode-mixin
|
// scss-docs-start color-mode-mixin
|
||||||
@mixin color-mode($mode: light, $root: false) {
|
@mixin color-mode($mode: light, $selector: null) {
|
||||||
@if $color-mode-type == "media-query" {
|
@if $color-mode-type == media-query {
|
||||||
@if $root == true {
|
@if $selector == null {
|
||||||
@media (prefers-color-scheme: $mode) {
|
@media (prefers-color-scheme: $mode) {
|
||||||
:root {
|
:root {
|
||||||
@content;
|
@content;
|
||||||
@ -9,12 +9,35 @@
|
|||||||
}
|
}
|
||||||
} @else {
|
} @else {
|
||||||
@media (prefers-color-scheme: $mode) {
|
@media (prefers-color-scheme: $mode) {
|
||||||
@content;
|
#{$selector} {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} @else {
|
} @else {
|
||||||
[data-bs-theme="#{$mode}"] {
|
@if $selector == null {
|
||||||
@content;
|
[data-bs-theme="#{$mode}"] {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
} @else {
|
||||||
|
$tmp: str-replace($selector, " ", "[data-bs-theme=\"#{$mode}\"] ");
|
||||||
|
@if $tmp != $selector {
|
||||||
|
#{$tmp},
|
||||||
|
[data-bs-theme="#{$mode}"] #{$selector},
|
||||||
|
#{$selector}[data-bs-theme="#{$mode}"] {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
} @else if str-index($selector, $substring: "::") != null {
|
||||||
|
[data-bs-theme="#{$mode}"] #{$selector},
|
||||||
|
#{str-replace($selector, "::", "[data-bs-theme=\"#{$mode}\"]::")} {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
} @else {
|
||||||
|
[data-bs-theme="#{$mode}"] #{$selector},
|
||||||
|
#{$selector}[data-bs-theme="#{$mode}"] {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,18 +10,17 @@
|
|||||||
@include it("generates data attribute selectors for dark mode") {
|
@include it("generates data attribute selectors for dark mode") {
|
||||||
@include assert() {
|
@include assert() {
|
||||||
@include output() {
|
@include output() {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".element") {
|
||||||
.element {
|
color: var(--bs-primary-text-emphasis);
|
||||||
color: var(--bs-primary-text-emphasis);
|
background-color: var(--bs-primary-bg-subtle);
|
||||||
background-color: var(--bs-primary-bg-subtle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
--custom-color: #{mix($indigo, $blue, 50%)};
|
--custom-color: #{mix($indigo, $blue, 50%)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@include expect() {
|
@include expect() {
|
||||||
[data-bs-theme=dark] .element {
|
[data-bs-theme=dark] .element,
|
||||||
|
.element[data-bs-theme=dark] {
|
||||||
color: var(--bs-primary-text-emphasis);
|
color: var(--bs-primary-text-emphasis);
|
||||||
background-color: var(--bs-primary-bg-subtle);
|
background-color: var(--bs-primary-bg-subtle);
|
||||||
}
|
}
|
||||||
@ -39,13 +38,11 @@
|
|||||||
|
|
||||||
@include assert() {
|
@include assert() {
|
||||||
@include output() {
|
@include output() {
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".element") {
|
||||||
.element {
|
color: var(--bs-primary-text-emphasis);
|
||||||
color: var(--bs-primary-text-emphasis);
|
background-color: var(--bs-primary-bg-subtle);
|
||||||
background-color: var(--bs-primary-bg-subtle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
--custom-color: #{mix($indigo, $blue, 50%)};
|
--custom-color: #{mix($indigo, $blue, 50%)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,8 +126,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark, ".bd-navbar") {
|
||||||
.bd-navbar {
|
box-shadow: 0 .5rem 1rem rgba($black, .15), inset 0 -1px 0 rgba($white, .15);
|
||||||
box-shadow: 0 .5rem 1rem rgba($black, .15), inset 0 -1px 0 rgba($white, .15);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
--docsearch-logo-color: var(--bd-violet);
|
--docsearch-logo-color: var(--bd-violet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
// From here, the values are copied from https://cdn.jsdelivr.net/npm/@docsearch/css@3
|
// From here, the values are copied from https://cdn.jsdelivr.net/npm/@docsearch/css@3
|
||||||
// in html[data-theme="dark"] selector
|
// in html[data-theme="dark"] selector
|
||||||
// and are slightly modified for formatting purpose
|
// and are slightly modified for formatting purpose
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
--base0F: #333;
|
--base0F: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
// --base00: #282c34;
|
// --base00: #282c34;
|
||||||
// --base01: #353b45;
|
// --base01: #353b45;
|
||||||
--base02: #3e4451;
|
--base02: #3e4451;
|
||||||
|
@ -24,7 +24,7 @@ $bd-callout-variants: info, warning, danger !default;
|
|||||||
--bd-pre-bg: var(--bs-tertiary-bg);
|
--bd-pre-bg: var(--bs-tertiary-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include color-mode(dark, true) {
|
@include color-mode(dark) {
|
||||||
--bd-violet: #{mix($bd-violet, $white, 75%)};
|
--bd-violet: #{mix($bd-violet, $white, 75%)};
|
||||||
--bd-violet-bg: #{$bd-violet};
|
--bd-violet-bg: #{$bd-violet};
|
||||||
--bd-toc-color: var(--#{$prefix}emphasis-color);
|
--bd-toc-color: var(--#{$prefix}emphasis-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user