feat: add rb files to the Tailwind content glob #564
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a 🙋 feature or enhancement.
Summary
This commit updates the Tailwind CSS content glob to also include ruby files when searching for classes in the src folder.
Context
Components, plugins, helpers, data files, etc. that are written in Ruby may contain Tailwind CSS classes that won't get generated by the JIT because they aren't in the content scope.
I have been using Tailwind for years but it took me close to 45 minutes before I realized the reason my classes were not generating the right CSS because they were in a Ruby component, not the accompanying erb file. Hopefully this will save people heartache and frustration if they run into the same issue and not make it be something you always need to add when generating a new site with Tailwind.
The one downside to this addition could be a performance hit. The larger the glob, the longer it takes Tailwind to scan for classes.
Here is why I think that is ok:
A small change but hopefully it will at minimum save some frustration/time and prevent the need to Google to figure out what's happening.
Thanks for reading 😄