Include VITE build in layout

Hello, in Filament v2 I included Vite within the AppServiceProvider through the Filament registerTheme by placing the app(Vite::class)('resources/css/app.css). Now in v3 I didn't find how to include vite within the default layout of the Builder Panel. Could someone guide me on how to do this? Thanks
13 Replies
Dennis Koch
Dennis Koch2y ago
Via the Panel configuration: $panel->theme()
joao nivaldo
joao nivaldoOP2y ago
Could you give me the link to the documentation where I can find this please
Dennis Koch
Dennis Koch2y ago
->viteTheme() in your case
joao nivaldo
joao nivaldoOP2y ago
I include it this way ->viteTheme('default', 'resources/css/app.css'); so it breaks the site. Did I do something wrong there? Do you have to add something special in the tailwind or vite configuration? See attached image for how it looks.
joao nivaldo
joao nivaldoOP2y ago
No description
Dennis Koch
Dennis Koch2y ago
Not sure why you added default?
joao nivaldo
joao nivaldoOP2y ago
I imagined that this would be the value for the theme. I'm using the default theme. What should I put it as a value? I didn't find anything in the documentation about this viteTheme method. Thanks
Dennis Koch
Dennis Koch2y ago
Best to follow the instructions I linked you.
joao nivaldo
joao nivaldoOP2y ago
Dennis the instructions you gave me is to build a custom theme. I just want to include vite in the default theme build so I can use some other tailwind classes that are not available in v3 css. So I figured it would just include this line in the AdminPanelProvider. And the link you gave me has nothing about vite in it. If you can guide me I would be very grateful.
Dennis Koch
Dennis Koch2y ago
I just want to include vite in the default theme build so I can use some other tailwind classes that are not available in v3 css
That's the same as a "custom theme"
Patrick Boivin
Custom theme just means taking control of the Tailwind CSS configuration... you don't actually have to change anything visually.
joao nivaldo
joao nivaldoOP2y ago
I understood. I'll do one more study then. Thanks It worked, now I understand how it works. All I had to do was create a theme and follow the steps after creating it. Thank you very much.

Did you find this page helpful?