F
Filament15mo ago
Jan0bra

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
Patrick Boivin
Patrick Boivin15mo ago
A simple solution would be to hide the button via CSS.
xy
xy15mo ago
But isn't the system theme enabled by default?
Patrick Boivin
Patrick Boivin15mo ago
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
Jan0bra
Jan0braOP15mo ago
thanks for the answers! why isnt it recommended to publish the view?
xy
xy15mo ago
I assume because of upstream changes (changes in the main package that will not accurately reflect if you publish views)
Patrick Boivin
Patrick Boivin15mo ago
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.
Patrick Boivin
Patrick Boivin15mo ago
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.
Jan0bra
Jan0braOP15mo ago
thank you very much for the explanation
Want results from more Discord servers?
Add your server