@php $whichVariants = "only $variants[0]"; for ($i = 1; $i < count($variants); $i++) { $whichVariants .= (($i == count($variants) - 1) ? ' and ' : ', ') . $variants[$i]; } $currentVariants = '\'' . collect($variants)->implode('\', \'') . '\''; $extraVariants = collect([ 'responsive', 'hover', 'focus', 'group-hover', ])->diff($variants) ->take(3 - count($variants)) ->implode(' and '); @endphp

Responsive, Hover, and Focus Variants

By default, {{ $whichVariants }} variants are generated for {{ $utility['name'] }} utilities.

You can control which variants are generated for the {{ $utility['name'] }} utilities by modifying the {{ $utility['property'] }} property in the modules section of your Tailwind config file.

For example, this config will also generate {{ $extraVariants }} variants:

@component('_partials.customized-config', ['key' => 'modules']) // ... - {{ $utility['property'] }}: [{{$currentVariants}}], + {{ $utility['property'] }}: ['responsive', 'hover', 'focus'], @endcomponent @isset($extraMessage)

{!! $extraMessage !!}

@endif

Disabling

If you don't plan to use the {{ $utility['name'] }} utilities in your project, you can disable them entirely by setting the {{ $utility['property'] }} property to false in the modules section of your config file:

@component('_partials.customized-config', ['key' => 'modules']) // ... - {{ $utility['property'] }}: [{{$currentVariants}}], + {{ $utility['property'] }}: false, @endcomponent @isset($extraMessage)

{!! $extraMessage !!}

@endif