Skip to content

Dark dropdowns/navbars don't get dark variables with dark theme #39984

@karlshea

Description

@karlshea

Prerequisites

Describe the issue

There are two separate but I think related issues:

  1. .navbar-dark is marked as deprecated in 5.3, and adding data-bs-theme="dark" to it enables dark color variables. However, setting it on a parent component does not enable those variables.
  2. .dropdown-menu-dark is marked as deprecated in 5.3 but data-bs-theme="dark" doesn't work at all.

Dark navbar code:

.navbar-dark,
.navbar[data-bs-theme="dark"] {
  ...
}

Dark dropdown code:

.dropdown-menu-dark  {
  ...
}

I think I would expect both to work like this:

.navbar-dark,
[data-bs-theme="dark"] .navbar,
.navbar[data-bs-theme="dark"] {
  ...
}

.dropdown-menu-dark,
[data-bs-theme="dark"] .dropdown-menu,
.dropdown-menu[data-bs-theme="dark"] {
  ...
}

Reduced test cases

Use the dark mode toggle on the documentation site, when in dark mode the dropdowns/navbars do not have the configured dark styles that appear when specifically setting navbar-dark or dropdown-menu-dark.

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.3.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions