This is an implementation of the tailwind-merge library in rust.
Add the following line in your Cargo.toml
dependencies
tailwind-merge = { git = "https://github.com/uinstinct/tailwind-merge-rs.git" }
use tailwind_merge::tw_merge;
tw_merge("px-2 py-1 bg-red hover:bg-dark-red" + " " + "p-3 bg-[#B91C1C]")
// → "hover:bg-dark-red p-3 bg-[#B91C1C]"