This commit is contained in:
itchyny 2025-04-14 19:48:08 +00:00 committed by GitHub
commit 5e38989e27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -267,6 +267,7 @@
} }
.navbar-dark, .navbar-dark,
[data-bs-theme="dark"] .navbar,
.navbar[data-bs-theme="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};

View File

@ -328,7 +328,7 @@ 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`. **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 >}} {{< /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-*` and additional 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 root element, a parent wrapper, or the component itself for dark background colors. Then, customize with `.bg-*` and additional utilities.
<div class="bd-example"> <div class="bd-example">
<nav class="navbar navbar-expand-lg bg-dark border-bottom border-body" data-bs-theme="dark"> <nav class="navbar navbar-expand-lg bg-dark border-bottom border-body" data-bs-theme="dark">