Add a "dark_theme" option to settings.json (#2288)
This commit is contained in:
parent
c5446ae0e2
commit
0f51b64bb3
3 changed files with 6 additions and 0 deletions
|
@ -968,7 +968,11 @@ def create_interface():
|
|||
shared.gradio['count_tokens'].click(count_tokens, shared.gradio['textbox'], shared.gradio['status'], show_progress=False)
|
||||
|
||||
shared.gradio['interface'].load(lambda: None, None, None, _js=f"() => {{{js}}}")
|
||||
if shared.settings['dark_theme']:
|
||||
shared.gradio['interface'].load(lambda: None, None, None, _js=f"() => document.getElementsByTagName('body')[0].classList.add('dark')")
|
||||
|
||||
shared.gradio['interface'].load(partial(ui.apply_interface_values, {}, use_persistent=True), None, [shared.gradio[k] for k in ui.list_interface_input_elements(chat=shared.is_chat())], show_progress=False)
|
||||
|
||||
# Extensions tabs
|
||||
extensions_module.create_extensions_tabs()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue