SuhasGholkar commited on
Commit
268aa79
·
verified ·
1 Parent(s): fdced05

Update src/brand.py

Browse files
Files changed (1) hide show
  1. src/brand.py +134 -65
src/brand.py CHANGED
@@ -18,7 +18,7 @@ def inject_brand_css() -> None:
18
  st.markdown(f"""
19
  <style>
20
  :root {{
21
- --brand-primary: {PRIMARY};
22
  --brand-primary-dark: {PRIMARY_DARK};
23
  --brand-success: {SUCCESS};
24
  --brand-warning: {WARNING};
@@ -31,7 +31,6 @@ def inject_brand_css() -> None:
31
  --brand-radius-lg: 14px;
32
  --brand-radius-md: 10px;
33
  --brand-shadow: 0 10px 30px rgba(0,0,0,.05);
34
- --brand-primary-600:#1e57c0;
35
  --ink-900:#0f172a;
36
  --ink-700:#334155;
37
  --ink-500:#64748b;
@@ -39,12 +38,25 @@ def inject_brand_css() -> None:
39
  --success-600:#059669;
40
  --info-50:#eef6ff;
41
  --info-600:#2563eb;
42
- }}
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- html, body, [data-testid="stAppViewContainer"] {{
45
- background: var(--brand-bg);
46
- color: var(--brand-text);
47
- }}
 
48
 
49
  .brand-page-wrap{{
50
  padding: 6px 8px 22px;
@@ -155,17 +167,8 @@ def inject_brand_css() -> None:
155
  border-radius:12px;
156
  }}
157
 
158
- /* Generic card container */
159
 
160
- .brand-card{{
161
- background:var(--brand-card);
162
- border:1px solid var(--brand-border);
163
- border-radius:var(--brand-radius);
164
- box-shadow:var(--brand-shadow);
165
- padding:18px;
166
- }}
167
-
168
- /* ---------- CHAT TAB STYLES ---------- */
169
  .chat-header{{
170
  display:flex; align-items:center; gap:12px; margin-bottom:8px;
171
  }}
@@ -203,56 +206,10 @@ def inject_brand_css() -> None:
203
  display:flex; flex-direction:column; gap:12px;
204
  }}
205
 
206
- .msg{{
207
- padding:12px 14px;
208
- border-radius:14px;
209
- border:1px solid var(--brand-border);
210
- background:var(--brand-card);
211
- box-shadow: var(--brand-shadow);
212
- }}
213
-
214
- .msg-user{{
215
- background:#eef6ff; border-color:#d6e6ff;
216
- }}
217
-
218
- .msg-bot{{
219
- background: var(--success-50); border-color:#c7f0e6;
220
- }}
221
-
222
- .msg-header{{
223
- display:flex; justify-content:space-between; align-items:center;
224
- margin-bottom:6px; color:var(--ink-500); font-size:12px;
225
- }}
226
-
227
- .msg-role{{
228
- font-weight:700; color:var(--ink-700);
229
- }}
230
-
231
- .analysis-card{{
232
- background: var(--brand-card);
233
- border:1px dashed var(--brand-border);
234
- border-radius:12px;
235
- padding:12px 14px;
236
- color: var(--ink-700);
237
- }}
238
-
239
- .analysis-card h4{{ margin:.2rem 0 .4rem; font-size:14px; }}
240
-
241
- .analysis-grid{{
242
- display:grid; grid-template-columns: repeat(2, minmax(0,1fr));
243
- gap: 8px 18px; margin-top:8px;
244
- }}
245
-
246
- .badge{{
247
- display:inline-flex; align-items:center; gap:6px;
248
- padding:4px 8px; border-radius:999px; font-size:12px;
249
- background:#f1f5f9; color:var(--ink-700);
250
- }}
251
-
252
- .badge.green{{ background:#dcfce7; color:var(--success-600); }}
253
 
254
  /* Make Streamlit markdown in chat messages breathe less */
255
- .msg p{{ margin:0.25rem 0; }}
256
 
257
  /* Cards */
258
  .card {{
@@ -294,6 +251,118 @@ def inject_brand_css() -> None:
294
  [data-testid="stSidebar"] .stMarkdown h3 {{
295
  margin-top: .25rem; margin-bottom: .5rem;
296
  }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  </style>
298
  """, unsafe_allow_html=True)
