Style Customization
Following the docs. I've done everything step by step but or doesn't work . I was testing it by changing sidebar color to see if it works but nothing changed .
42 Replies
Did you run
npm run build
?Failed to load PostCSS config @Leandro Ferreira
it shows an error
What's the error?
Does the error have to do with your overall local config?
Is the error because of the CSS you're trying to add/change?
Does removing things you've added cause the error to go away?
@Leandro Ferreira @DrByte
And your
app.css
file contents?
and I guess postcss.config.js
too
@DrByte
Could you try to rename
postcss.config.js
to postcss.config.cjs
and run npm again?ok done next?
same issue
It didn't work I think
Did you follow these steps?
https://filamentphp.com/docs/3.x/panels/themes/#creating-a-custom-theme
postcss.config.js should be module.exports not export default.
I've done both its working but my whole app is broken now its not clean why ? @awcodes @Leandro Ferreira
what issue?
the whole layout is broken.. fields are not looking like before they are bigger and there shadow of headings behind those fields.. on forms cannot see the headings.. some of the fields background are white now. In short everything is messed up not aligned @Leandro Ferreira
Sounds like you missed a step somewhere setting up your custom theme.
I double checked it all is good .. what should I check?
This is what I've done
please let me know if I missed something
if you remove
theme: {...}
and run npm run build
, what happens?then it doesn't override classes for eg: if change colors and borders it doesn't do that
but layout is fine now after removing theme
change colors via panel/provider
https://filamentphp.com/docs/3.x/panels/themes#changing-the-colors
ok Thanks for help 🙂
do I need to run npm run build everytime I made some change in theme.css because If I don't run it ..it doesn't change anything and also not working without using !important but I can't use !important on every class right ?
Yes. You can also use
npm run dev
to watch the changes.
Are you using @apply
in the css?yes I'm using @apply
@Leandro Ferreira
It should work
You shouldn’t need important at all using a theme. If you setup your theme correctly then it will replace filaments default theme completely. Something is still off in your setup.
idk what is it 🤯
Hard to say without being able to look at the codebase. Sorry.
hmm it's ok
Hello again, I just noticed that my terminal shows this when I run npm build do you guys think, that it could be the reason my theme is not working ? @awcodes @Leandro Ferreira
Would need to see your directory structure. You could be modifying the wrong tailwind file.
Mine does that all the time too. That is normal for Filament considering the tailwind config is in an abnormal place. Can I see your
package.json
file?
Also, I noticed that you showed you are putting this content in your app.css
file.
Your app.css
should technically be empty. You are supposed to define the css inside your resources/css/filament/app/theme.css
file if you are using the PanelBuilder. Also I am not sure why you commented out ->viteTheme()
in your Panel, and also commented out //'resources/css/filament/app/theme.css'
in your vite.config.js
file.My app was broken when I first tried it that's why I commented it out but now everything is working fine but still it shows those warn in terminal
but everything else seems to be working fine
Oh okay good. Yeah the warning in the terminal will be there. It's fine, don't worry about that. As long as everything works correctly.
But you should still be defining your css in the theme.css file.
yes I'm doing that only thanks 🙂
Okay just checking because you didn't show you were doing that 👍
oh yeah that is from yesterday 😄
It's working now thanks for your help 🙂
how can i simply change the color of sidebar because in v3 it is same as background
Create a theme and customize it via css
https://filamentphp.com/docs/3.x/panels/themes/#creating-a-custom-theme
i am in the middle of a project i just want to change the color of the sidebar
did you figured it out ?
Create a custom theme for filament and target the .fi-sidebar class in your theme.css file and change the color.
if i do this than i have use npm .. this means at the time of deployment i will need two different ports one will run php artisan and second will run npm run dev....
😞 no
huh? where's the problem with this?
whats's the issue with that then ? you just need to create custom theme and inspect the element and target the class then change the color
run npm build
OK OK