-
Notifications
You must be signed in to change notification settings - Fork 13
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
64 bug dark mode should be applyed to the whole netzgrafik editor content #179
64 bug dark mode should be applyed to the whole netzgrafik editor content #179
Conversation
For detecting browser's theme, you can try this in // detect at initialization
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
console.log("dark mode");
} else {
console.log("light mode");
}
// listen for browser setting update
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
const newColorScheme = event.matches ? "dark" : "light";
console.log(newColorScheme);
}); then you can adapt the application theme on that |
Thank you. The theme (dark, light detector) is working well. However, there are some drawbacks: The user has to switch the theme on the operating system side if the browser is using the default settings from the operating system. It would be nice to use this flag as the default one if the user has not yet chosen between dark/light in the netzgrafik editor settings. Once the user changes the coloring/rendering, we store this information locally.
|
Thank you. The theme (dark, light dector) is working well. But the bad thing is:
This flag would be nice to be uses as default one, if the user has not yet choosen between dark/light in the netzgrafik editor settings. Once he change the coloring/rendering we store this information to local. Decision Is this OK? |
I think that would be very fine, default is browser theme (light or dark, depending on the browser value, maybe it could be one of the option to be selected in NGE), and if the user selects another color, it adapts (= override) the color theme of the browser (then stored in localStorage, as it was done before) |
The comment is very smart (indeed) - because we are also thinking of a better solution with the toggle (show all locks) - but haven't found the best solution yet. The locks get shown when they are not the default ones. (If you toggle "show all," of course, all will be displayed). This isn't part of this issue :-) -> #180 |
Response to #179 (comment) |
It is working very well, however when we :
Then NGE theme changes to dark (good) but the theme selector remains on light (not good), see screenshot However, I am not sure it is a big issue and if the user will face that very often. In addition to that, if we close the Einstellungen component and open it again, the selector is changed to dark (good). So it might be good enough to just ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the last comment (that could be ignore imo), good work, thanks !
The latest commit should resolve the "theme selector" issue. Just to be sure, is everything working correctly now? If you could provide me with brief feedback before merging, I would appreciate it. |
After full testing (clear 3 things:
// netzgrafik-editor-frontend/src/app/services/ui/ui.interaction.service.ts l.474
console.log(localStoredInfo);
Taking in account these 3 comments, we can then merge |
You have the honor to press 'merge' if it's fine with you - I am fine with this version. It's great to work in dark mode; it makes the work more comfortable due to the high contrast. |
This Pull Request resolves the issue with the Light/Dark Mode of the network graphics editor. When the user switches to a dark layout/design, the entire content should be rendered in dark mode. This is now the case.
Issues
Open points:
Checklist
documentation/