Skip to content

Commit b653b5b

Browse files
Make the sidebar slide on mobile
1 parent 3d879b7 commit b653b5b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

doc-tool/resources/css/sidebar.css

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
top: 50px;
44
left: 0;
55
z-index: 1000;
6-
width: 100%;
6+
width: 275px;
77
height: 100%;
88
overflow-x: hidden; /* Safari and some others don't support overflow: x y */
99
overflow-y: auto;
1010
-webkit-overflow-scrolling: touch; /* nicer scrolling on touch screens */
1111
font-family: var(--font-family-sidebar);
1212
background: var(--sidebar);
13-
visibility: hidden; /* hidden by default, shown by toggle (on small screens) */
14-
opacity: 0;
15-
transition: visibility .25s ease-out, opacity .25s ease-out;
13+
margin-left: -275px; /* invisible by default, shown by toggle */
14+
transition: margin .25s ease-out;
15+
box-shadow: 0 0 10px var(--primary);
1616
}
1717

1818
.sidebar.toggled {
19-
visibility: visible;
20-
opacity: 1;
19+
margin-left: 0;
2120
}
2221

2322
.sidebar ul.toc {
@@ -124,11 +123,7 @@
124123

125124
@media (min-width: 768px) {
126125
.sidebar { /* visible by default, hidden by toggle */
127-
width: 275px;
128-
visibility: visible;
129-
opacity: 1;
130126
margin-left: 0;
131-
transition: margin .25s ease-out;
132127
}
133128
.sidebar.toggled {
134129
margin-left: -275px;

0 commit comments

Comments
 (0)