-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor: replace slow performing CSS selectors #2968
base: main
Are you sure you want to change the base?
Conversation
🔭🐙🐈 Test this branch here: https://db-ui.github.io/mono/review/2967-slow-performance-css-selectors |
...case/chromium-highContrast/regular/neutral-bg-lvl-1/DBNavigation-should-match-screenshot.png
Outdated
Show resolved
Hide resolved
> .db-navigation-item { | ||
&[aria-current="page"] { | ||
@extend %show-db-puls-auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would certainly improve performance. Unfortunately, through this change NavigationItems are no longer marked as active if a nested NavigationItem has aria-current=“page”
. From a11y point of view, we recommend that you only set aria-current=“page”
to the anchor that points to the current page.
An alternative would be to use JS to set an “active” class from the innermost active NavigationItem to the outermost NavigationItem. But is that better than using the has-selector...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to remember that this wasn't even only about line 84 within the original file, but especially about the upfollowing 88 till 96, that even also provided a concatenated :has
selector. I'll further investigate on this one.
Proposed changes
Resolves #2967
Types of changes
Further comments