Bhuvi13 commited on
Commit
ffffda8
·
verified ·
1 Parent(s): 860f611

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +26 -34
src/streamlit_app.py CHANGED
@@ -84,52 +84,44 @@ st.markdown("""
84
  box-shadow: 0 0 5px rgba(255, 75, 75, 0.5) !important;
85
  }
86
 
87
- /* left/right helper classes (still usable if you wrap content in html containers) */
88
- .left-scroll, .right-scroll {
89
- max-height: calc(100vh - 160px);
90
- overflow-y: auto;
91
- overflow-x: auto;
92
- padding: 8px;
93
- border: 1px solid #e6e6e6;
94
- border-radius: 6px;
95
- background: #ffffff;
96
  }
97
- .left-scroll canvas, .left-scroll img, .right-scroll canvas, .right-scroll img {
98
- max-width: 100% !important;
99
- height: auto !important;
100
- display: block;
 
 
 
101
  }
102
 
103
- /* Make column elements create independent scroll areas:
104
- - give them a fixed-ish max-height relative to viewport
105
- - force overflow-y: auto so they show their own scrollbar
106
- */
107
- div[data-testid="column"] {
108
- /* room for header + padding; tune the 140px to your UI if needed */
109
- max-height: calc(100vh - 140px) !important;
110
- overflow-y: auto !important;
111
- overflow-x: hidden !important;
112
- position: relative !important;
113
  }
114
 
115
- /* keep canvas/images from forcing expansion */
116
  div[data-testid="column"] img,
117
  div[data-testid="column"] canvas {
118
- max-width: 100% !important;
119
- height: auto !important;
120
- display: block !important;
121
  }
122
 
123
- /* Thin subtle scrollbars for WebKit */
124
  div[data-testid="column"]::-webkit-scrollbar { width: 10px; height: 10px; }
125
  div[data-testid="column"]::-webkit-scrollbar-thumb { border-radius: 8px; background-color: rgba(0,0,0,0.12); }
126
  div[data-testid="column"]::-webkit-scrollbar-track { background: transparent; }
127
-
128
- /* IMPORTANT: remove any rule that forcibly hides page scrollbars.
129
- If you previously set overflow: hidden on the main container it prevents children from scrolling properly.
130
- DO NOT set `overflow: hidden` on the top-level app container.
131
- */
132
- /* removed: [data-testid="stAppViewContainer"] > .main { overflow: hidden !important; height: 100vh !important; } */
133
  </style>
134
 
135
  """, unsafe_allow_html=True)
 
84
  box-shadow: 0 0 5px rgba(255, 75, 75, 0.5) !important;
85
  }
86
 
87
+ /* Make sure the top-level containers allow children to create scroll contexts */
88
+ html, body, #root, #root>div, [data-testid="stAppViewContainer"], .block-container, .css-1lcbmhc, .main {
89
+ overflow: visible !important;
90
+ height: auto !important;
91
+ min-height: 100vh !important;
 
 
 
 
92
  }
93
+
94
+ /* Force the Streamlit app column elements to be scrollable */
95
+ div[data-testid="column"], .stColumns, .stContainer {
96
+ max-height: calc(100vh - 160px) !important;
97
+ overflow-y: auto !important;
98
+ overflow-x: hidden !important;
99
+ position: relative !important;
100
  }
101
 
102
+ /* small helper scroll classes (if you wrap with these) */
103
+ .left-scroll, .right-scroll {
104
+ max-height: calc(100vh - 160px);
105
+ overflow-y: auto;
106
+ overflow-x: auto;
107
+ padding: 8px;
108
+ border: 1px solid #e6e6e6;
109
+ border-radius: 6px;
110
+ background: #ffffff;
 
111
  }
112
 
113
+ /* make canvas/images not expand the column */
114
  div[data-testid="column"] img,
115
  div[data-testid="column"] canvas {
116
+ max-width: 100% !important;
117
+ height: auto !important;
118
+ display: block !important;
119
  }
120
 
121
+ /* subtle WebKit scrollbar */
122
  div[data-testid="column"]::-webkit-scrollbar { width: 10px; height: 10px; }
123
  div[data-testid="column"]::-webkit-scrollbar-thumb { border-radius: 8px; background-color: rgba(0,0,0,0.12); }
124
  div[data-testid="column"]::-webkit-scrollbar-track { background: transparent; }
 
 
 
 
 
 
125
  </style>
126
 
127
  """, unsafe_allow_html=True)