Replies: 4 comments
-
I don't have the whole source code so I will make some assumptions in my answer. The table background color in In Without recompiling Bootstrap, there will be another possibility in JS to simulate our "auto" mode in the documentation based on https://github.com/twbs/bootstrap/blob/main/site/static/docs/5.3/assets/js/color-modes.js but I wouldn't recommend this approach. |
Beta Was this translation helpful? Give feedback.
-
Thanks @julien-deramond. I think you pretty much answered the question as to what changed... in I couldn't figure out where to put the Thanks for the explanation... I'm afraid CSS/frontend/html/sass isn't my strong suit. |
Beta Was this translation helpful? Give feedback.
-
Is there a reason why we apply the color scheme rules of the "media-query" (browser/os prefs) on top of the "data attribute" ? @media (prefers-color-scheme: dark) :root {
//...
:root, [data-bs-theme=dark] {
//... This seems counter intuitive for me, because we can't use both in an effective way. :root, [data-bs-theme=dark] {
//...
@media (prefers-color-scheme: dark) :root {
//... Wouldn't it seem easier ? |
Beta Was this translation helpful? Give feedback.
-
It probably would be easier after the implementation. Frankly, it's a personal project, and I just wanted the bare minimum for light mode/dark mode (aka, I don't want to put in the time required to change it). But thank you for the ideas. |
Beta Was this translation helpful? Give feedback.
-
I am using bootstrap in a Jekyll-built website with bootstrap's tables.
On Bootstrap
v5.3.0-alpha3
, I can use the default variant in order to have the tables change their background color automatically when the computer/mobile system's light/dark mode changes.But starting in
v5.3.0
, the default variant no longer works like that (on my website at least). Instead, setting no variant means that the table just looks like light mode all the time, even when switching the computer system to dark mode.I bypassed the issue by setting this in my code (allows me to fully customize the background colors of all tables based on
prefers-color-scheme: dark
):But I'd prefer if it just works when the system settings change automatically.
Here is a video of the CSS working on
v5.3.0-alpha3
: https://github.com/twbs/bootstrap/assets/7562793/30d30c1c-1965-44e1-ab4a-75896b5f6426Here is a video of the CSS not working on
v5.3.0
: https://github.com/twbs/bootstrap/assets/7562793/673e4550-0dd3-4418-86b1-f53febd5687dBeta Was this translation helpful? Give feedback.
All reactions