phenixdigital / phoenix_storybook

A pluggable storybook for your Phoenix components.
MIT License
676 stars 54 forks source link

Problem with using tailwind classes in the playground. #505

Open jhonathas opened 1 day ago

jhonathas commented 1 day ago

Hello,

Yesterday I installed StoryBook for the first time and noticed that when I use the playground to apply class changes to a component, it doesn't work. It seems to me that it only works with Tailwind classes that are already in use in the application; any new class is not recognized.

Does anyone have any tips on what I can do to solve this?

cblavier commented 1 day ago

Hey @jhonathas

indeed, any class not present in the sources won't be bundled by the Tailwind JIT.

You can workaround the issue by safe listing some classes like in this file: https://github.com/phenixdigital/phoenix_storybook_demo/blob/ec54fd2e7b99a254cfd77cfda5ac06c35cfc836f/assets/tailwind.config.js#L16

Hope this helps

jhonathas commented 1 day ago

Thank you. I'll test it.