From a6dc107dfd19f1e804b833a46b2d3f4045679452 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 19 May 2023 09:05:09 -0700 Subject: [PATCH] Add data attr selector for dark mode navbars (#38522) * Add data attr selector for dark mode navbars * Fix dark example --- scss/_navbar.scss | 3 ++- site/content/docs/5.3/components/navbar.md | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scss/_navbar.scss b/scss/_navbar.scss index 76ac085c10..71619382cd 100644 --- a/scss/_navbar.scss +++ b/scss/_navbar.scss @@ -266,7 +266,8 @@ @include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true); } -.navbar-dark { +.navbar-dark, +.navbar[data-bs-theme="dark"] { // scss-docs-start navbar-dark-css-vars --#{$prefix}navbar-color: #{$navbar-dark-color}; --#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color}; diff --git a/site/content/docs/5.3/components/navbar.md b/site/content/docs/5.3/components/navbar.md index 277ef04295..9b9f86a4dc 100644 --- a/site/content/docs/5.3/components/navbar.md +++ b/site/content/docs/5.3/components/navbar.md @@ -328,10 +328,10 @@ Mix and match with other components and utilities as needed. **New in v5.2.0 —** Navbar theming is now powered by CSS variables and `.navbar-light` has been deprecated. CSS variables are applied to `.navbar`, defaulting to the "light" appearance, and can be overridden with `.navbar-dark`. {{< /callout >}} -Navbar themes are easier than ever thanks to Bootstrap's combination of Sass and CSS variables. The default is our "light navbar" for use with light background colors, but you can also apply `data-bs-theme="dark"` to the `.navbar` parent for dark background colors. Then, customize with `.bg-*` utilities. +Navbar themes are easier than ever thanks to Bootstrap's combination of Sass and CSS variables. The default is our "light navbar" for use with light background colors, but you can also apply `data-bs-theme="dark"` to the `.navbar` parent for dark background colors. Then, customize with `.bg-*` and additional utilities.
-