SebastianBravo commited on
Commit
80521da
·
1 Parent(s): 7e7a0ef

Color test

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -84,14 +84,13 @@ def clear():
84
 
85
  theme = gr.themes.Base(primary_hue="teal").set(block_background_fill="#235784",)
86
 
87
- js="""
88
  () => {
89
- document.body.classList.toggle('dark');
90
- document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
91
  }
92
  """
93
 
94
- with gr.Blocks(theme="base", _js=js) as demo:
95
  with gr.Row():
96
  # gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233529518-33e8bcdb-146f-49e8-94c4-27d6529ce4f7.png' width="30%" height="30%"></center>""")
97
  gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233531457-f368e04b-5099-42a8-906d-6f1250ea0f1e.png' width="40%" height="40%"></center>""")
 
84
 
85
  theme = gr.themes.Base(primary_hue="teal").set(block_background_fill="#235784",)
86
 
87
+ css="""
88
  () => {
89
+ document.body.classList.toggle('dark', shouldAdd);
 
90
  }
91
  """
92
 
93
+ with gr.Blocks(theme="base", css=css) as demo:
94
  with gr.Row():
95
  # gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233529518-33e8bcdb-146f-49e8-94c4-27d6529ce4f7.png' width="30%" height="30%"></center>""")
96
  gr.HTML(r"""<center><img src='https://user-images.githubusercontent.com/66338785/233531457-f368e04b-5099-42a8-906d-6f1250ea0f1e.png' width="40%" height="40%"></center>""")