Use of a --theme argument for more flexibility

Added possibility to set the theme (light or dark)
This commit is contained in:
Michoko
2022-10-17 18:24:24 +02:00
parent 8c6a981d5d
commit 665beebc08
3 changed files with 6 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
// various functions for interation with ui.py not large enough to warrant putting them in separate files
function go_dark_mode(){
function set_theme(theme){
gradioURL = window.location.href
if (!gradioURL.endsWith('?__theme=dark')) {
window.location.replace(gradioURL + '?__theme=dark');
if (!gradioURL.includes('?__theme=')) {
window.location.replace(gradioURL + '?__theme=' + theme);
}
}