studiometa / twig-toolkit

🔧 A set of useful extension and components for Twig
MIT License
8 stars 0 forks source link

Utility to merge Tailwind classes in Twig #22

Open KeziahMoselle opened 3 months ago

KeziahMoselle commented 3 months ago

It would be nice to add an equivalent to tailwind-merge usable in Twig, I often see duplicated classnames in prod websites, it would help to override classes whenever needed and to avoid many unreadable conditions in our components.

titouanmathis commented 3 months ago

The tailwind-merge implementation is complex as it seems to deal with conflicting classes such as ´flex´ and ´block´ as well as variants conflicts.

We could start by removing duplicates when using the ´htm_classes´ function.

antoine4livre commented 3 months ago

The tailwind-merge implementation could be a real game changer ! The only challenge is to maintain this tool.