Skip to content

Commit 51fb8a0

Browse files
committed
Fix auto mode also in javascript
1 parent ffa0af9 commit 51fb8a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/doc/common/static/jupyter-sphinx-furo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
function changeTheme(editor, theme) {
33
if (theme === 'dark') {
44
editor.setOption('theme', 'monokai'); // the same with pygments dark style in conf.py
5-
}
6-
else {
5+
} else if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
6+
editor.setOption('theme', 'monokai');
7+
} else {
78
editor.setOption('theme', 'default');
89
}
910
}

0 commit comments

Comments
 (0)