adrianm Another way of going about this, is adding a class to the body or .App element based on the settings and using that to apply the style changes.
This is what we will do with dark vs light mode in 2.0
DaleZ However, it seems that when (@config-dark-mode = true) and fof's Night Mode extension will can't work anymore, and they're valuable.
In 2.0 dark v light mode will have a clear class in the body so what was:
when (@config-dark-mode = true) {
...
}
// would become in 2.0
.dark {
...
}
fof's Night Mode will likely no longer we necessary since Flarum will be easily able to provide user light/dark switching.
The only real challenge I have run into so far, is the color functions. The primary color is configurable and since 1.x parses LESS on the backend, operations like these are possible:
--body-bg: @body-bg;
--body-bg-shaded: darken(@body-bg, 3%);
--body-bg-light: lighten(@body-bg, 5%);
--body-bg-faded: fade(@body-bg, 93%);
--text-color: @text-color;
--link-color: @link-color;
--heading-color: @heading-color;
--muted-color: @muted-color;
--muted-color-light: lighten(@muted-color, 10%);
--muted-color-dark: darken(@muted-color, 50%);
--muted-more-color: @muted-more-color;
--shadow-color: @shadow-color;
--control-bg: @control-bg;
--control-bg-light: lighten(@control-bg, 3%);
--control-bg-shaded: darken(@control-bg, 4%);
2.0 would still need to support such color operations somehow 🤔