Center app, hide logo share button, flatten Settings inner cards
Browse files
app.py
CHANGED
|
@@ -129,11 +129,30 @@ html, body, gradio-app, [class*="gradio-container"] {
|
|
| 129 |
background: #f5f9ff !important;
|
| 130 |
}
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
[class*="gradio-container"] {
|
| 133 |
max-width: 1180px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
color: #0f2744;
|
| 135 |
}
|
| 136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
[class*="gradio-container"] *::selection { background: rgba(37,99,235,0.18); }
|
| 138 |
|
| 139 |
/* --- LEFT/RIGHT layout --- */
|
|
@@ -146,8 +165,7 @@ html, body, gradio-app, [class*="gradio-container"] {
|
|
| 146 |
.banner-logo-image,
|
| 147 |
.banner-logo-image .image-container,
|
| 148 |
.banner-logo-image .image-frame,
|
| 149 |
-
.banner-logo-image > div
|
| 150 |
-
.banner-logo-image button {
|
| 151 |
background: transparent !important;
|
| 152 |
border: none !important;
|
| 153 |
box-shadow: none !important;
|
|
@@ -162,6 +180,16 @@ html, body, gradio-app, [class*="gradio-container"] {
|
|
| 162 |
border: none !important;
|
| 163 |
box-shadow: none !important;
|
| 164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
/* --- SECTION CARDS --- */
|
| 167 |
/* `section-card` becomes a real white rounded card with soft blue shadow, no grey. */
|
|
@@ -259,16 +287,31 @@ html, body, gradio-app, [class*="gradio-container"] {
|
|
| 259 |
[class*="gradio-container"] .gr-panel,
|
| 260 |
[class*="gradio-container"] .form,
|
| 261 |
[class*="gradio-container"] .gr-form,
|
| 262 |
-
[class*="gradio-container"] .block,
|
| 263 |
-
[class*="gradio-container"] .wrap,
|
| 264 |
[class*="gradio-container"] .container {
|
| 265 |
background: transparent !important;
|
| 266 |
}
|
| 267 |
-
|
| 268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
background: transparent !important;
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
| 271 |
|
|
|
|
|
|
|
|
|
|
| 272 |
/* --- INPUTS / TEXTAREA --- */
|
| 273 |
[class*="gradio-container"] textarea,
|
| 274 |
[class*="gradio-container"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
|
|
@@ -787,6 +830,7 @@ with gr.Blocks(
|
|
| 787 |
interactive=False,
|
| 788 |
show_download_button=False,
|
| 789 |
show_fullscreen_button=False,
|
|
|
|
| 790 |
elem_classes="banner-logo-image",
|
| 791 |
)
|
| 792 |
|
|
|
|
| 129 |
background: #f5f9ff !important;
|
| 130 |
}
|
| 131 |
|
| 132 |
+
/* The Space iframe wraps Gradio in <gradio-app>; force it to center horizontally. */
|
| 133 |
+
gradio-app, gradio-app > .gradio-container, gradio-app > div {
|
| 134 |
+
display: block !important;
|
| 135 |
+
margin-left: auto !important;
|
| 136 |
+
margin-right: auto !important;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
[class*="gradio-container"] {
|
| 140 |
max-width: 1180px !important;
|
| 141 |
+
margin-left: auto !important;
|
| 142 |
+
margin-right: auto !important;
|
| 143 |
+
padding-left: 24px !important;
|
| 144 |
+
padding-right: 24px !important;
|
| 145 |
color: #0f2744;
|
| 146 |
}
|
| 147 |
|
| 148 |
+
/* Some Gradio builds wrap the app in `.main` or `.app`; center those too. */
|
| 149 |
+
[class*="gradio-container"] .main,
|
| 150 |
+
[class*="gradio-container"] .app,
|
| 151 |
+
[class*="gradio-container"] .contain {
|
| 152 |
+
margin-left: auto !important;
|
| 153 |
+
margin-right: auto !important;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
[class*="gradio-container"] *::selection { background: rgba(37,99,235,0.18); }
|
| 157 |
|
| 158 |
/* --- LEFT/RIGHT layout --- */
|
|
|
|
| 165 |
.banner-logo-image,
|
| 166 |
.banner-logo-image .image-container,
|
| 167 |
.banner-logo-image .image-frame,
|
| 168 |
+
.banner-logo-image > div {
|
|
|
|
| 169 |
background: transparent !important;
|
| 170 |
border: none !important;
|
| 171 |
box-shadow: none !important;
|
|
|
|
| 180 |
border: none !important;
|
| 181 |
box-shadow: none !important;
|
| 182 |
}
|
| 183 |
+
/* Strip any overlay buttons (share / download / fullscreen) that some Gradio builds
|
| 184 |
+
still inject on top of the image, even when their show_* flags are off. */
|
| 185 |
+
.banner-logo-image .icon-button-wrapper,
|
| 186 |
+
.banner-logo-image .source-selection,
|
| 187 |
+
.banner-logo-image button,
|
| 188 |
+
.banner-logo-image [aria-label*="hare" i],
|
| 189 |
+
.banner-logo-image [aria-label*="ownload" i],
|
| 190 |
+
.banner-logo-image [aria-label*="ullscreen" i] {
|
| 191 |
+
display: none !important;
|
| 192 |
+
}
|
| 193 |
|
| 194 |
/* --- SECTION CARDS --- */
|
| 195 |
/* `section-card` becomes a real white rounded card with soft blue shadow, no grey. */
|
|
|
|
| 287 |
[class*="gradio-container"] .gr-panel,
|
| 288 |
[class*="gradio-container"] .form,
|
| 289 |
[class*="gradio-container"] .gr-form,
|
|
|
|
|
|
|
| 290 |
[class*="gradio-container"] .container {
|
| 291 |
background: transparent !important;
|
| 292 |
}
|
| 293 |
+
|
| 294 |
+
/* Inside our white section-cards, the OUTER Gradio block of each component must
|
| 295 |
+
be flat — otherwise we get the "card inside card" double border on Settings. */
|
| 296 |
+
.section-card .block,
|
| 297 |
+
.section-card .form,
|
| 298 |
+
.section-card .gr-form,
|
| 299 |
+
.section-card .gr-block,
|
| 300 |
+
.section-card .gr-panel,
|
| 301 |
+
.section-card .gradio-dropdown,
|
| 302 |
+
.section-card .gradio-slider,
|
| 303 |
+
.section-card .gradio-textbox,
|
| 304 |
+
.section-card .gradio-markdown,
|
| 305 |
+
.section-card .gradio-code {
|
| 306 |
background: transparent !important;
|
| 307 |
+
border: none !important;
|
| 308 |
+
box-shadow: none !important;
|
| 309 |
+
padding: 0 !important;
|
| 310 |
}
|
| 311 |
|
| 312 |
+
/* Direct children of a card get vertical rhythm without extra chrome. */
|
| 313 |
+
.section-card > * + * { margin-top: 14px; }
|
| 314 |
+
|
| 315 |
/* --- INPUTS / TEXTAREA --- */
|
| 316 |
[class*="gradio-container"] textarea,
|
| 317 |
[class*="gradio-container"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
|
|
|
|
| 830 |
interactive=False,
|
| 831 |
show_download_button=False,
|
| 832 |
show_fullscreen_button=False,
|
| 833 |
+
show_share_button=False,
|
| 834 |
elem_classes="banner-logo-image",
|
| 835 |
)
|
| 836 |
|