BrianIsaac commited on
Commit
04170f7
·
1 Parent(s): fd8bbd4

fix: constrain input-card height to match preview-card with scrolling enabled

Browse files

- Update flex property from '1' to '1 1 auto' for proper flex-basis
- Add max-height: 800px constraint matching preview-card
- Replace 'overflow: visible' with 'overflow-y: auto' and 'overflow-x: hidden'
- Add min-height: 0 to prevent flex child overflow
- Add box-sizing: border-box for consistent padding calculation
- Add matching custom scrollbar styling for webkit and Firefox browsers
- Ensures symmetric layout and consistent user experience between columns

Files changed (1) hide show
  1. app.py +31 -2
app.py CHANGED
@@ -1229,13 +1229,42 @@ def create_interface() -> gr.Blocks:
1229
  border-radius: 12px;
1230
  padding: 1.5rem;
1231
  margin-bottom: 0;
1232
- flex: 1 !important;
1233
  display: flex !important;
1234
  flex-direction: column !important;
1235
- overflow: visible !important;
 
 
 
 
1236
  gap: 0 !important;
1237
  }
1238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1239
  .examples-header {
1240
  margin-bottom: 0.75rem;
1241
  padding-top: 1.5rem;
 
1229
  border-radius: 12px;
1230
  padding: 1.5rem;
1231
  margin-bottom: 0;
1232
+ flex: 1 1 auto !important;
1233
  display: flex !important;
1234
  flex-direction: column !important;
1235
+ overflow-y: auto !important;
1236
+ overflow-x: hidden !important;
1237
+ max-height: 800px !important;
1238
+ min-height: 0;
1239
+ box-sizing: border-box !important;
1240
  gap: 0 !important;
1241
  }
1242
 
1243
+ /* Custom scrollbar for input card */
1244
+ .input-card::-webkit-scrollbar {
1245
+ width: 8px;
1246
+ }
1247
+
1248
+ .input-card::-webkit-scrollbar-track {
1249
+ background: rgba(255, 255, 255, 0.05);
1250
+ border-radius: 4px;
1251
+ }
1252
+
1253
+ .input-card::-webkit-scrollbar-thumb {
1254
+ background: rgba(4, 140, 252, 0.3);
1255
+ border-radius: 4px;
1256
+ }
1257
+
1258
+ .input-card::-webkit-scrollbar-thumb:hover {
1259
+ background: rgba(4, 140, 252, 0.5);
1260
+ }
1261
+
1262
+ /* Firefox scrollbar */
1263
+ .input-card {
1264
+ scrollbar-width: thin;
1265
+ scrollbar-color: rgba(4, 140, 252, 0.3) rgba(255, 255, 255, 0.05);
1266
+ }
1267
+
1268
  .examples-header {
1269
  margin-bottom: 0.75rem;
1270
  padding-top: 1.5rem;