Added dark mode switch

Launch the UI in dark mode with the --dark-mode switch
This commit is contained in:
Michoko
2022-10-17 11:05:05 +02:00
parent cccc5a20fc
commit 8c6a981d5d
3 changed files with 10 additions and 1 deletions

View File

@@ -1783,6 +1783,8 @@ for filename in sorted(os.listdir(jsdir)):
with open(os.path.join(jsdir, filename), "r", encoding="utf8") as jsfile:
javascript += f"\n<script>{jsfile.read()}</script>"
if cmd_opts.dark_mode:
javascript += "\n<script>go_dark_mode();</script>\n"
if 'gradio_routes_templates_response' not in globals():
def template_response(*args, **kwargs):