From bbe4a29a258d028c6369c0eda90b9607b86f0156 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:03:09 -0300 Subject: [PATCH] Add back dark theme code --- server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.py b/server.py index 0be1f4c4..414cd3ba 100644 --- a/server.py +++ b/server.py @@ -128,6 +128,9 @@ def create_interface(): ui_model_menu.create_event_handlers() # Interface launch events + if shared.settings['dark_theme']: + shared.gradio['interface'].load(lambda: None, None, None, _js="() => document.getElementsByTagName('body')[0].classList.add('dark')") + shared.gradio['interface'].load(lambda: None, None, None, _js=f"() => {{{js}}}") shared.gradio['interface'].load(partial(ui.apply_interface_values, {}, use_persistent=True), None, gradio(ui.list_interface_input_elements()), show_progress=False) if shared.is_chat():