-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc ui: adjust tooltip z-index to be above sidebar #119477
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1046,7 +1046,7 @@ so that we can apply CSS-filters to change the arrow color in themes */ | |||||
position: absolute; | ||||||
top: 100%; | ||||||
right: 0; | ||||||
z-index: 2; | ||||||
z-index: 101; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that we haven't done it like that for other z-indices but personally speaking I'd love to use CSS variables here to make this more robust. Something like
Suggested change
where we have defined There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd even be self-documenting, too, that's a bonus. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sounds like a good idea. |
||||||
margin-top: 7px; | ||||||
border-radius: 3px; | ||||||
border: 1px solid var(--border-color); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Check that the doctest info tooltips are above the sidebar. | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" | ||
move-cursor-to: ".example-wrap.ignore .tooltip" | ||
wait-for: ".tooltip.popover" | ||
|
||
// Move cursor to top left corner of the tooltip and check that it doesn't fade. | ||
move-cursor-to: ".tooltip.popover" | ||
wait-for: 100 | ||
assert: ".tooltip.popover:not(.fade-out)" | ||
|
||
move-cursor-to: (0, 0) | ||
wait-for: ".tooltip.popover.fade-out" |
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.
Btw, have you verified that flattening the z-index stack from (0, 2, 100, 101, 200) to just (0, 100, 101) doesn't incur further overlap regressions? @lukas-code
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.
For the
.sidebar-resizer
i checked that it still looks correct for changing 200 to 101. The.popover
going from 2 to 101 is exactly the bug this PR is trying to fix and I can't think of anything that's supposed to go over the popover at the moment.Additionally, changing the resizer to 101 makes it appear below the popover, which seems more correct to me:
Alternatively it would look like this if we leave the resizer at 200:
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.
Thanks for double-checking, your version does indeed look better.
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.
Apparently this also affects the order of the settings/help popups and the sidebar while resizing the sidebar in a really narrow window. I don't know if this is relevant enough to add a special case.
before:
2024-01-01_16-40-09.mp4
after:
2024-01-01_16-40-24.mp4
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.
Clicking the sidebar to resize it should just close the Settings popover. Make this whole discussion a moot point.
That's not important right now, though. I'll make a separate PR to fix this after it merges.