prasadnu commited on
Commit
6b5417f
·
1 Parent(s): 14112d2

sidebar fixed

Browse files
Files changed (1) hide show
  1. pages/Semantic_Search.py +7 -3
pages/Semantic_Search.py CHANGED
@@ -51,19 +51,23 @@ st.markdown("""
51
  """, unsafe_allow_html=True)
52
  st.markdown("""
53
  <style>
54
- section[data-testid="stSidebar"] {
 
55
  position: fixed;
56
  top: 0;
57
  left: 0;
58
  height: 100vh;
 
59
  overflow-y: auto;
60
  z-index: 100;
61
  background-color: #0e1117;
62
  border-right: 1px solid #333;
 
63
  }
64
 
65
- div[data-testid="stAppViewContainer"] > div:first-child {
66
- margin-left: 320px; /* Adjust to match your sidebar width */
 
67
  }
68
  </style>
69
  """, unsafe_allow_html=True)
 
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)