-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
As of Bootstrap 5.3, we have lost the ".btn-close-white" class. In theory, this seems fine since the flip is now handled by the new "dark mode" implementation, however it can present and issue if the button is placed over an element of similar lightness.
Take for example, the following:
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header bg-warning">
<img src="..." class="rounded me-2" alt="...">
<strong class="me-auto">Warning!</strong>
<small>11 mins ago</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
This is a warning message.
</div>
</div>
Under the light theme everything looks okay, however as soon as you flip to the dark theme the X switches to the lighter colour and becomes difficult to see:
I realize I could manually set the data-bs-theme on the button to force it to stay with the light theme, but that's more of a workaround. This is not necessarily true depending on how and when you call in your theme, I think? It worked in my code pen, but not on the site that I'm working on.
Disclaimer:
I am incredibly new to SASS, so:
- I have no idea if this can be extended like many of the other classes can be.
- It is entirely possible that the problem is between the chair and the keyboard here 😅
Reduced test cases
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.3.2