Skip to content

Commit 5b10173

Browse files
Shreeiya TrivediShreeiya Trivedi
authored andcommitted
Improve dark mode styling for RTD theme
Signed-off-by: Shreeiya Trivedi <[email protected]>
1 parent f8242cb commit 5b10173

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/source/_static/theme_overrides.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* =========================
2+
Dark mode overrides
3+
========================= */
4+
5+
html[data-theme="dark"] {
6+
--background-color: #121212;
7+
--text-color: #e6e6e6;
8+
--link-color: #58a6ff;
9+
--sidebar-bg: #1e1e1e;
10+
--border-color: #333333;
11+
--code-bg: #1b1f23;
12+
}
13+
14+
115
/* this is the container for the pages */
216
.wy-nav-content {
317
max-width: 100%;
@@ -24,3 +38,29 @@ div.rst-content {
2438
margin-left: 0px;
2539
}
2640
}
41+
42+
43+
44+
html[data-theme="dark"] body {
45+
background-color: var(--background-color);
46+
color: var(--text-color);
47+
}
48+
49+
html[data-theme="dark"] .wy-nav-side {
50+
background-color: var(--sidebar-bg);
51+
}
52+
53+
html[data-theme="dark"] a {
54+
color: var(--link-color);
55+
}
56+
57+
html[data-theme="dark"] .wy-nav-content-wrap {
58+
border-color: var(--border-color);
59+
}
60+
61+
html[data-theme="dark"] pre,
62+
html[data-theme="dark"] code {
63+
background-color: var(--code-bg);
64+
color: var(--text-color);
65+
}
66+

0 commit comments

Comments
 (0)