Closed ulken closed 3 years ago
@abdumu Thoughts?
I've used this locally and while it's not 100% perfect it works for most cases. It doesn't handle cases where not a plain quotation is used, but rather a helper function to generate classes, but that's expected/fine, I'd say.
Thank you for adding this.
Could you add at least one test?
Sure, I'll give it a try.
I found the test suite rather sparse, which is why I didn't add one to begin with.
Any plans of supporting 2.0? Either for this or tailshift
.
On a related note: to be framework agnostic, have you considered simply using a regex similar to what PurgeCSS does out-of-the-box?
/[^<>"'`\s]*[^<>"'`\s:]/g
To quote Tailwind CSS:
This basically matches any string separated by spaces, quotes or angle brackets, including HTML tags, attributes, classes, and even the actual written content in your markup.
@abdumu Test added
thanks
Adds support for React JSX(/TSX) by (optionally) looking for
className
(not onlyclass
).