Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,14 @@ CSS = """:root{
|
|
| 49 |
--muted:#4b5a58;
|
| 50 |
--border: rgba(11,27,25,0.15);
|
| 51 |
}
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
/* Page background */
|
| 55 |
html, body, .gradio-container{
|
|
@@ -303,6 +310,15 @@ a{ color:var(--primary-700)!important; }
|
|
| 303 |
--primary-200:#2a3b38;
|
| 304 |
}
|
| 305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
html, body, .gradio-container{
|
| 307 |
background: var(--page-bg) !important;
|
| 308 |
color: var(--text) !important;
|
|
@@ -352,6 +368,72 @@ a{ color:var(--primary-700)!important; }
|
|
| 352 |
border-color: var(--primary-600) !important;
|
| 353 |
color: var(--text) !important;
|
| 354 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
}
|
| 356 |
"""
|
| 357 |
|
|
@@ -657,7 +739,7 @@ with gr.Blocks(theme=theme, css=CSS, title="Marka") as demo:
|
|
| 657 |
"Skriv ein setning í kassan og fá hann markaðan.\n\n"
|
| 658 |
f"Myndil / Model: [{MODEL_ID}]({MODEL_LINK})"
|
| 659 |
)
|
| 660 |
-
btn = gr.Button("Marka / Tag", variant="primary")
|
| 661 |
|
| 662 |
state = gr.State([])
|
| 663 |
lang_state = gr.State("fo")
|
|
|
|
| 49 |
--muted:#4b5a58;
|
| 50 |
--border: rgba(11,27,25,0.15);
|
| 51 |
}
|
| 52 |
+
#btn_tag{
|
| 53 |
+
background: var(--primary-500) !important;
|
| 54 |
+
border-color: var(--primary-600) !important;
|
| 55 |
+
color:#0b1b19 !important;
|
| 56 |
+
}
|
| 57 |
+
#btn_tag:hover{
|
| 58 |
+
background: var(--primary-600) !important;
|
| 59 |
+
}
|
| 60 |
|
| 61 |
/* Page background */
|
| 62 |
html, body, .gradio-container{
|
|
|
|
| 310 |
--primary-200:#2a3b38;
|
| 311 |
}
|
| 312 |
|
| 313 |
+
#btn_tag{
|
| 314 |
+
background: var(--primary-500) !important;
|
| 315 |
+
border-color: var(--primary-600) !important;
|
| 316 |
+
color:#0b1b19 !important;
|
| 317 |
+
}
|
| 318 |
+
#btn_tag:hover{
|
| 319 |
+
background: var(--primary-600) !important;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
html, body, .gradio-container{
|
| 323 |
background: var(--page-bg) !important;
|
| 324 |
color: var(--text) !important;
|
|
|
|
| 368 |
border-color: var(--primary-600) !important;
|
| 369 |
color: var(--text) !important;
|
| 370 |
}
|
| 371 |
+
/* ---------- DARK MODE PATCH: fix Gradio component internals ---------- */
|
| 372 |
+
|
| 373 |
+
/* Headings / markdown titles (your “Úrslit”, accordion titles, etc.) */
|
| 374 |
+
.prose h1, .prose h2, .prose h3, .prose h4, .prose strong,
|
| 375 |
+
.gr-markdown h1, .gr-markdown h2, .gr-markdown h3, .gr-markdown h4,
|
| 376 |
+
.gr-markdown, .markdown, .prose {
|
| 377 |
+
color: var(--text) !important;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
/* Accordion header/button text */
|
| 381 |
+
.gr-accordion summary,
|
| 382 |
+
.gr-accordion summary span,
|
| 383 |
+
.gr-accordion label,
|
| 384 |
+
.gr-accordion button {
|
| 385 |
+
color: var(--text) !important;
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
/* Make accordion header background readable */
|
| 389 |
+
.gr-accordion summary {
|
| 390 |
+
background: var(--panel-bg) !important;
|
| 391 |
+
border: 1px solid var(--border) !important;
|
| 392 |
+
border-radius: 10px !important;
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
/* Dataframe wrapper + all nested table bits */
|
| 396 |
+
.gr-dataframe,
|
| 397 |
+
.gr-dataframe .wrap,
|
| 398 |
+
.gr-dataframe .table-wrap,
|
| 399 |
+
.gr-dataframe table,
|
| 400 |
+
.gr-dataframe thead,
|
| 401 |
+
.gr-dataframe tbody,
|
| 402 |
+
.gr-dataframe tr,
|
| 403 |
+
.gr-dataframe th,
|
| 404 |
+
.gr-dataframe td {
|
| 405 |
+
background: var(--panel-bg) !important;
|
| 406 |
+
color: var(--text) !important;
|
| 407 |
+
border-color: var(--border) !important;
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
/* Fix links inside markdown in dark mode */
|
| 411 |
+
.gr-markdown a, .prose a {
|
| 412 |
+
color: var(--primary-500) !important;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
/* Make inputs/selects/buttons inherit dark text properly */
|
| 416 |
+
input, textarea, select {
|
| 417 |
+
color: var(--text) !important;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
/* FORCE your green primary button (Marka/Tag) even if Gradio theme fights back */
|
| 421 |
+
button.primary,
|
| 422 |
+
.gr-button-primary,
|
| 423 |
+
.gr-button.gr-button-primary,
|
| 424 |
+
button[data-testid="button"],
|
| 425 |
+
button:has(span:contains("Marka")),
|
| 426 |
+
button:has(span:contains("Tag")) {
|
| 427 |
+
background: var(--primary-500) !important;
|
| 428 |
+
border-color: var(--primary-600) !important;
|
| 429 |
+
color: #0b1b19 !important;
|
| 430 |
+
}
|
| 431 |
+
button.primary:hover,
|
| 432 |
+
.gr-button-primary:hover,
|
| 433 |
+
.gr-button.gr-button-primary:hover {
|
| 434 |
+
background: var(--primary-600) !important;
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
}
|
| 438 |
"""
|
| 439 |
|
|
|
|
| 739 |
"Skriv ein setning í kassan og fá hann markaðan.\n\n"
|
| 740 |
f"Myndil / Model: [{MODEL_ID}]({MODEL_LINK})"
|
| 741 |
)
|
| 742 |
+
btn = gr.Button("Marka / Tag", variant="primary", elem_id="btn_tag")
|
| 743 |
|
| 744 |
state = gr.State([])
|
| 745 |
lang_state = gr.State("fo")
|