Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tailwind JIT Support #167

Open
johns10 opened this issue Nov 10, 2021 · 2 comments
Open

Add Tailwind JIT Support #167

johns10 opened this issue Nov 10, 2021 · 2 comments

Comments

@johns10
Copy link

johns10 commented Nov 10, 2021

Hello! I recently attempted a tailwind JIT setup on my phoenix project, and found that it didn't work. Based on what I've read, this isn't surprising, as there's a very simple regex that's used to purge template files, and it just doesn't pick up the slim classes. Has anyone had luck setting this up, and has guidance?

One quick and dirty solution I'm considering is pre-compiling the slim templates to html using a post-save hook, and using those on the product. Would love to hear other people's feedback on this.

@tensiondriven
Copy link

@johns10 I've been looking into this too – It looks like the slim template language, which slime is based on, has been upgraded to support tailwind: slim-template/slim#841 so maybe this project can take some inspiration from there.

Tailwind allows you to configure the defaultExtractor ? function, which is a good place to start for getting it to work with slim / leex / sheex templates: https://purgecss.com/configuration.html

There's also some dscussion on how to make Tailwind play nicely with haml, which inspired slim, which inspired slime:

https://stackoverflow.com/questions/56365824/slim-templates-and-tailwindcss-use-in-class-declaration

I think that Tailwind gives you enough options that it can be configured to work with slime in its current form – Please let us know how your efforts progress!

@johns10
Copy link
Author

johns10 commented Feb 20, 2022

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants