Skip to content

tailwindcss current page #2534

Answered by kertahayu
kertahayu asked this question in Help
Discussion options

You must be logged in to vote

thanks for your answer, I've overcome this with a simple trick.

<nav class="text-blue-200"> // so I gave text-color-x as the default
   <a href="/home" class="{{ $current-page ? 'text-white bg-blue-500' :  'group' }}"> // when current-link I give text-white
      <span class="group-hover:text-white">...<span>
   </a>
   <a href="/profile" class="{{ $current-page ? 'text-white bg-blue-500' :  'group' }}">
      <span class="group-hover:text-white">...<span>
   </a>
</nav>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kertahayu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant