Skip to content

Commit b9302d7

Browse files
committed
rustdoc: add hover indicator for notable trait tooltip
1 parent c1d72de commit b9302d7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,10 @@ a.test-arrow:hover {
11791179
position: relative;
11801180
}
11811181

1182+
.code-header a.tooltip:hover {
1183+
color: var(--link-color);
1184+
}
1185+
11821186
/* placeholder thunk so that the mouse can easily travel from "(i)" to popover
11831187
the resulting "hover tunnel" is a stepped triangle, approximating
11841188
https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */

tests/rustdoc-gui/notable-trait.goml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ assert-count: ("//*[@class='tooltip popover']", 0)
122122
// Now check the colors.
123123
define-function: (
124124
"check-colors",
125-
(theme, header_color, content_color, type_color, trait_color),
125+
(theme, header_color, content_color, type_color, trait_color, link_color),
126126
block {
127127
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
128128
// This is needed to ensure that the text color is computed.
@@ -133,9 +133,21 @@ define-function: (
133133
// We reload the page so the local storage settings are being used.
134134
reload:
135135

136+
assert-css: (
137+
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
138+
{"color": |content_color|},
139+
ALL,
140+
)
141+
136142
move-cursor-to: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
137143
wait-for-count: (".tooltip.popover", 1)
138144

145+
assert-css: (
146+
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
147+
{"color": |link_color|},
148+
ALL,
149+
)
150+
139151
assert-css: (
140152
".tooltip.popover h3",
141153
{"color": |header_color|},
@@ -163,6 +175,7 @@ call-function: (
163175
"check-colors",
164176
{
165177
"theme": "ayu",
178+
"link_color": "rgb(57, 175, 215)",
166179
"content_color": "rgb(230, 225, 207)",
167180
"header_color": "rgb(255, 255, 255)",
168181
"type_color": "rgb(255, 160, 165)",
@@ -174,6 +187,7 @@ call-function: (
174187
"check-colors",
175188
{
176189
"theme": "dark",
190+
"link_color": "rgb(210, 153, 29)",
177191
"content_color": "rgb(221, 221, 221)",
178192
"header_color": "rgb(221, 221, 221)",
179193
"type_color": "rgb(45, 191, 184)",
@@ -185,6 +199,7 @@ call-function: (
185199
"check-colors",
186200
{
187201
"theme": "light",
202+
"link_color": "rgb(56, 115, 173)",
188203
"content_color": "rgb(0, 0, 0)",
189204
"header_color": "rgb(0, 0, 0)",
190205
"type_color": "rgb(173, 55, 138)",

0 commit comments

Comments
 (0)