Skip to content

Commit 3b04c7f

Browse files
committed
Fix Navbar colors for dark theme with global data-bs-theme attribute
1 parent e946bf7 commit 3b04c7f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

scss/_navbar.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@
267267
}
268268

269269
.navbar-dark,
270+
[data-bs-theme="dark"] .navbar,
270271
.navbar[data-bs-theme="dark"] {
271272
// scss-docs-start navbar-dark-css-vars
272273
--#{$prefix}navbar-color: #{$navbar-dark-color};

site/content/docs/5.3/components/navbar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Mix and match with other components and utilities as needed.
328328
**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`.
329329
{{< /callout >}}
330330

331-
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.
331+
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 root element, a parent wrapper, or the component itself. Then, customize with `.bg-*` and additional utilities.
332332

333333
<div class="bd-example">
334334
<nav class="navbar navbar-expand-lg bg-dark border-bottom border-bottom-dark" data-bs-theme="dark">

0 commit comments

Comments
 (0)