whitphx HF staff commited on
Commit
a4f7080
1 Parent(s): 7179c4c

Load the theme config to the initial state

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,13 +5,13 @@ import streamlit as st
5
  import fragments
6
 
7
  if 'primaryColor' not in st.session_state:
8
- st.session_state['primaryColor'] = "#F63366"
9
  if 'backgroundColor' not in st.session_state:
10
- st.session_state['backgroundColor'] = "#FFFFFF"
11
  if 'secondaryBackgroundColor' not in st.session_state:
12
- st.session_state['secondaryBackgroundColor'] = "#F0F2F6"
13
  if 'textColor' not in st.session_state:
14
- st.session_state['textColor'] = "#262730"
15
 
16
 
17
  primary_color = st.color_picker('Primary color', key="primaryColor")
 
5
  import fragments
6
 
7
  if 'primaryColor' not in st.session_state:
8
+ st.session_state['primaryColor'] = st._config.get_option(f'theme.primaryColor') or "#F63366"
9
  if 'backgroundColor' not in st.session_state:
10
+ st.session_state['backgroundColor'] = st._config.get_option(f'theme.backgroundColor') or "#FFFFFF"
11
  if 'secondaryBackgroundColor' not in st.session_state:
12
+ st.session_state['secondaryBackgroundColor'] = st._config.get_option(f'theme.secondaryBackgroundColor') or "#F0F2F6"
13
  if 'textColor' not in st.session_state:
14
+ st.session_state['textColor'] = st._config.get_option(f'theme.textColor') or "#262730"
15
 
16
 
17
  primary_color = st.color_picker('Primary color', key="primaryColor")