-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dark Mode #2
Comments
Theming seems to be possible with magic SCSS variables. "--mdc-theme-primary" is definitely the first target. https://material.io/develop/web/theming/theming-guide -> "Step 3: Changing the theme with Sass" Also look at hperrin/svelte-material-ui#23 (comment) for an example |
oh wow, changing these variables was too easy...
|
mostly done, but the official instructions seem to be broken: hperrin/svelte-material-ui#465 My recommendation: Use the theme generator, it's much easier than tweaking the defaults |
Only thing missing is to set "prefers-color-scheme: dark" during runtime, I hope that works without hacking imports. Using the colors from the theme would also greatly improve related color generation. See https://sveltematerialui.com/THEMING.md for a few variables that I'm too dumb to access. Might also remove/merge my error-text class |
This one is even simpler, probably easier to integrate/steal from: https://metonym.github.io/svelte-dark-mode/ |
Previous instructions actually had a script for that, this might actually work: https://github.com/hperrin/svelte-material-ui/blob/bab2ff4f973bad462f9d4696333bd541f91987aa/THEMING.md
|
no idea how to add new variables so that I can reference them from svelte.... This is daisy's recommendation for a theme picker: https://github.com/saadeghi/theme-change |
Darkmode and switchable themes is something that is essential for cave dwellers, but SMUI somehow doesn't offer native integration.
The text was updated successfully, but these errors were encountered: