vsj0702 commited on
Commit
8f19a92
·
verified ·
1 Parent(s): c61b525

Fixing error

Browse files
Files changed (1) hide show
  1. app.py +24 -4
app.py CHANGED
@@ -11,9 +11,9 @@ st.set_page_config(
11
  layout="wide"
12
  )
13
 
14
- # 2️⃣ Dark mode toggle
15
  if 'dark_mode' not in st.session_state:
16
- st.session_state.dark_mode = True
17
 
18
  dm = st.checkbox("🌙 Dark mode", value=st.session_state.dark_mode)
19
  st.session_state.dark_mode = dm
@@ -32,17 +32,23 @@ st.markdown(f"""
32
  <style>
33
  .stApp {{ background-color: {BG}; color: {TEXT}; }}
34
  [data-testid="stSidebar"] {{ background-color: {PANEL_BG} !important; }}
 
 
35
  .ace_editor, .ace_scroller {{
36
  background: {PANEL_BG} !important;
37
  box-shadow: 0 4px 8px {SHADOW} !important;
38
  border-radius: 8px !important;
39
  }}
 
 
40
  textarea, input, .stTextArea textarea {{
41
  background: {PANEL_BG} !important;
42
  color: {TEXT} !important;
43
  border: 1px solid {BORDER} !important;
44
  border-radius: 4px !important;
45
  }}
 
 
46
  button, .stDownloadButton > button {{
47
  background-color: {ACCENT} !important;
48
  color: #fff !important;
@@ -50,11 +56,25 @@ st.markdown(f"""
50
  transition: transform 0.1s;
51
  }}
52
  button:hover {{ transform: scale(1.02) !important; }}
53
- .chat-container {{ background: {PANEL_BG} !important; border: 1px solid {BORDER} !important; border-radius: 8px !important; padding: 1rem; max-height: 480px; overflow-y: auto; }}
 
 
 
 
 
 
 
 
 
54
  .chat-message {{ margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 12px; }}
55
  .user-message {{ background: rgba(100,149,237,0.2); align-self: flex-end; }}
56
  .bot-message {{ background: rgba(200,200,200,0.2); align-self: flex-start; }}
57
  pre code {{ display: block; padding: 0.5rem; background: rgba(0,0,0,0.1); border-radius: 4px; overflow-x: auto; }}
 
 
 
 
 
58
  </style>
59
  """, unsafe_allow_html=True)
60
 
@@ -100,4 +120,4 @@ st.markdown(f"""
100
  <div style='text-align:center; margin-top:1rem; color:{TEXT}66;'>
101
  Built with ❤️ & Streamlit by Vaibhav
102
  </div>
103
- """, unsafe_allow_html=True)
 
11
  layout="wide"
12
  )
13
 
14
+ # 2️⃣ Dark mode toggle (default OFF)
15
  if 'dark_mode' not in st.session_state:
16
+ st.session_state.dark_mode = False # Dark mode OFF by default
17
 
18
  dm = st.checkbox("🌙 Dark mode", value=st.session_state.dark_mode)
19
  st.session_state.dark_mode = dm
 
32
  <style>
33
  .stApp {{ background-color: {BG}; color: {TEXT}; }}
34
  [data-testid="stSidebar"] {{ background-color: {PANEL_BG} !important; }}
35
+
36
+ /* Editor styling */
37
  .ace_editor, .ace_scroller {{
38
  background: {PANEL_BG} !important;
39
  box-shadow: 0 4px 8px {SHADOW} !important;
40
  border-radius: 8px !important;
41
  }}
42
+
43
+ /* Input & textarea styling */
44
  textarea, input, .stTextArea textarea {{
45
  background: {PANEL_BG} !important;
46
  color: {TEXT} !important;
47
  border: 1px solid {BORDER} !important;
48
  border-radius: 4px !important;
49
  }}
50
+
51
+ /* Button styling */
52
  button, .stDownloadButton > button {{
53
  background-color: {ACCENT} !important;
54
  color: #fff !important;
 
56
  transition: transform 0.1s;
57
  }}
58
  button:hover {{ transform: scale(1.02) !important; }}
59
+
60
+ /* Chat styling */
61
+ .chat-container {{
62
+ background: {PANEL_BG} !important;
63
+ border: 1px solid {BORDER} !important;
64
+ border-radius: 8px !important;
65
+ padding: 1rem;
66
+ max-height: 480px;
67
+ overflow-y: auto;
68
+ }}
69
  .chat-message {{ margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 12px; }}
70
  .user-message {{ background: rgba(100,149,237,0.2); align-self: flex-end; }}
71
  .bot-message {{ background: rgba(200,200,200,0.2); align-self: flex-start; }}
72
  pre code {{ display: block; padding: 0.5rem; background: rgba(0,0,0,0.1); border-radius: 4px; overflow-x: auto; }}
73
+
74
+ /* 🌙 Dark mode checkbox label styling */
75
+ label[data-testid="stMarkdownContainer"] > div > div {{
76
+ color: {TEXT} !important;
77
+ }}
78
  </style>
79
  """, unsafe_allow_html=True)
80
 
 
120
  <div style='text-align:center; margin-top:1rem; color:{TEXT}66;'>
121
  Built with ❤️ & Streamlit by Vaibhav
122
  </div>
123
+ """, unsafe_allow_html=True)