Skip to content

Commit 1e55c31

Browse files
Fix remaining bugs
1 parent 6e9954d commit 1e55c31

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

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

+21-6
Original file line numberDiff line numberDiff line change
@@ -348,21 +348,18 @@ nav.sub {
348348
position: sticky;
349349
min-width: 200px;
350350
height: 100vh;
351+
top: 0;
352+
left: 0;
351353
}
352354

353355
.rustdoc.source .sidebar {
354-
overflow: auto;
355-
}
356-
357-
.source .sidebar {
358356
width: 50px;
359357
min-width: 0px;
360358
max-width: 300px;
361359
flex-grow: 0;
362360
flex-shrink: 0;
363361
flex-basis: auto;
364362
border-right: 1px solid;
365-
transition: width .5s;
366363
overflow-x: hidden;
367364
/* The sidebar is by default hidden */
368365
overflow-y: hidden;
@@ -376,7 +373,7 @@ nav.sub {
376373

377374
.source .sidebar.expanded {
378375
overflow-y: auto;
379-
width: 300px !important;
376+
width: 300px;
380377
}
381378

382379
.source .sidebar.expanded > * {
@@ -1698,6 +1695,18 @@ details.rustdoc-toggle[open] > summary.hideme::after {
16981695
.docblock > .information:first-child > .tooltip {
16991696
margin-top: 16px;
17001697
}
1698+
1699+
/* When we expand the sidebar on the source code page, we hide the logo on the left of the
1700+
search bar to have more space. */
1701+
.sidebar.expanded + main .main-inner .sub-logo-container.rust-logo {
1702+
display: none;
1703+
}
1704+
1705+
/* It doesn't render well on mobile because of the layout, so better only have the transition
1706+
on desktop. */
1707+
.rustdoc.source .sidebar {
1708+
transition: width .5s;
1709+
}
17011710
}
17021711

17031712
@media (max-width: 700px) {
@@ -1723,6 +1732,7 @@ details.rustdoc-toggle[open] > summary.hideme::after {
17231732
padding: 0 15px;
17241733
position: static;
17251734
z-index: 11;
1735+
overflow-y: hidden;
17261736
}
17271737

17281738
.rustdoc.source > .sidebar {
@@ -1779,6 +1789,7 @@ details.rustdoc-toggle[open] > summary.hideme::after {
17791789
cursor: pointer;
17801790
width: 45px;
17811791
left: 0;
1792+
top: 0;
17821793
text-align: center;
17831794
display: block;
17841795
border-bottom: 1px solid;
@@ -2052,6 +2063,10 @@ details.rustdoc-toggle[open] > summary.hideme::after {
20522063
height: 35px;
20532064
width: 35px;
20542065
}
2066+
2067+
.sidebar:not(.expanded) #sidebar-toggle {
2068+
top: 10px;
2069+
}
20552070
}
20562071

20572072

src/librustdoc/html/templates/page.html

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
<input {# -#}
112112
class="search-input" {# -#}
113113
name="search" {# -#}
114-
disabled {# -#}
115114
autocomplete="off" {# -#}
116115
spellcheck="false" {# -#}
117116
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}

src/test/rustdoc-gui/source-code-page.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
22
// Check that we can click on the line number.
3-
click: (50, 196) // This is the position of the span for line 4.
3+
click: ".line-numbers > span:nth-child(4)" // This is the span for line 4.
44
// Unfortunately, "#4" isn't a valid query selector, so we have to go around that limitation
55
// by instead getting the nth span.
66
assert-attribute: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"})

0 commit comments

Comments
 (0)