bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

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

Open levu42 opened this issue 1 year ago • 2 comments

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

levu42 avatar Jul 01 '23 14:07 levu42

@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.

kczx3 avatar Jan 29 '24 16:01 kczx3

The changes proposed in #38917 will fix this issue

tagliala avatar Jan 29 '24 16:01 tagliala