You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjust the fallback color to render elements in both light and dark mode, eg. If the rendering Color for Widget is not defined, fall back to black or white (depending on the mode).
Nowadays, light/dark mode is detected by the browser so we can use the media query to detect the mode and set the theme accordingly from get-go during the initial render.
Provide a hook (e.g., useTheme) that allows users to toggle between light and dark themes. This hook can also store the user's preference in localStorage or cookies.
Ideas/Features:
Add support for custom light/dark color fallbacks.
Detect system theme and set theme accordingly.
Provide a useTheme hook for switching between light and dark modes when user preference is not set or user has set a preference.
Support saving user preference in localStorage or cookies.
The text was updated successfully, but these errors were encountered:
Detecting user-preferred mode via Rust is possible, but explicitly passing it to each function for changing color seems like a bad design choice.
I would consider doing it like proposed in #11 because it will provide the following extra features:
handle system preferred changes automatically without event listeners (just let the browser do it with media query)
with CSS nesting being at baseline (eg. should cover all 3 major browsers), light and dark modes code should be pretty maintainable.
this will involve changing the background of the whole page as well, and as it's planned to move away from hard-coded CSS, it makes sense to include this change in the list.
This looks better to me, but it's still rough around the edges.
I would like to add some ability for users to define their own color schemes and do some customization. Setting it dynamically during run seems like an overkill, so just at start seems enough
Adjust the fallback color to render elements in both light and dark mode, eg. If the rendering Color for Widget is not defined, fall back to black or white (depending on the mode).
Nowadays, light/dark mode is detected by the browser so we can use the media query to detect the mode and set the theme accordingly from get-go during the initial render.
Provide a hook (e.g., useTheme) that allows users to toggle between light and dark themes. This hook can also store the user's preference in localStorage or cookies.
Ideas/Features:
The text was updated successfully, but these errors were encountered: