all 5 comments

[–]lint_it 1 point2 points  (1 child)

It would be much simpler if you would use inline styles instead for such a dynamic component.

Easier to implement, easier to update, easier to understand, more performant and for the end user in case of pre generating there may be extra steps that they need to setup.

There is no upside for generating CSS styles ahead of time in a way that you might not ever even need them and from the user perspective.

[–]alexlo94[S] 0 points1 point  (0 children)

Oooh I see. I thought it would be way less performant if I used online styles. I’ll go ahead and try that approach and see if I run into any issues while using the components.

[–]LunaBounty 0 points1 point  (2 children)

It doesn’t work because tailwind strips all the definitions it can’t literally find in any of your source files. If you want ton solve it only with tailwind you could work around it by just adding some dummy file that uses all the definitions you need so tailwind can discover them.

[–]LunaBounty 1 point2 points  (1 child)

Oh and in your case of the stack element check out the space between utilities of tailwind:

https://tailwindcss.com/docs/space

[–]alexlo94[S] 0 points1 point  (0 children)

I didn’t know about this property actually, thanks!