laravel jetstream component how to pass active class as parameter

Published

I am using Laravel Jestream. I am also adding "dark theme" support for my application.

So far, I have successfully set dark classes for the navigation links in the resources/views/navigation-menu.blade.php file like so:

<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
    <x-jet-nav-link class="dark:text-gray-200 dark:hover:text-blue-300" href="{{ route($ruta_dashboard) }}" :active="request()->routeIs($ruta_dashboard)">
        {{ __('Dashboard') }}
    </x-jet-nav-link>
</div>

So far so good.

However, when I try to add the dark class to the dark:active:bg-amber-200 class like this

<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
    <x-jet-nav-link class="dark:text-gray-200 dark:hover:text-blue-300 dark:active:bg-amber-200" href="{{ route($ruta_dashboard) }}" :active="request()->routeIs($ruta_dashboard)">
        {{ __('Dashboard') }}
    </x-jet-nav-link>
</div>

It doesn’t work.

how do I pass the dark classes to the Laravel Jetstream components?

Source: Laravel

Published
Categorised as jetstream, laravel Tagged ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq