Skip to content

Commit 3b86d1f

Browse files
committed
fix the ui bugs
1 parent 551277c commit 3b86d1f

File tree

1 file changed

+94
-14
lines changed

1 file changed

+94
-14
lines changed

ui/styles.py

Lines changed: 94 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ def get_main_styles() -> str:
3535
--border-color: rgba(100, 181, 246, 0.2);
3636
}
3737
38-
/* Light theme variables */
38+
/* Light theme variables - Using dark theme colors */
3939
:root {
40-
--light-primary-bg: #f8fafc;
41-
--light-secondary-bg: #f1f5f9;
42-
--light-accent-bg: #e2e8f0;
43-
--light-card-bg: rgba(255, 255, 255, 0.9);
44-
--light-border-soft: #cbd5e1;
45-
--light-border-medium: #94a3b8;
46-
--light-text-primary: #1e293b;
47-
--light-text-secondary: #475569;
48-
--light-text-muted: #64748b;
49-
--light-accent-blue: #3b82f6;
50-
--light-accent-cyan: #06b6d4;
51-
--light-accent-green: #10b981;
52-
--light-accent-purple: #8b5cf6;
40+
--light-primary-bg: #0a0e27;
41+
--light-secondary-bg: #1a1f3a;
42+
--light-accent-bg: #2d3748;
43+
--light-card-bg: rgba(45, 55, 72, 0.9);
44+
--light-border-soft: rgba(100, 181, 246, 0.2);
45+
--light-border-medium: rgba(100, 181, 246, 0.4);
46+
--light-text-primary: #ffffff;
47+
--light-text-secondary: #e3f2fd;
48+
--light-text-muted: #90caf9;
49+
--light-accent-blue: #64b5f6;
50+
--light-accent-cyan: #4dd0e1;
51+
--light-accent-green: #81c784;
52+
--light-accent-purple: #ba68c8;
5353
}
5454
5555
/* Global app background and text */
@@ -2506,5 +2506,85 @@ def get_main_styles() -> str:
25062506
}
25072507
}
25082508
2509+
/* Additional sidebar styles for newer Streamlit versions */
2510+
/* Cover any new sidebar containers or data-testid selectors */
2511+
[data-testid="stSidebar"],
2512+
[data-testid="stSidebarNav"],
2513+
[data-testid="stSidebarNavItems"],
2514+
.stSidebar,
2515+
.sidebar,
2516+
.sidebar-content,
2517+
section[data-testid="stSidebar"] {
2518+
background: linear-gradient(180deg, #0d1117 0%, #161b22 50%, #21262d 100%) !important;
2519+
border-right: 2px solid var(--neon-cyan) !important;
2520+
box-shadow: 0 0 20px rgba(77, 208, 225, 0.3) !important;
2521+
color: var(--text-primary) !important;
2522+
}
2523+
2524+
/* Light mode override for new sidebar selectors */
2525+
@media (prefers-color-scheme: light) {
2526+
[data-testid="stSidebar"],
2527+
[data-testid="stSidebarNav"],
2528+
[data-testid="stSidebarNavItems"],
2529+
.stSidebar,
2530+
.sidebar,
2531+
.sidebar-content,
2532+
section[data-testid="stSidebar"] {
2533+
background: linear-gradient(180deg, #0d1117 0%, #161b22 50%, #21262d 100%) !important;
2534+
border-right: 2px solid var(--neon-cyan) !important;
2535+
box-shadow: 0 0 20px rgba(77, 208, 225, 0.3) !important;
2536+
color: var(--text-primary) !important;
2537+
}
2538+
}
2539+
2540+
/* Alternative light theme detection for new sidebar selectors */
2541+
[data-theme="light"] [data-testid="stSidebar"],
2542+
[data-theme="light"] [data-testid="stSidebarNav"],
2543+
[data-theme="light"] [data-testid="stSidebarNavItems"],
2544+
[data-theme="light"] .stSidebar,
2545+
[data-theme="light"] .sidebar,
2546+
[data-theme="light"] .sidebar-content,
2547+
[data-theme="light"] section[data-testid="stSidebar"] {
2548+
background: linear-gradient(180deg, #0d1117 0%, #161b22 50%, #21262d 100%) !important;
2549+
border-right: 2px solid var(--neon-cyan) !important;
2550+
box-shadow: 0 0 20px rgba(77, 208, 225, 0.3) !important;
2551+
color: var(--text-primary) !important;
2552+
}
2553+
2554+
/* Force all text in sidebar containers to use dark theme colors */
2555+
[data-testid="stSidebar"] *,
2556+
[data-testid="stSidebarNav"] *,
2557+
[data-testid="stSidebarNavItems"] *,
2558+
.stSidebar *,
2559+
.sidebar *,
2560+
.sidebar-content *,
2561+
section[data-testid="stSidebar"] * {
2562+
color: var(--text-primary) !important;
2563+
}
2564+
2565+
/* Light mode: Force all text in sidebar containers to use dark theme colors */
2566+
@media (prefers-color-scheme: light) {
2567+
[data-testid="stSidebar"] *,
2568+
[data-testid="stSidebarNav"] *,
2569+
[data-testid="stSidebarNavItems"] *,
2570+
.stSidebar *,
2571+
.sidebar *,
2572+
.sidebar-content *,
2573+
section[data-testid="stSidebar"] * {
2574+
color: var(--text-primary) !important;
2575+
}
2576+
}
2577+
2578+
/* Alternative light theme detection for sidebar text */
2579+
[data-theme="light"] [data-testid="stSidebar"] *,
2580+
[data-theme="light"] [data-testid="stSidebarNav"] *,
2581+
[data-theme="light"] [data-testid="stSidebarNavItems"] *,
2582+
[data-theme="light"] .stSidebar *,
2583+
[data-theme="light"] .sidebar *,
2584+
[data-theme="light"] .sidebar-content *,
2585+
[data-theme="light"] section[data-testid="stSidebar"] * {
2586+
color: var(--text-primary) !important;
2587+
}
2588+
25092589
</style>
25102590
"""

0 commit comments

Comments
 (0)