Skip to content

Commit 78cbe9c

Browse files
authored
Rollup merge of #104663 - notriddle:notriddle/button-cursor, r=GuillaumeGomez
rustdoc: factor out common button CSS
2 parents 9cefd9d + 709e9de commit 78cbe9c

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,21 @@ p:last-child {
290290
button {
291291
/* Buttons on Safari have different default padding than other platforms. Make them the same. */
292292
padding: 1px 6px;
293+
/* Opinionated tweak: use pointer cursor as clickability signifier. */
294+
cursor: pointer;
293295
}
294296

297+
/* end tweaks for normalize.css 8 */
298+
295299
button#toggle-all-docs {
296300
padding: 0;
297301
background: none;
298302
border: none;
299-
cursor: pointer;
300303
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
301304
-webkit-appearance: none;
302305
opacity: 1;
303306
}
304307

305-
/* end tweaks for normalize.css 8 */
306-
307308
.rustdoc {
308309
display: flex;
309310
flex-direction: row;
@@ -1305,7 +1306,6 @@ a.test-arrow:hover {
13051306
#titles > button {
13061307
text-align: center;
13071308
font-size: 1.125rem;
1308-
cursor: pointer;
13091309
border: 0;
13101310
border-top: 2px solid;
13111311
flex: 1;
@@ -1345,7 +1345,6 @@ a.test-arrow:hover {
13451345
font-weight: bold;
13461346
background: none;
13471347
color: inherit;
1348-
cursor: pointer;
13491348
text-align: center;
13501349
border: none;
13511350
outline: none;
@@ -1367,7 +1366,6 @@ a.test-arrow:hover {
13671366

13681367
#settings-menu > a, #help-button > a, #copy-path {
13691368
width: 33px;
1370-
cursor: pointer;
13711369
line-height: 1.5;
13721370
}
13731371

@@ -1796,7 +1794,6 @@ in storage.js
17961794
z-index: 10;
17971795
border-top-right-radius: 3px;
17981796
border-bottom-right-radius: 3px;
1799-
cursor: pointer;
18001797
border: 1px solid;
18011798
border-left: 0;
18021799
}
@@ -1967,7 +1964,6 @@ in storage.js
19671964
position: absolute;
19681965
top: 0.25em;
19691966
z-index: 1;
1970-
cursor: pointer;
19711967
padding: 0;
19721968
background: none;
19731969
border: none;

src/test/rustdoc-gui/cursor.goml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This test ensures that several clickable items actually have the pointer cursor.
2+
goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
3+
4+
// the `[+]/[-]` button
5+
assert-css: ("#toggle-all-docs", {"cursor": "pointer"})
6+
7+
// the button next to the path header
8+
assert-css: ("#copy-path", {"cursor": "pointer"})
9+
10+
// the search tabs
11+
write: (".search-input", "Foo")
12+
// To be SURE that the search will be run.
13+
press-key: 'Enter'
14+
// Waiting for the search results to appear...
15+
wait-for: "#titles"
16+
assert-css: ("#titles > button", {"cursor": "pointer"})
17+
18+
// mobile sidebar toggle button
19+
size: (500, 700)
20+
assert-css: (".sidebar-menu-toggle", {"cursor": "pointer"})
21+
22+
// the sidebar toggle button on the source code pages
23+
goto: "file://" + |DOC_PATH| + "/src/lib2/lib.rs.html"
24+
assert-css: ("#sidebar-toggle > button", {"cursor": "pointer"})

0 commit comments

Comments
 (0)