prasadnu commited on
Commit
4f357a2
·
1 Parent(s): df6a2d0

sidebar fixed

Browse files
Files changed (1) hide show
  1. pages/Semantic_Search.py +21 -8
pages/Semantic_Search.py CHANGED
@@ -51,21 +51,34 @@ st.markdown("""
51
  """, unsafe_allow_html=True)
52
  st.markdown("""
53
  <style>
54
- /* Make the sidebar sticky */
55
- [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: #0e1117; /* optional: match your theme */
63
- border-right: 1px solid #333; /* optional for separation */
64
  }
65
 
66
- /* Adjust the main content so it doesn't go under the fixed sidebar */
67
- [data-testid="stAppViewContainer"] > .main {
68
- margin-left: 16rem; /* adjust width to match sidebar size */
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
  </style>
71
  """, unsafe_allow_html=True)
 
51
  """, unsafe_allow_html=True)
52
  st.markdown("""
53
  <style>
54
+ /* Make sidebar fixed */
55
+ section[data-testid="stSidebar"] {
56
  position: fixed;
57
  top: 0;
58
  left: 0;
59
  height: 100vh;
60
  overflow-y: auto;
61
+ z-index: 999;
62
+ background-color: #0e1117;
63
+ border-right: 1px solid #333;
64
  }
65
 
66
+ /* Prevent main content from being hidden behind fixed sidebar */
67
+ div[data-testid="stAppViewContainer"] > div:nth-child(1) {
68
+ margin-left: 16rem; /* Adjust if your sidebar is wider */
69
+ }
70
+
71
+ /* Optional: keep header pinned too */
72
+ header[data-testid="stHeader"] {
73
+ position: fixed;
74
+ top: 0;
75
+ width: 100%;
76
+ z-index: 998;
77
+ }
78
+
79
+ /* Compensate top spacing for header if fixed */
80
+ .main {
81
+ padding-top: 4rem;
82
  }
83
  </style>
84
  """, unsafe_allow_html=True)