mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 13:49:39 +02:00
feature(dark mode): misc design fixes (#2215)
* Fix category dark mode styles * Fix sidebar account tab states * Fix dashboard balance sheet group styles * Fix budget dark mode styles * Fix chart gradient split * Fix prose styles in dark mode * Add back chat nav id for tests
This commit is contained in:
parent
c26a7dd2dd
commit
fb7107d614
27 changed files with 254 additions and 174 deletions
|
@ -4,7 +4,6 @@ export default class extends Controller {
|
|||
static values = { userPreference: String };
|
||||
|
||||
connect() {
|
||||
this.applyTheme();
|
||||
this.startSystemThemeListener();
|
||||
}
|
||||
|
||||
|
@ -45,7 +44,7 @@ export default class extends Controller {
|
|||
if (isDark) {
|
||||
document.documentElement.setAttribute("data-theme", "dark");
|
||||
} else {
|
||||
document.documentElement.removeAttribute("data-theme");
|
||||
document.documentElement.setAttribute("data-theme", "light");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,20 +59,12 @@ export default class extends Controller {
|
|||
}
|
||||
};
|
||||
|
||||
toDark() {
|
||||
this.setTheme(true);
|
||||
}
|
||||
|
||||
toLight() {
|
||||
this.setTheme(false);
|
||||
}
|
||||
|
||||
toggle() {
|
||||
const currentTheme = document.documentElement.getAttribute("data-theme");
|
||||
if (currentTheme === "dark") {
|
||||
this.toLight();
|
||||
this.setTheme(false);
|
||||
} else {
|
||||
this.toDark();
|
||||
this.setTheme(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue