Tenant depending colours from database
I want to set the primary colour based on the current tenant. The colours are set in the database. How can I include them?
I guess not here:
since this is built once using npm.
But I wouldn't know how then.
Solution:Jump to solution
Yea I found that. But wasn't sure how that worked with the intensity levels and if it was the way to go.
But I got it working like this now:
/app/Providers/FilamentServiceProvider.php
```php...
5 Replies
Maybe this can give you an idea:
https://discord.com/channels/883083792112300104/1139266135301300275
I'm on v2, I don't have that Color class.
Oh sorry, I missed the v2 tag.
I could be wrong but I think the concept of primary color in v2 is tied to the tailwind config, there can only be one primary color. One option would be to generate multiple themes (one for each primary color) and then register the theme according to the tenant's configuration.
Maybe easier to register some custom CSS in a render hook (also according to the tenant's configuration)
Another direction to explore:
https://tailwindcss.com/docs/customizing-colors#using-css-variables
Solution
Yea I found that. But wasn't sure how that worked with the intensity levels and if it was the way to go.
But I got it working like this now:
/app/Providers/FilamentServiceProvider.php
/resources/css/tenant_abc.css
/tailwind.config.js
Thanks for thinking along!