File tree 2 files changed +42
-2
lines changed
librustdoc/html/static/css
2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,6 @@ nav.sub {
373
373
374
374
.source .sidebar .expanded {
375
375
overflow-y : auto;
376
- width : 300px ;
377
376
}
378
377
379
378
.source .sidebar .expanded > * {
@@ -1394,7 +1393,7 @@ pre.rust {
1394
1393
z-index : 10 ;
1395
1394
}
1396
1395
# source-sidebar {
1397
- width : 300 px ;
1396
+ width : 100 % ;
1398
1397
z-index : 1 ;
1399
1398
overflow : auto;
1400
1399
}
@@ -1711,6 +1710,10 @@ details.rustdoc-toggle[open] > summary.hideme::after {
1711
1710
.rustdoc .source .sidebar {
1712
1711
transition : width .5s ;
1713
1712
}
1713
+
1714
+ .source .sidebar .expanded {
1715
+ width : 300px ;
1716
+ }
1714
1717
}
1715
1718
1716
1719
@media (max-width : 700px ) {
@@ -1999,6 +2002,11 @@ details.rustdoc-toggle[open] > summary.hideme::after {
1999
2002
.search-results div .desc , .search-results .result-description , .item-right {
2000
2003
padding-left : 2em ;
2001
2004
}
2005
+
2006
+ .source .sidebar .expanded {
2007
+ max-width : 100vw ;
2008
+ width : 100vw ;
2009
+ }
2002
2010
}
2003
2011
2004
2012
@media print {
Original file line number Diff line number Diff line change
1
+ // The goal of this test is to ensure that the sidebar is working as expected in the source
2
+ // code pages.
3
+ goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
4
+ // First: desktop mode.
5
+ size: (1100, 800)
6
+ // We check that the sidebar isn't expanded and has the expected width.
7
+ assert-css: ("nav.sidebar", {"width": "50px"})
8
+ // We now click on the button to expand the sidebar.
9
+ click: (10, 10)
10
+ // We wait for the sidebar to be expanded (there is a 0.5s animation).
11
+ wait-for: 600
12
+ assert-css: ("nav.sidebar.expanded", {"width": "300px"})
13
+ // We collapse the sidebar.
14
+ click: (10, 10)
15
+ // We wait for the sidebar to be collapsed (there is a 0.5s animation).
16
+ wait-for: 600
17
+ // We ensure that the class has been removed.
18
+ assert-false: "nav.sidebar.expanded"
19
+ assert: "nav.sidebar"
20
+
21
+ // We now switch to mobile mode.
22
+ size: (600, 600)
23
+ // We check that the sidebar has the expected width (0 and 1px for the border).
24
+ assert-css: ("nav.sidebar", {"width": "1px"})
25
+ // We expand the sidebar.
26
+ click: "#sidebar-toggle"
27
+ assert-css: ("nav.sidebar.expanded", {"width": "600px"})
28
+ // We collapse the sidebar.
29
+ click: (10, 10)
30
+ // We ensure that the class has been removed.
31
+ assert-false: "nav.sidebar.expanded"
32
+ assert: "nav.sidebar"
You can’t perform that action at this time.
0 commit comments