-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce elementTargetClass
option (alternative to :target
)
#2231
Comments
And what does this option do? |
Adds the class ( :target, .router-target-element {
font-weight: bold;
} For example, the route |
I see, so it's specific to the web hash history and what you mentioned on #2230. It can be solved by creating that custom history you proposed, which seems more appropriate than introducing a new option that only applies to a specific history mode. |
No, this applicable to both > Setting the hash with History API do not affect on styling the element with :target selector. I'm not the only one who faced this issue:
So, it can be simple fixed with the similar option as |
Thanks for pointing out #2076 , I forgot about it being a spec limitation. You should follow w3c/csswg-drafts#6942 for a proper implementation of this. You can implement the feature in many ways. The most reusable one would be a custom Router Link by checking the current route and the this custom link resolved route's hash |
What problem is this solving
While it supports scrolling to a hash:
Setting the hash with History API do not affect on styling the element with
:target
selector.Proposed solution
Add a new
createRouter
s option similar toFor example:
Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: