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

@@ -1,5 +1,12 @@
// various functions for interation with ui.py not large enough to warrant putting them in separate files
function go_dark_mode(){
gradioURL = window.location.href
if (!gradioURL.endsWith('?__theme=dark')) {
window.location.replace(gradioURL + '?__theme=dark');
}
}
function selected_gallery_index(){
var buttons = gradioApp().querySelectorAll('[style="display: block;"].tabitem .gallery-item')
var button = gradioApp().querySelector('[style="display: block;"].tabitem .gallery-item.\\!ring-2')