gehrisandro/tailwind-merge-laravel
Merge Tailwind CSS class strings in Laravel and auto-resolve conflicts so later utilities win. Ideal for overriding classes in Blade components. PHP/Laravel port of tailwind-merge. Supports Tailwind v3.0–v3.3 (Laravel 10).
bg-white dark:bg-gray-900 + bg-blue-500 → bg-blue-500 dark:bg-blue-400).hover:bg-blue-600 focus:bg-blue-700) by ensuring later classes override earlier ones without manual conflict resolution.Adopt if:
p-4 vs p-6 in Blade components).Look elsewhere if:
*"This package solves a critical pain point in our Laravel/Tailwind workflows: class conflicts. Currently, our frontend team spends X hours/month manually resolving style clashes when customizing reusable components (e.g., buttons, cards). By adopting TailwindMerge, we can:
For a one-time integration effort (~2 hours), this delivers long-term velocity gains—especially valuable for [Product X], where UI customization is a key differentiator."*
*"TailwindMerge for Laravel is a drop-in solution for conflict-free class merging, addressing:
<x-button> with default styles (bg-blue-500), then override via <x-button class="bg-red-500">—no more manual class string manipulation.hover:bg-blue-600 focus:bg-blue-700 without edge cases.How to adopt:
composer require gehrisandro/tailwind-merge-laravel).$attributes->class with $attributes->twMerge() in Blade components.@twMerge() directives or the twMerge() helper elsewhere.Trade-offs:
Next steps: I’ll prototype integration with [Component Y] to validate ROI. Estimated effort: 1–2 dev days for full rollout."*
How can I help you explore Laravel packages today?