Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btn-close: dark mode data attribute only works when on parent, not when on button directly #38853

Open
3 tasks done
Tracked by #2223
levu42 opened this issue Jul 1, 2023 · 2 comments · May be fixed by #38917
Open
3 tasks done
Tracked by #2223

btn-close: dark mode data attribute only works when on parent, not when on button directly #38853

levu42 opened this issue Jul 1, 2023 · 2 comments · May be fixed by #38917

Comments

@levu42
Copy link

levu42 commented Jul 1, 2023

Prerequisites

Describe the issue

According to the documentation,

Add data-bs-theme="dark" to the .btn-close, or to its parent element, to invert the close button.

It however doesn't work, when the data-bs-theme="dark" is placed on the btn-close itself, it only works, when it's placed on a parent. This is due to the SASS:

@if $enable-dark-mode {
  @include color-mode(dark) {
    .btn-close {
      @include btn-close-white();
    }
  }
}

Reduced test cases

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

Linux

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

Chrome

What version of Bootstrap are you using?

5.3.0

@louismaximepiton louismaximepiton moved this to Needs review in v5.3.1 Jul 17, 2023
@mdo mdo removed this from v5.3.1 Jul 25, 2023
@mdo mdo added this to v5.3.2 Jul 25, 2023
tagliala added a commit to tagliala/bootstrap that referenced this issue Jul 28, 2023
This workaround allows to use `data-bs-theme="dark"` directly on
`btn-close` tags to honor documentation and support use cases where a
white button is required in all themes

Fix twbs#38853
@julien-deramond julien-deramond removed this from v5.3.2 Sep 13, 2023
@github-project-automation github-project-automation bot moved this to To do in v5.3.3 Sep 13, 2023
@julien-deramond julien-deramond moved this from To do to Needs review in v5.3.3 Sep 13, 2023
@kczx3
Copy link

kczx3 commented Jan 29, 2024

@tagliala seems to have provided a patch for this to match the documented behavior although I don't see any pull requests for it here. Bummer its gotten pushed twice now for such a seemingly simple patch.

@tagliala
Copy link
Contributor

The changes proposed in #38917 will fix this issue

@julien-deramond julien-deramond removed this from v5.3.3 Feb 21, 2024
@julien-deramond julien-deramond moved this from To do to Needs review in v5.3.4 Feb 21, 2024
@github-project-automation github-project-automation bot moved this to To do in v5.3.4 Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs review
Development

Successfully merging a pull request may close this issue.

4 participants