Added dark theme switch to last dropdown menu#6352
Conversation
|
|
||
| a { | ||
| text-decoration: none; | ||
| color: #0000ff; |
There was a problem hiding this comment.
I removed these colors from the links and replaced it with the link-body-emphasis CSS class. As documented here, it's the only color class that adapts to color.
|
Tried running this and noticed the tables borders in dark mode seems really bright, like they are a strong white. When looking at the table borders in normal mode they are a light gray so they do not draw so much attention and they do not contrast so strongly w/ the background. Would be nice of the table borders in dark mode do not contrast so much w/ the background color. Also noticed that the way you toggle dark mode differs from the auto refresh which is also a toggle, would be nice to make them both consistent. To me whatever the dark mode toggle is doing seems better. |
It looks like DataTables already works with dark mode, but we were specifying a color for the table borders so we were overriding the behavior in both cases. I found a CSS function called
I did look at the Auto-Refresh menu item to see if I could change it. It appeared to be taking advantage of some provided feature. I can look again, but maybe in a different PR. |
#6355 fixed this. |
|
When dark mode is enabled and I refreshed the page, I got a flash of the non-dark mode page. I tried moving the reading/loading earlier and found this to work: <script>
(function() {
if (localStorage.getItem('dark-theme-enabled') === 'true') {
document.documentElement.setAttribute('data-bs-theme', 'dark');
}
})();
</script>I put that in the |
|
I also am pretty sure we can allow things to be switched between light and dark mode without having to refresh the page but I am still looking into how that could be done |
Ok, that would be good. I'm not sure that I would spend too much time on it as I would not expect a user to switch between light and dark modes very often. I would imagine that the user would pick one and stick with it. Feel free to put up a PR with any changes and I'll merge it in. |
* Avoid light mode flash on refresh * Avoid having to refresh page when dark mode changes * add comment
DomGarguilo
left a comment
There was a problem hiding this comment.
LGTM. things are working well. The only thing I noticed was the navbar becomes the same color as the background in dark mode but that is very minor.
No description provided.