Filament themes with Webpack
Hey,
I am using webpack.config.js. I just installed filament on my laravel application, and I tried to shift to vite but failed ultimately.
I would like to add my theme although I don't think it seems possible with my current config? Can anyone help me out by telling me if its possible or telling me how to shift to vite/webpack mix
29 Replies
Bump
Should be possible with webpack to. You need to add the theme.css to your mix file and then you can reference the output file via
->theme()
in the Panel.That's the problem, I don't use mix, it's just webpack.config.js. Should I start using mix?
I currently compile all my stuff using that
and I tried to convert to both vite/webpack mix but wasn't able to
I get
while trying to run the tailwindcss command:
provided by the create theme command
I checked everywhere it just doesnt work
well for me atleast
What does your theme look like? Seems like webpack is using an absolute path. Or your basedir config is messing with it.
At the moment it's has no edits, it's just the generated theme
Also I tried to change the font of the headers using fi-header-heading or something like that, that also didn't work
Yes. But just because the paths usually work with Vite it doesn't mean it works with Webpack. I think you need to check why the file wasn't found
Nothing was compiled because it threw an error
Not sure maybe it's because I'm using webpack config js?
Instead of mix
Yea although my other assets compile normally, just the filament doesnt
Also it only threw an error when I tried tailwind cmd
Webpack by itself works just that I don't know how to edit it to add filament
Same as you would compile any CSS with Tailwind or PostCSS
postcss.config.js
tailwind.config.js
those are my configs, the tailwind config is for the frontend (react)
theme.css (generated by Filament)
tailwind.config.js
Both of these files are in
/resources/css/filament/admin/
Shouldn't this be
@import './vendor/filament/filament/resources/css/app.css';
?Regenerated it, got
@import '/vendor/filament/filament/resources/css/theme.css';
Also it looks like filament is trying to install something but npm failsNo wait. Probably
../../../../vendor/filament/filament/resources/css/app.css';
Yes. I mean in your case? Webpack and Vite may work differently with pathsyea looks like I got a different erro
I'll try to install with yarn, npm usually fails for me
wow it built - let me check
Is there any way I can do this with webpack though? I don't want to run the npx command everytime
I bet there is. I am no Webpack expert though. Quick google search gave me this:
https://gist.github.com/bradtraversy/1c93938c1fe4f10d1e5b0532ae22e16a
Gist
Setup Webpack with Tailwind CSS
Setup Webpack with Tailwind CSS. GitHub Gist: instantly share code, notes, and snippets.
Is there a list of all the classes? Looks like my phpstorm doesn't want to auto fill classes anymore - even though it did originally
What classes? Tailwind? Filament?
Filament classes like
.fi-header-heading
I saw in the style customizations documentation but those aren't all of themThere's no complete list. You need to check your DevTools
Browser DevTools?
Yes
Okay thanks
Looks like I'm getting a new error randomly
There should be plenty of results for that error on Google.
that is also with the same tailwind command ^
Okay yeah I will try to Google I assumed there wouldnt be because I looked alot around on Google before so
You either need to change your file format or a setting your package.json
Hey I set
.fi-topbar
's background color to green but doesn't show. I am trying to change backgrounds of the topbar, layout and sidebar. Layout and sidebar worked but topbar didn't.
I should most likely do this with tailwind or the panel provider's ->color()
attribute but I dont know which values from 50-950 are on which thingIt's probably overwritten by some other declaration. Use your DevTools to figure that out.
I checked, its not

Okay yeah removing
dark:bg-gray-900
and bg-white
seems to make the green appear, even though I added !important to green