prasadnu commited on
Commit
44b28ff
·
1 Parent(s): 1387441

sidebar fixed

Browse files
Files changed (1) hide show
  1. pages/Semantic_Search.py +21 -22
pages/Semantic_Search.py CHANGED
@@ -49,28 +49,27 @@ st.markdown("""
49
  }
50
  </style>
51
  """, unsafe_allow_html=True)
52
- # st.markdown("""
53
- # <style>
54
- # /* Fix the actual sidebar content container */
55
- # div[data-testid="stSidebarContent"] {
56
- # position: fixed;
57
- # top: 0;
58
- # left: 0;
59
- # height: 100vh;
60
- # width: 21rem; /* match your current sidebar width */
61
- # overflow-y: auto;
62
- # z-index: 100;
63
- # background-color: #0e1117;
64
- # border-right: 1px solid #333;
65
- # padding-top: 1rem;
66
- # }
67
-
68
- # /* Prevent main app content from being covered by fixed sidebar */
69
- # div[data-testid="stAppViewContainer"] > div:nth-child(1) {
70
- # margin-left: 21rem; /* same width as the fixed sidebar */
71
- # }
72
- # </style>
73
- # """, unsafe_allow_html=True)
74
 
75
  #ps = PorterStemmer()
76
 
 
49
  }
50
  </style>
51
  """, unsafe_allow_html=True)
52
+ st.markdown("""
53
+ <style>
54
+ /* Fix the entire sidebar so it stays when main content scrolls */
55
+ section[data-testid="stSidebar"] {
56
+ position: fixed;
57
+ top: 0;
58
+ left: 0;
59
+ height: 100vh;
60
+ overflow-y: auto;
61
+ z-index: 100;
62
+ background-color: #f0f2f6; /* or your theme's sidebar color */
63
+ padding-top: 1rem;
64
+ }
65
+
66
+ /* Prevent main content from hiding behind sidebar */
67
+ div[data-testid="stAppViewContainer"] > div:first-child {
68
+ margin-left: 21rem; /* Match actual sidebar width */
69
+ }
70
+ </style>
71
+ """, unsafe_allow_html=True)
72
+
 
73
 
74
  #ps = PorterStemmer()
75