Disable System Theme from Theme Switcher
Hey Guys! Is there a way to disable system theme from theme switcher in the filament user-menu? i know that you can disable the whole dark mode settings, but i only want to disable system theme...
8 Replies
A simple solution would be to hide the button via CSS.
But isn't the system theme enabled by default?
Yes. I guess the user would need to select light/dark if what they get from the system is not what they like. Another option would be to publish and customize this view:
vendor/filament/filament/resources/views/components/theme-switcher/index.blade.php
but this is generally not recommended
thanks for the answers! why isnt it recommended to publish the view?
I assume because of upstream changes (changes in the main package that will not accurately reflect if you publish views)
Here's an article that explains the main issues: https://filamentphp.com/community/danharrin-publishing-views-in-laravel
Filament
Publishing Views in Laravel by Dan Harrin - Filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Ultimately, Laravel allows it so it's a valid option. But you have to keep up with the changes in the rest of the package. It becomes your responsibility.
thank you very much for the explanation