@@ -392,11 +392,22 @@ section[data-testid="stSidebar"] {
392392 border-right : 1px solid rgba (59 , 130 , 246 , 0.15 ) !important ;
393393}
394394
395- /* Hide default streamlit nav items */
396- div [data-testid = "stSidebarNav" ] {
395+ /* Hide default streamlit nav CONTENT but keep container (to prevent toggle hiding) */
396+ div [data-testid = "stSidebarNav" ]> ul {
397397 display : none !important ;
398398}
399399
400+ div [data-testid = "stSidebarNav" ] {
401+ display : block !important ;
402+ /* Must be block for toggle to exist */
403+ visibility : visible !important ;
404+ height : 0 !important ;
405+ /* Collapse height */
406+ overflow : hidden !important ;
407+ margin : 0 !important ;
408+ padding : 0 !important ;
409+ }
410+
400411/* --- TOGGLE BUTTONS (The Fix) --- */
401412
402413/* 1. Collapse Button (Inside Sidebar) */
@@ -414,16 +425,20 @@ button[data-testid="stSidebarCollapseButton"]:hover {
414425 transform : scale (1.05 );
415426}
416427
417- /* 2. Expand Button (When Sidebar Collapsed) - Fix for Cloud */
418- [data-testid = "stSidebarCollapsedControl" ] {
428+ /* 2. Expand Button (When Sidebar Collapsed) - Support multiple selectors */
429+ [data-testid = "stSidebarCollapsedControl" ],
430+ [data-testid = "collapsedControl" ] {
419431 display : block !important ;
432+ visibility : visible !important ;
433+ opacity : 1 !important ;
420434 z-index : 1000000 !important ;
421435 position : fixed !important ;
422436 top : 15px !important ;
423437 left : 15px !important ;
424438}
425439
426- [data-testid = "stSidebarCollapsedControl" ] button {
440+ [data-testid = "stSidebarCollapsedControl" ] button ,
441+ [data-testid = "collapsedControl" ] button {
427442 background : linear-gradient (135deg , # 3B82F6, # 8B5CF6 ) !important ;
428443 color : white !important ;
429444 border : none !important ;
@@ -433,7 +448,8 @@ button[data-testid="stSidebarCollapseButton"]:hover {
433448 transition : all 0.2s ease;
434449}
435450
436- [data-testid = "stSidebarCollapsedControl" ] button : hover {
451+ [data-testid = "stSidebarCollapsedControl" ] button : hover ,
452+ [data-testid = "collapsedControl" ] button : hover {
437453 transform : scale (1.1 );
438454 box-shadow : 0 6px 16px rgba (59 , 130 , 246 , 0.6 ) !important ;
439455}
0 commit comments