Color problems - dynamic classes and custom palettes

I'm doing this:
FilamentColor::register([
'primary' => Color::hex('#FA4800'),
'danger' => Color::hex('#FA4800'),
'gray' => Color::Zinc,
'info' => Color::Blue,
'navy' => Color::hex('#0B1F38'),
'secondary' => Color::hex('#269BDB'),
'success' => Color::Green,
'warning' => Color::Amber,
'sky' => Color::Sky,
'mwBlue' => Color::hex("#269BDB"),
'mwOrange' => Color::hex("#FA4800"),
'mwNavy' => Color::hex("#327CD7"),
]);
FilamentColor::register([
'primary' => Color::hex('#FA4800'),
'danger' => Color::hex('#FA4800'),
'gray' => Color::Zinc,
'info' => Color::Blue,
'navy' => Color::hex('#0B1F38'),
'secondary' => Color::hex('#269BDB'),
'success' => Color::Green,
'warning' => Color::Amber,
'sky' => Color::Sky,
'mwBlue' => Color::hex("#269BDB"),
'mwOrange' => Color::hex("#FA4800"),
'mwNavy' => Color::hex("#327CD7"),
]);
In my AppServiceProvider. Some colors don't seem to work. For example, "sky" in general doesn't work, but also green-400 doesn't work, but green-500 does. I'm storing the classes in the database and echoing them out when the page renders, which I recall reading causes problems with tailwind since it doesn't see the classes when compiling. I can't seem to remember how to get around the problem though. ALSO - in other cases, like "mwNavy", I tried using that by just hard-coding the class and it doesn't work either. Do I have to add these to tailwind in addition to using FilamentColor::register()?
Solution:
the dynamic css problem is solved at least: https://tailwindcss.com/docs/content-configuration#dynamic-class-names...
Content Configuration - Tailwind CSS
Configuring the content sources for your project.
Jump to solution
2 Replies
Solution
Jon Mason
Jon Mason13mo ago
Content Configuration - Tailwind CSS
Configuring the content sources for your project.
Jon Mason
Jon MasonOP13mo ago
I just removed my custom colors from the FilamentColor::register() method and put them back in my tailwind config file and now it's working.
Want results from more Discord servers?
Add your server