Tile commited on
Commit
4d297fe
1 Parent(s): 6d2e71d

first commit

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -55,7 +55,8 @@ theme = gr.themes.Base(
55
  block_border_width='2px',
56
  block_border_width_dark='2px',
57
  button_primary_background_fill_dark='*primary_500',
58
- button_primary_border_color_dark='*primary_500'
 
59
  )
60
 
61
  css='''
@@ -85,6 +86,18 @@ html_title = '''
85
 
86
  '''
87
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  debug = False
89
  def print_debug(t):
90
  if debug:
@@ -307,7 +320,7 @@ dropdown_list = [
307
  "How fast can transistors switch?",
308
  ]
309
 
310
- with gr.Blocks(theme=theme, css=css) as demo:
311
  # gr.Markdown(description)
312
  state = gr.State(default_conversation.copy())
313
  gr.HTML(value=html_title)
 
55
  block_border_width='2px',
56
  block_border_width_dark='2px',
57
  button_primary_background_fill_dark='*primary_500',
58
+ button_primary_border_color_dark='*primary_500',
59
+ background-color: black,
60
  )
61
 
62
  css='''
 
86
 
87
  '''
88
 
89
+ # force dark theme
90
+ js_func = """
91
+ function refresh() {
92
+ const url = new URL(window.location);
93
+
94
+ if (url.searchParams.get('__theme') !== 'dark') {
95
+ url.searchParams.set('__theme', 'dark');
96
+ window.location.href = url.href;
97
+ }
98
+ }
99
+ """
100
+
101
  debug = False
102
  def print_debug(t):
103
  if debug:
 
320
  "How fast can transistors switch?",
321
  ]
322
 
323
+ with gr.Blocks(theme=theme, css=css, js=js_func) as demo:
324
  # gr.Markdown(description)
325
  state = gr.State(default_conversation.copy())
326
  gr.HTML(value=html_title)