How to Determine if the dashboard is using dark or light mode in Filament?
It is possible to Determine if the dashboard is using dark or light mode in Filament? TYIA.
9 Replies
up
help guys please 😦
Check the css classes on the html tag
and/or localstorage.getItem('theme')
not working
I dont know if thats the correct name, check in your browser
is there any other way?
That I know, no. It's all css controlled by the dark class in the html tag
You can also try;
document.documentElement.classList.contains('dark')
Nobody can't help if you don't share what you did
If you are using alpine to get this, you could do
If you need to get the current option when the theme changes, you could do something like this: