leandrocfe / filament-apex-charts

Apex Charts integration for Filament PHP.
https://filament-apex-charts-demo.leandroferreira.dev.br
MIT License
324 stars 39 forks source link

Fix dark mode if theme is not set #22

Closed billmn closed 1 year ago

billmn commented 1 year ago

If theme is not set in localStorage (e.g. a user did not choose the theme to use), fallback to the theme used by filament (if OS uses dark mode, there is a dark class in the body)

leandrocfe commented 1 year ago

If theme is not set in localStorage (e.g. a user did not choose the theme to use), fallback to the theme used by filament (if OS uses dark mode, there is a dark class in the body)

I'm currently working on some enhancements and I'll change it to something like this:

theme: document.querySelector('html').matches('.dark') ? 'dark' : 'light',

I believe that it will work better. Thank you!

billmn commented 1 year ago

Thank you!