Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for blazor NavLink #1

Open
hades200082 opened this issue Jul 31, 2024 · 0 comments
Open

Add support for blazor NavLink #1

hades200082 opened this issue Jul 31, 2024 · 0 comments

Comments

@hades200082
Copy link

<NavLink href="/admin/dashboard" class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white" Match="NavLinkMatch.All" ActiveClass="text-white bg-gray-900">Dashboard</NavLink>

Default classes: rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white

If the NavLink matches the current route, based on the Match property, Blazor adds the ActiveClass classes to the existing classes.

ActiveClass="text-white bg-gray-900"

This results in: rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white text-white bg-gray-900 which duplicates the text colour and background colour classes - which ones will take priority?

In JavaScript based frameworks tw-merge handles this by ensuring that the order the classes are specified dictates the priority, with classes specified later overriding those from earlier in the list.

How can we do this for .NET?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant