jgthms / bulma

Modern CSS framework based on Flexbox
https://bulma.io
MIT License
48.83k stars 3.92k forks source link

light and dark mode support for background color #3753

Open rajasimon opened 3 months ago

rajasimon commented 3 months ago

This is about Bulma.

Overview of the problem

Change the color based on the Dark mode.

Description

I have this in my code both html and body class when bulma was v0.9.4 has-background-white-ter and now I want my background to be has-background-black-ter when in Dark mode.

Is there a bulma way to do it?

kasperkamperman commented 3 months ago

I have the same issue and I expected that it would switch based on the description: For Dark Mode, Bulma will keep the same hue and saturation of the main scheme color. It will however invert the lightness of background, borders, text colors, and hover/active states.

It might be a possible bug, because no CSS variables seem to be used in this case. Or I misunderstood the new concept or documentation.

I have as html:

<aside class="has-background-white-bis">

And css in chrome show a "fixed" background-color, so not derived from variables (which would change when theme switching).

Screenshot 2024-04-01 at 21 56 41

Result in Light mode:

Screenshot 2024-04-01 at 21 55 03

Result in Dark mode:

Screenshot 2024-04-01 at 21 54 49
jonnyeom commented 4 weeks ago

This would be very helpful. I would imagine this would work for other components such as footer.

Right now, if you set a custom footer background color, the auto-dark-mode give unexpected results