-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Table contextual classes (table-danger etc) do not adapt to dark mode #39272
Comments
Thanks for opening this issue @Aileron79
|
Thanks, I did not see that - probably I checked an older version's documentation. Looking forward to v6 then. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm not sure if my issue is what the comment in the docs means, but when I upgraded to I did get as far into debugging to learn that the CSS works as I expect in The only way I found to workaround this is to put this in my CSS, and then change that color based on color mode: .table {
--bs-table-bg: #000000;
} But the strange thing is their docs (found here) do have the default variant changing based on the system's mode changing. Even just copy-pasting their basic table example doesn't work:
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table> |
@emmahsax I'm not sure to understand what the issue is here. I've created https://codepen.io/julien-deramond/pen/NWomqGo with the basic example you've copied and it works both with light and dark mode (by using Since it doesn't seem to be related to the variants, could you please create first a Q&A Discussion with maybe a CodePen in it? It seems to be rather a usage issue than a bug. |
I agree it is a usage issue, since it seems to work on your codepen and in their docs. But I will start a Q&A discussion. |
Prerequisites
Describe the issue
While alerts perfectly adapt to dark mode and change color accordingly, the contextual table classes (table-danger, table-success, ...) don't - looks kind of ugly, and very bright on a dark background. See screenshot and pen below.
Reduced test cases
https://codepen.io/Aileron79/pen/dywgNgY
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.1
The text was updated successfully, but these errors were encountered: