-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 a hover state to sidebar panel headers #10070
Conversation
This PR adds a hover state to sidebar panels. When a panel is closed: - The background changes to a light gray on hover - The text and icon change from $dark-gray-500 to $dark-gray-900 When a panel is already open, the text and icon color changes, but the background does not.
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.
Love it.
We should make a few changes, then ship this. First off, the Revisions box should have the same hover:
Compare:
I don't know if we shouldn't change it here, but there's a change incoming in update/font-picker
(not yet a PR) that changes the text color of the sidebar to be way darker, not just dark gray. This is to be consistent with headings & chevrons inside the block library.
I can be convinced otherwise, but it looks good in that branch.
✅ b023a78
So, interestingly enough... it looks like as of right now, the Document Sidebar panel headers are That clearly doesn't make sense. 😄 As you mention, it looks like #9802 changes the block panel header color to I added that update to this branch in 13f5657. This technically works, but it's a little less ideal because now there's no hover state for expanded items. We could make the text lighter on hover, but that's the opposite of what happens with most of our other hover states. In any case, give it a try and let me know what you think. (Also — I realized these hover states go beyond the sidebar and effect the block picker, too! 😄 So be sure to take a look there too) |
I think this is pretty good! I like the darker panel color. Also the hover seems fine in the library since we use it in a few places: I don't think an expanded panel HAS to have that same hover, but it seems like just a matter of CSS specificity to make this work no? What makes this not work do you know? |
Oh right! I tried that initially, but decided that the margins around the title bar in some expanded panels felt too uncomfortable for my taste: In those cases, it looks nice and comfortable without the gray background, but when the background is in place, the vertical margin in between the panel background and the panel content feels a little tight. That's why I explored a text-only hover state for expanded panels instead. In any case, give this another spin and let me know if you think those margins are uncomfortable or not in practice. I could be convinced otherwise. 🙂 |
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.
Ship it!
This PR adds a hover state to sidebar panels. When a panel is closed:
When a panel is already open, the text and icon color changes, but the background does not.
This helps subtly differentiate collapsed panels from uncollapsed ones, and provides another visual cue reinforcement that these headers are interactive.
This does lighten the un-hovered color of these headers to our usual
$dark-gray-500
text color, but I don't think it effects their effectiveness as headers.Screenshots
Closed, default:
Closed, hovered:
Open, default:
Open, title is hovered:
GIF
(The subtle background color isn't quite visible due to the compression 😕)
This also works nicely alongside #10062: