-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[FEATURE_REQUEST] Auto dark/light theme #825
Comments
If you're enjoying Dashy, consider dropping us a ⭐ |
Hiya @DaiYuANg This is a nice idea 👍 I'm working on #799 at the moment, that includes refactoring the theme class. Possible ImplementationCould be done based on time of day, but user would need to specify times. And working with time is hard. I'd probably keep it simple, and check if the users OS or browser is set to prefer-dark. Then in the config, it'd the user could specify Finally, in the code, we'd detect if browser / OS is set to dark or light, and apply the theme accordingly. const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const theme = prefersDark ? appConfig.nightTheme : appConfig.dayTheme; And if the user has specified a day / night theme, then in the UI could also show a "Quick Toggle" switch |
Hi, I try to implement this issue last night, but the dev server is so slow, so I try to migrate to vite. |
How were you running the dev server? I'm using But I wouldn't recommend working on this until the stuff in #799 is merged, as I've totally re-worked how all the theming is managed, it's in the I'm happy to add the light/ dark theme feature, once I've got 2.1.2 finished and merged. |
I mean the compiled speedI'm running a production version in my home server, and it's AMD 5600x. When I change something in my server config that waiting about 30s - 1minute for compile |
I'm getting 0.4s server refresh time using Yeah, Vue CLI isn't the fastest, your welcome to try switching to Vite ot upgrading, but I guess it will be more work than it's worth. |
I think your right, thanks for your answer |
This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days. |
This issue was automatically closed because it has been stalled for over 6 weeks with no activity. |
Any updates on this one? |
Related to Lissy93#825 Add automatic theme switching based on OS preference * Add logic in `src/mixins/ThemingMixin.js` to detect OS theme preference using `window.matchMedia`. * Update `initializeTheme` method in `src/mixins/ThemingMixin.js` to set theme based on OS preference. * Modify `applyLocalTheme` method in `src/mixins/ThemingMixin.js` to apply the detected theme dynamically. * Include logic in `src/App.vue` to detect and apply theme based on OS preference during app initialization.
This issue has gone 3 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days. |
This issue was automatically closed because it has been stalled for over 1 year with no activity. |
Is your feature request related to a problem? If so, please describe.
Using dashy in daytime with dark theme, it's look like uncomfortable, so can we switch theme automatically, that make our eyes healthy
Describe the solution you'd like
Set light theme and dark theme, and detected current operating system theme by browser, switch it automatic
Like vscode plugin Toggle Light/Dark Theme
Priority
Low (Nice-to-have)
Is this something you would be keen to implement
Yes!
The text was updated successfully, but these errors were encountered: