F
Filament2mo ago
lmtc

weird question - dynamically generated tailwind config file after form submission

So I have a cms where you can set global styles (not impacting my panels) I created a dynamically generated tailwind command that runs after form submission, but that won't impact the front end since it needs to run npm run build or have watch running, is this a terrible idea or is there a way to do this?
4 Replies
awcodes
awcodes2mo ago
Not sure I follow. How is the form data tied to the styling?
lmtc
lmtcOP2mo ago
@awcodes So I submit the form - it's a cluster page, and on handleUpdate after save I run a command that updates my existing tailwind.config.js file with some custom theme elements like colors, and some styles (button radius etc) , but the issue is I would then need to run a build - I should probably just use CSS variables but I thought this could be better since then I'm not generating a bunch of dynamic css variables - it's all in the config. This is mostly non-filament but would appreciate any advise - even if it's just saying that's a dumb idea don't do that haha
awcodes
awcodes2mo ago
So, who is the target of the styles? If you are trying to do this in a tenancy type setup then I would recommend a css properties approach so you don’t even need a rebuild. That’s how the colors work in filament.
lmtc
lmtcOP2mo ago
Yea that's exactly it, thanks, I'll move over to doing that - makes more sense anyway with tailwind 4 around the corner. Appreciate the help!
Want results from more Discord servers?
Add your server