From 9fdcb7bb7083028702cfbe8afbb3546c36b11bcf Mon Sep 17 00:00:00 2001 From: Sandro Gehri Date: Wed, 18 Oct 2023 10:27:45 +0200 Subject: [PATCH] Add documentation for `twMergeFor` --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index cd4a11d..8bd1200 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,27 @@ This will now render the following HTML: > **Note:** Usage of `$attributes->merge(['class' => '...'])` is currently not supported due to limitations in Laravel. +#### Merge classes on multiple elements +By default Laravel allows you to only merge classes in one place. But with `TailwindMerge` you can merge classes on multiple elements by using `twMergeFor()`: + +```blade +// button.blade.php + +``` + +You can now specify additional classes for the button and the svg icon: + +```blade +// your-view.blade.php + + Click Me + +``` + ### Use Laravel Blade Directive The package registers a Blade directive which can be used to merge classes in your Blade views: