-
Notifications
You must be signed in to change notification settings - Fork 5
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
Incorrectly merged styles #14
Comments
Thanks for reporting this! I can go through these one by one. There are definitely some bugs
These two prefix modifiers actually create different tailwind classes, so I elected to handle them separately. If they were the same, wouldn't they only generate one tailwind class? I am open to hearing why they should be considered the same though.
This is a bug
All the arbitrary values ones are not supported rn and should be fixed.
Prefixes and separators do not work with the macro. You need to configure options with this method https://docs.rs/tailwind_fuse/latest/tailwind_fuse/merge/fn.tw_merge_with_options.html See #12
This is a bug |
I think the rest of them are bugs |
Hi, sorry for the late reply!
I dug up the original commit to see if there was any additional context on this test: dcastil/tailwind-merge@68ad612 Since there isn't any additional context, I'll note what I'm observing. I'm not a CSS expert, but here's my logical breakdown:
I think the issue here is that
Apologies! I needed to do this in Ruby as well but neglected to port that config logic over to my Rust FFI. |
I can't for the life of me get this to work. Even a simple reproduction of the example from the README, like this const OPTIONS: MergeOptions = MergeOptions {
prefix: "",
separator: "_",
};
fn merge(str1: String, str2: String) -> String {
assert_eq!(
"tw-bg-black tw-bg-white",
tw_merge!("tw-bg-black", "tw-bg-white"),
);
set_merge_options(OPTIONS);
assert_eq!("tw-bg-white", tw_merge!("tw-bg-black", "tw-bg-white"),);
tw_merge!(str1, str2)
} fails with
Any idea what could be different? |
It was a classic PEBCAC—got this working, too. The remaining test failures I see fall into the camp of new Tailwind 3.3/3.4 features, and this question of
|
Hi there! I maintain tailwind_merge, which is just a straight Ruby port of the JS tailwind-merge.
Every so often, I think about writing a Rust crate to back my Ruby gem. Today, I found this project. I was able to quickly incorporate the crate into my own, and was delighted to see that it works!
...for the most part.
When I ran my test suite (which again, is a port of
tailwind-merge
's), it came back with these errors, suggesting that in some casestailwind-fuse
isn't handling a few merge cases:If you'd like to see for yourself, you can clone my repo, switch to the
get-rusty
branch, and runbundle install && bundle exec rake compile test
(assuming you have Ruby installed).Let me know if I can provide any more info to resolve these mismatches!
The text was updated successfully, but these errors were encountered: