-
-
Notifications
You must be signed in to change notification settings - Fork 4
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 support for post process classes #16
Conversation
8accf97
to
b23e493
Compare
@adrianthedev tailwind_merge-0.13.1 requires ruby version < 4.0, >= 3.1 Should we drop support for Ruby 3.0? |
b23e493
to
eac6f7d
Compare
I'm not entirely convinced by the proposal of this PR, since we are just integrating with TailwindMerge. I think it would be better to allow something more generic and let the developer decide. What do you think @adrianthedev? ClassVariants.configure do |config|
config.process_classes_with do |classes|
TailwindMerge::Merger.new.merge(classes)
end
end |
Yeah. That could work as well. |
5863ef4
to
1f95f93
Compare
@adrianthedev ready for review! |
1f95f93
to
e15dbac
Compare
e15dbac
to
2c3588d
Compare
# ClassVariants.configure do |config| | ||
# # allow to post process classes with an external utility like TailwindMerger | ||
# config.process_classes_with do |classes| | ||
# TailwindMerge::Merger.new.merge(classes) | ||
# end | ||
# end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about generating the initializer uncommented and leave only the process_classes_with
option commented out, but I think I like this approach better.
We are not configuring anything with it, we might as well not load it.
Good call!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesoem work @javierav!
This PR implements TailwindMerge and its configuration. It has been implemented globally so that the cache it incorporates is shared and used by all ClassVariants instances.