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

Tailwind 2 compatibility? #35

Closed
john-griffin opened this issue Dec 22, 2020 · 6 comments
Closed

Tailwind 2 compatibility? #35

john-griffin opened this issue Dec 22, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@john-griffin
Copy link

First of all thanks for the amazing work on this plugin, it really came at the right time for our project!

I'm currently trying to upgrade from tailwind 1.9.6 tailwind 2.0.2. After completing the upgrade guide I noticed the themes were not loading correctly. Looking at the generated css it seems all the color class names are being suffixed with -default now. For example the color named on-background will generate text-on-background-default.

This issue is happening in 2.4.3 and v3.0.0-beta.2.

Any ideas on how we complete the upgrade?

@innocenzi
Copy link
Owner

Hello,

The issue comes from this file:

const suffix = key === 'default' ? '' : `-${key}`;

Since Tailwind 2, the default key should be uppercased to DEFAULT.

Unfortunately I didn't have time to work on this plugin since a few weeks because of my work, and even though I still plan on upgrading it, it won't be before at least mid-january.

If you can confirm that this is the only issue with Tailwind 2, I can release an update quick enough though.

@innocenzi innocenzi added the bug Something isn't working label Dec 23, 2020
@john-griffin
Copy link
Author

Thanks for the details. Yes that appears to be the main blocker to upgrading right now. The classes are being generated as expected, just with the wrong names.

@innocenzi
Copy link
Owner

Hey, I tagged a new beta version which should bring Tailwind 2 compatibility. Can you let me know if it works for you?

@john-griffin
Copy link
Author

Thanks for the update - classes are now being generated as expected!

Unfortunately it appears that PurgeCSS is not working as expected with tailwindcss-theming. Using default Tailwind 2 purge config all themes are getting stripped out. Any ideas on that one?

@innocenzi
Copy link
Owner

Can you share your config? The plugin really just edits your color configuration and doesn't do more magic than that, so I'm not sure what would be the issue.

Make sure you have followed the whole documentation on purge: https://tailwindcss.com/docs/optimizing-for-production

@john-griffin
Copy link
Author

Yeah good point - I had an issue in the purge config. Looks good now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants