Update hover / active behavior for side navigation links#3511
Merged
mshibuya merged 4 commits intoMay 4, 2022
Merged
Conversation
This will allow targeted styling of the active element in the side nav
This aligns closer to RailsAdmin 2.x.x, where the background of an element in the side nav changes when it's either active or hovered over - making the navigation itself easier to follow in the UI
codealchemy
commented
Apr 19, 2022
Comment on lines
+45
to
+54
| &.active { | ||
| background-color: map-get($theme-colors, primary); | ||
| color: color-contrast(map-get($theme-colors, primary)); | ||
| } | ||
|
|
||
| &:hover { | ||
| background-color: map-get($theme-colors, primary); | ||
| color: color-contrast(map-get($theme-colors, primary)); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
The styles here can be removed if it'd be preferable to keep with the current behavior, 410654d is the main change needed to allow targeting the (active sidenav) element.
Member
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We noticed that the sidenav active / hover behavior from RailsAdmin 2.x did not carry over to RailsAdmin 3.0. This adds
hoverbehavior to the side nav, and theactiveclass to the side nav element that corresponds to the current model context - both of which can be overridden in user themes to maintain the current behavior.📝 I'm having trouble getting the 2.x branch running to demo the old behavior, but it can be seen in the demo app linked from the README