Skip to content

Commit a06c6bd

Browse files
Fix mobile doc style and improve search bar
1 parent 6537fd1 commit a06c6bd

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/librustdoc/html/static/rustdoc.css

+14-4
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ span.since {
822822
margin-left: -15px;
823823
padding: 0 15px;
824824
position: static;
825+
z-index: 1;
825826
}
826827

827828
.sidebar > .location {
@@ -848,25 +849,34 @@ span.since {
848849
}
849850

850851
.sidebar-menu {
851-
position: absolute;
852+
position: fixed;
853+
z-index: 10;
852854
font-size: 2rem;
853855
cursor: pointer;
854-
margin-top: 2px;
856+
width: 45px;
857+
left: 0;
858+
text-align: center;
855859
display: block;
860+
border-bottom: 1px solid;
861+
border-right: 1px solid;
856862
}
857863

858864
.sidebar-elems {
859-
background-color: #F1F1F1;
860865
position: fixed;
861866
z-index: 1;
862867
left: 0;
863868
top: 45px;
864869
bottom: 0;
865870
overflow-y: auto;
866-
border-right: 1px solid #000;
871+
border-right: 1px solid;
867872
display: none;
868873
}
869874

875+
.sidebar > .block.version {
876+
border-bottom: none;
877+
margin-top: 12px;
878+
}
879+
870880
nav.sub {
871881
margin: 0 auto;
872882
}

src/librustdoc/html/static/styles/main.css

+13
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,16 @@ pre.ignore:hover, .information:hover + pre.ignore {
330330
.modal-content > .close:hover + .whiter {
331331
background-color: #ff1f1f;
332332
}
333+
334+
@media (max-width: 700px) {
335+
.sidebar-menu {
336+
background-color: #F1F1F1;
337+
border-bottom-color: #e0e0e0;
338+
border-right-color: #e0e0e0;
339+
}
340+
341+
.sidebar-elems {
342+
background-color: #F1F1F1;
343+
border-right-color: #000;
344+
}
345+
}

0 commit comments

Comments
 (0)