@class Blade directive to add true/false conditions on whether some CSS class should be added.
Before:
<div class="@if ($active) underline @endif">
Now:
<div @class(['underline' => $active])>
<span @class([
'p-4',
'font-bold' => $isActive,
'text-gray-500' => !$isActive,
'bg-red' => $hasError,
])></span>
Top comments (0)