MukulRay commited on
Commit
ff66c32
·
1 Parent(s): 3d55aee

Fix HF Spaces iframe rendering: drop sticky positioning and gradient text-clip

Browse files
Files changed (1) hide show
  1. demo/app.py +11 -19
demo/app.py CHANGED
@@ -142,7 +142,9 @@ body::before {
142
  box-shadow: none !important;
143
  }
144
 
145
- /* TOP BAR */
 
 
146
  .er-topbar {
147
  display: flex !important;
148
  align-items: center !important;
@@ -152,11 +154,9 @@ body::before {
152
  margin: 0 0 16px !important;
153
  border-bottom: 1px solid var(--border) !important;
154
  flex-wrap: nowrap !important;
155
- position: sticky;
156
- top: 0;
157
  z-index: 100;
158
- backdrop-filter: blur(14px) saturate(140%);
159
- background: linear-gradient(180deg, rgba(10,12,16,0.94) 0%, rgba(10,12,16,0.80) 100%);
160
  height: 64px;
161
  width: 100% !important;
162
  max-width: 100% !important;
@@ -454,19 +454,13 @@ body::before {
454
  box-sizing: border-box !important;
455
  }
456
 
457
- /* CONTEXT COLUMN — sticky to the top so it stays visible while the chat
458
- column flows. max-height + overflow-y on the column body lets the
459
- diagnostics accordion scroll independently inside it. */
460
  .gradio-container .er-context-col {
461
- position: sticky !important;
462
- top: 84px !important; /* below sticky topbar */
463
  align-self: start !important;
464
- max-height: calc(100vh - 100px) !important;
465
- overflow-y: auto !important;
466
- overflow-x: hidden !important;
467
  padding: 0 6px 16px 24px !important;
468
  border-left: 1px solid var(--border) !important;
469
- scrollbar-gutter: stable;
470
  }
471
 
472
  /* HERO (empty state). Compact so it fits the viewport */
@@ -480,11 +474,9 @@ body::before {
480
  letter-spacing: -0.024em;
481
  margin: 0 0 8px;
482
  line-height: 1.2;
483
- background: linear-gradient(180deg, #f3f7fc 0%, #b6c2d2 100%);
484
- -webkit-background-clip: text;
485
- background-clip: text;
486
- -webkit-text-fill-color: transparent;
487
- color: transparent;
488
  }
489
  .er-hero p {
490
  color: var(--text-muted);
 
142
  box-shadow: none !important;
143
  }
144
 
145
+ /* TOP BAR — uses position:relative (not sticky) so it renders inside the
146
+ HF Spaces iframe, where there is no scroll container for sticky to attach
147
+ to. Solid background so brand text is always legible. */
148
  .er-topbar {
149
  display: flex !important;
150
  align-items: center !important;
 
154
  margin: 0 0 16px !important;
155
  border-bottom: 1px solid var(--border) !important;
156
  flex-wrap: nowrap !important;
157
+ position: relative;
 
158
  z-index: 100;
159
+ background: var(--bg);
 
160
  height: 64px;
161
  width: 100% !important;
162
  max-width: 100% !important;
 
454
  box-sizing: border-box !important;
455
  }
456
 
457
+ /* CONTEXT COLUMN — natural document flow so it renders correctly inside
458
+ the HF Spaces iframe. Sticky positioning needs a scroll-container
459
+ ancestor that the iframe document does not provide. */
460
  .gradio-container .er-context-col {
 
 
461
  align-self: start !important;
 
 
 
462
  padding: 0 6px 16px 24px !important;
463
  border-left: 1px solid var(--border) !important;
 
464
  }
465
 
466
  /* HERO (empty state). Compact so it fits the viewport */
 
474
  letter-spacing: -0.024em;
475
  margin: 0 0 8px;
476
  line-height: 1.2;
477
+ /* Solid color instead of gradient text-clip the latter renders fully
478
+ transparent in HF Spaces' iframe sandbox in some browsers. */
479
+ color: #f3f7fc;
 
 
480
  }
481
  .er-hero p {
482
  color: var(--text-muted);