Skip to content

Commit 2d4e3a1

Browse files
committed
Updated sidebar responsiveness
1 parent 55754b6 commit 2d4e3a1

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

python_docs_theme/static/pydoctheme_dark.css

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
--bad-border: var(--bad-color);
99
}
1010

11-
1211
/* Browser elements */
1312
:root {
1413
scrollbar-color: #616161 transparent;
@@ -27,20 +26,46 @@ div.related {
2726
}
2827

2928
/* SIDEBAR */
30-
div.sphinxsidebar, .menu-wrapper {
31-
background-color: #333;
32-
color: inherit;
29+
div.sidebar, aside.sidebar {
30+
background-color: #424242;
31+
border-color: #616161;
32+
width: 250px; /* Set the sidebar width */
33+
transition: width 0.3s ease; /* Smooth transition */
34+
}
35+
36+
/* Make sidebar responsive */
37+
@media screen and (max-width: 768px) {
38+
div.sidebar, aside.sidebar {
39+
width: 200px; /* Adjust width on smaller screens */
40+
}
41+
}
42+
43+
@media screen and (max-width: 480px) {
44+
div.sidebar, aside.sidebar {
45+
display: none; /* Hide sidebar on very small screens */
46+
}
47+
48+
#sidebarbutton {
49+
display: block; /* Show sidebar toggle button */
50+
}
3351
}
3452

53+
/* Sidebar button style */
3554
#sidebarbutton {
36-
/* important to overwrite style attribute */
37-
background-color: #555 !important;
38-
color: inherit !important;
55+
background-color: #555;
56+
color: inherit;
57+
padding: 10px;
58+
cursor: pointer;
59+
display: none;
3960
}
4061

62+
/* Transition and hover effects */
4163
div.sidebar, aside.sidebar {
42-
background-color: #424242;
43-
border-color: #616161;
64+
transition: all 0.3s ease-in-out;
65+
}
66+
67+
div.sidebar:hover, aside.sidebar:hover {
68+
background-color: #555;
4469
}
4570

4671
/* ANCHORS AND HIGHLIGHTS */
@@ -74,8 +99,6 @@ span.highlighted {
7499
background-color: #2c3e50;
75100
}
76101

77-
/* Below for most things in text */
78-
79102
dl.field-list > dt {
80103
background-color: #434;
81104
}

0 commit comments

Comments
 (0)