Is there a way to use the filament colors in a custom theme
Hey all, I am working on a project with multi tenancy and I want to use the tenant's colors to be used in a custom theme.
Currently I have a middleware to set the filament colors:
This is working great, but the problem i'm having is that I want to change the colors of the sidebar, topbar and more. I already have created a custom theme, here is the start of it:
So basicly my question is, how can I use the registered primary color in the theme.css, so I can for example change the background color of the sidebar.
12 Replies
There should be CSS Vars injected for the colors. You could use them.
@Dennis Koch Could you maybe explain how I could use CSS Vars to use for example the primary filament color in the theme.css.
I have looked it up and I only could find something like the following:
Which is indeed nice but doesn't help me get the filament primary color as a var
All colors should be available as CSS vars inside the panel: e.g.
--danger-50
I have tried it like this now:
and the background color is just white, even though icons and other stuff in filament is using the correct primary color. Do you have any idea what
im doing wrong here?
Not sure where the vars are coming from, but I guess they are the ones that are registered on the Panel provider. Not the ones through FilamentColor
In the panel provider the default primary collor is set the following way:
So I guess the white color means it probably didn't get any color from --primary at all
Check the HTML whether you can find the CSS Var.
When inspecting the page I can't find the --primaryColor variable, even if I change the color to just be blue (which does turn the background to blue)
primaryColor
is your own var.
It should be in your theme.css
if you recompiled it
I was talking about Filaments vars which are injected in HTML (not through a CSS file)Thanks, this is what I was looking for
Ty both for the effort
I thought you wanted to swap the values on runtime and not use a fixed value from the config? π