Spaces:
Sleeping
Sleeping
Updated Dark Mode
Browse files
app.py
CHANGED
@@ -24,12 +24,18 @@ with gr.Blocks(theme='pseudolab/huggingface-korea-theme') as demo:
|
|
24 |
|
25 |
dropdown.change(None, dropdown, None, _js=js)
|
26 |
toggle_dark.click(
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
document.body.classList.toggle('dark');
|
31 |
-
document.
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
""",
|
34 |
)
|
35 |
|
|
|
24 |
|
25 |
dropdown.change(None, dropdown, None, _js=js)
|
26 |
toggle_dark.click(
|
27 |
+
None,
|
28 |
+
_js="""
|
29 |
+
() => {
|
30 |
document.body.classList.toggle('dark');
|
31 |
+
if (document.body.classList.contains('dark')) {
|
32 |
+
document.querySelector('gradio-app').style.backgroundColor = '#222';
|
33 |
+
document.querySelector('gradio-app').style.color = '#fff';
|
34 |
+
} else {
|
35 |
+
document.querySelector('gradio-app').style.backgroundColor = '#fff';
|
36 |
+
document.querySelector('gradio-app').style.color = '#222';
|
37 |
+
}
|
38 |
+
}
|
39 |
""",
|
40 |
)
|
41 |
|