From ec7437f00ae80febae256f960b4aa4c86faff765 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 22 May 2023 03:19:01 -0300 Subject: [PATCH] Better way to toggle light/dark mode --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index 3e55eab..9709746 100644 --- a/server.py +++ b/server.py @@ -777,7 +777,7 @@ def create_interface(): set_interface_arguments, [shared.gradio[k] for k in ['interface_modes_menu', 'extensions_menu', 'bool_menu']], None).then( lambda: None, None, None, _js='() => {document.body.innerHTML=\'

Reloading...

\'; setTimeout(function(){location.reload()},2500); return []}') - shared.gradio['toggle_dark_mode'].click(lambda: None, None, None, _js='() => {document.getElementsByTagName("gradio-app")[0].classList.toggle("dark")}') + shared.gradio['toggle_dark_mode'].click(lambda: None, None, None, _js='() => {document.getElementsByTagName("body")[0].classList.toggle("dark")}') # chat mode event handlers if shared.is_chat():