299
 
 
18
  st.markdown(f"""
19
  <style>
20
  :root {{
21
+ --brand-primary: #2563EB; /* primary blue */
22
  --brand-primary-dark: {PRIMARY_DARK};
23
  --brand-success: {SUCCESS};
24
  --brand-warning: {WARNING};
 
31
  --brand-radius-lg: 14px;
32
  --brand-radius-md: 10px;
33
  --brand-shadow: 0 10px 30px rgba(0,0,0,.05);
 
34
  --ink-900:#0f172a;
35
  --ink-700:#334155;
36
  --ink-500:#64748b;
 
38
  --success-600:#059669;
39
  --info-50:#eef6ff;
40
  --info-600:#2563eb;
41
+ --brand-primary-600: #1E40AF;
42
+ --brand-primary-700: #1B2F7A;
43
+ --brand-accent: #10B981; /* accent mint */
44
+ --page-bg: #F7F8FB; /* softer background */
45
+ --card-bg: #FFFFFF;
46
+ --card-border: #E7E9F1;
47
+ --muted-text: #6B7280;
48
+ --title-text: #0F172A;
49
+ --bubble-user: #E8F1FF; /* lighter blue */
50
+ --bubble-bot: #E9FAF2; /* lighter mint */
51
+ --shadow-sm: 0 4px 14px rgba(15, 23, 42, .06);
52
+ --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
53
+ }}
54
 
55
+ html, body {{
56
+ background: var(--page-bg) !important;
57
+ }}
58
+
59
+ .block-container {{ padding-top: 1.2rem !important; }}
60
 
61
  .brand-page-wrap{{
62
  padding: 6px 8px 22px;
 
167
  border-radius:12px;
168
  }}
169
 
 
170
 
171
+ /* ---------- CHAT TAB STYLES ---------- */
 
 
 
 
 
 
 
 
172
  .chat-header{{
173
  display:flex; align-items:center; gap:12px; margin-bottom:8px;
174
  }}
 
206
  display:flex; flex-direction:column; gap:12px;
207
  }}
208
 
209
+ .badge.green{{ background:#dcfce7; color:var(--success-600); }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
  /* Make Streamlit markdown in chat messages breathe less */
212
+ .msg p{{ margin:0.25rem 0; }}
213
 
214
  /* Cards */
215
  .card {{
 
251
  [data-testid="stSidebar"] .stMarkdown h3 {{
252
  margin-top: .25rem; margin-bottom: .5rem;
253
  }}
254
+
255
+ /* ===== Header block ===== */
256
+ .brand-page-wrap .chat-header {{
257
+ display:flex; align-items:center; gap:14px; margin: 0 0 14px 0;
258
+ }}
259
+
260
+ .brand-page-wrap .chat-title{{
261
+ font-size: 26px; font-weight: 800; color: var(--title-text);
262
+ }}
263
+
264
+ .brand-card{{
265
+ background: var(--card-bg); border:1px solid var(--card-border);
266
+ border-radius:16px; padding:18px; box-shadow: var(--shadow-sm);
267
+ }}
268
+
269
+ /* ===== Input card ===== */
270
+ .chat-input-card {{
271
+ background: var(--card-bg); border:1px solid var(--card-border);
272
+ border-radius:16px; padding:14px 16px; box-shadow: var(--shadow-sm);
273
+ margin-bottom:16px;
274
+ }}
275
+
276
+ .chat-input-card input[type="text"]{{
277
+ border-radius:12px !important;
278
+ }}
279
+
280
+ /* ===== Conversation stream ===== */
281
+ .chat-stream {{ display:flex; flex-direction:column; gap:12px; }}
282
+
283
+ .msg {{ border-radius:14px; padding:12px 14px; box-shadow: var(--shadow-sm); }}
284
+
285
+ .msg-user {{
286
+ background: var(--bubble-user); border:1px solid #dbe7ff;
287
+ }}
288
+
289
+ .msg-bot {{
290
+ background: var(--bubble-bot); border:1px solid #c7f4df;
291
+ }}
292
+
293
+ .msg-header{{
294
+ display:flex; justify-content:space-between; align-items:center;
295
+ font-size:12px; color:var(--muted-text); margin-bottom:6px;
296
+ }}
297
+
298
+ .msg-role{{ font-weight:700; color: var(--title-text); }}
299
+
300
+ .badge{{
301
+ background:#fff; border:1px solid var(--card-border); border-radius:999px;
302
+ padding:3px 10px; font-size:11px; box-shadow: var(--shadow-sm);
303
+ }}
304
+
305
+ /* ===== Analysis card ===== */
306
+ .analysis-card{{
307
+ background:linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
308
+ border:1px solid var(--card-border); border-left:4px solid var(--brand-accent);
309
+ border-radius:14px; padding:12px 14px; box-shadow: var(--shadow-sm);
310
+ }}
311
+
312
+ .analysis-card h4{{ margin:0 0 8px 0; font-size:15px; color: var(--title-text); }}
313
+
314
+ .analysis-grid{{
315
+ display:grid; grid-template-columns: repeat(2, minmax(0,1fr));
316
+ gap:8px; color:#111827;
317
+ }}
318
+
319
+ @media (max-width: 900px){{ .analysis-grid{ grid-template-columns:1fr; } }}
320
+
321
+ /* ===== Buttons (primary + secondary) ===== */
322
+ [data-testid="stButton"] > button {{
323
+ border-radius:12px !important; font-weight:700 !important;
324
+ border: none !important; box-shadow: var(--shadow-sm) !important;
325
+ }}
326
+
327
+ [data-testid="stButton"] > button[kind="primary"]{{
328
+ background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-600) 100%) !important;
329
+ color: #fff !important;
330
+ }}
331
+
332
+ [data-testid="stButton"] > button[kind="primary"]:hover{{
333
+ transform: translateY(-1px);
334
+ box-shadow: var(--shadow-md) !important;
335
+ filter: brightness(1.02);
336
+ }}
337
+
338
+ [data-testid="stButton"] > button[kind="secondary"]{{
339
+ background: #fff !important; color: var(--brand-primary) !important;
340
+ border: 1px solid var(--card-border) !important;
341
+ }}
342
+
343
+ /* ===== Submit button inside forms ===== */
344
+ form [type="submit"]{{
345
+ width: 100%; border-radius:12px; height: 42px;
346
+ font-weight: 800; letter-spacing:.15px;
347
+ background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-700) 100%);
348
+ color:#fff; box-shadow: var(--shadow-sm); border:none;
349
+ }}
350
+
351
+ form [type="submit"]:hover{{ box-shadow: var(--shadow-md); transform: translateY(-1px); }
352
+
353
+ /* ===== Tables from results ===== */
354
+ [data-testid="stDataFrame"] {{
355
+ border:1px solid var(--card-border); border-radius:12px; box-shadow: var(--shadow-sm);
356
+ }}
357
+
358
+ /* ===== Section headings ===== */
359
+ .brand-section-title{{
360
+ font-weight:800; font-size:22px; margin: 10px 0 8px 0; color: var(--title-text);
361
+ }}
362
+
363
+ /* Optional: smaller top blank textinput (st.text_input label) */
364
+ label[for="user_input"] + div input {{ background: #fff; }}
365
+
366
  </style>
367
  """, unsafe_allow_html=True)
368