HFUsman commited on
Commit
ad6a9e5
·
verified ·
1 Parent(s): 2fa8b5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -40,21 +40,25 @@ task = st.sidebar.selectbox("What would you like to do?", [
40
  "Provide Learning Resources"
41
  ])
42
 
43
- theme = st.selectbox("Choose Theme", ["Light", "Dark"], index=0)
 
 
44
 
45
  # Apply theme styles
46
  def set_theme(theme):
47
  if theme == "Dark":
48
  st.markdown("""
49
  <style>
50
- body { background-color: #121212; color: #ffffff; }
51
- .stTextArea textarea, .stSelectbox select, .stButton>button { background-color: #333333; color: white; }
 
52
  </style>
53
  """, unsafe_allow_html=True)
54
  else:
55
  st.markdown("""
56
  <style>
57
- body { background-color: #f5f5f5; color: #000000; }
 
58
  .stTextArea textarea, .stSelectbox select, .stButton>button { background-color: #ffffff; color: black; }
59
  </style>
60
  """, unsafe_allow_html=True)
 
40
  "Provide Learning Resources"
41
  ])
42
 
43
+ # Sidebar Theme Toggle
44
+ st.sidebar.header("Choose Theme")
45
+ theme = st.sidebar.radio("Theme", ["Light", "Dark"], index=0)
46
 
47
  # Apply theme styles
48
  def set_theme(theme):
49
  if theme == "Dark":
50
  st.markdown("""
51
  <style>
52
+ body, .block-container { background-color: #121212; color: #ffffff; }
53
+ [data-testid="stSidebar"] { background-color: #333333; color: white; }
54
+ .stTextArea textarea, .stSelectbox select, .stButton>button { background-color: #444444; color: white; }
55
  </style>
56
  """, unsafe_allow_html=True)
57
  else:
58
  st.markdown("""
59
  <style>
60
+ body, .block-container { background-color: #f5f5f5; color: #000000; }
61
+ [data-testid="stSidebar"] { background-color: #ffffff; color: black; }
62
  .stTextArea textarea, .stSelectbox select, .stButton>button { background-color: #ffffff; color: black; }
63
  </style>
64
  """, unsafe_allow_html=True)