Spaces:
Sleeping
Sleeping
Darkmode Override Fix
Browse filesIt appears the text box coloring issue may be a result of the dark mode system overriding the display. Redundant CSS and overridden code have been pruned in favor of a light mode override.
app.py
CHANGED
|
@@ -317,66 +317,39 @@ custom_css = """
|
|
| 317 |
/* Import Oswald font - Google Fonts */
|
| 318 |
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
|
| 319 |
|
| 320 |
-
/*
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
font-style: normal;
|
| 326 |
-
}
|
| 327 |
-
.oswald-regular {
|
| 328 |
-
font-family: "Oswald", sans-serif;
|
| 329 |
-
font-optical-sizing: auto;
|
| 330 |
-
font-weight: 400;
|
| 331 |
-
font-style: normal;
|
| 332 |
-
}
|
| 333 |
-
.oswald-medium {
|
| 334 |
-
font-family: "Oswald", sans-serif;
|
| 335 |
-
font-optical-sizing: auto;
|
| 336 |
-
font-weight: 500;
|
| 337 |
-
font-style: normal;
|
| 338 |
-
}
|
| 339 |
-
.oswald-semibold {
|
| 340 |
-
font-family: "Oswald", sans-serif;
|
| 341 |
-
font-optical-sizing: auto;
|
| 342 |
-
font-weight: 600;
|
| 343 |
-
font-style: normal;
|
| 344 |
}
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
|
|
|
|
|
|
| 350 |
}
|
| 351 |
|
| 352 |
-
/* Main container styling
|
| 353 |
.gradio-container-5-42-0 {
|
| 354 |
background-color: rgb(240, 236, 230) !important;
|
| 355 |
font-family: "Oswald", sans-serif !important;
|
| 356 |
-
font-optical-sizing: auto !important;
|
| 357 |
-
font-weight: 400 !important;
|
| 358 |
-
font-style: normal !important;
|
| 359 |
color: #120f0e !important;
|
| 360 |
padding-top: 0 !important;
|
| 361 |
margin-top: 0 !important;
|
| 362 |
}
|
| 363 |
|
| 364 |
-
/* Apply Oswald
|
| 365 |
*, *::before, *::after {
|
| 366 |
font-family: "Oswald", sans-serif !important;
|
| 367 |
-
font-optical-sizing: auto !important;
|
| 368 |
color: #120f0e !important;
|
| 369 |
}
|
| 370 |
|
| 371 |
-
/*
|
| 372 |
-
body {
|
| 373 |
-
margin: 0 !important;
|
| 374 |
-
padding: 0 !important;
|
| 375 |
-
}
|
| 376 |
-
|
| 377 |
-
/* Title styling - minimize top spacing */
|
| 378 |
.title-header {
|
| 379 |
-
background-color: rgb(240, 236, 230);
|
| 380 |
padding: 5px 20px 10px 20px;
|
| 381 |
margin: 0;
|
| 382 |
border-bottom: 1pt solid #59524f;
|
|
@@ -388,101 +361,49 @@ body {
|
|
| 388 |
color: #120f0e !important;
|
| 389 |
margin: 0;
|
| 390 |
padding: 0;
|
| 391 |
-
font-family: "Oswald", sans-serif !important;
|
| 392 |
}
|
| 393 |
|
| 394 |
-
/* Chat container */
|
| 395 |
-
.chat-container
|
| 396 |
-
min-height: 900px;
|
| 397 |
-
background-color: #d9d1ce !important;
|
| 398 |
-
border: 1pt solid #59524f !important;
|
| 399 |
-
border-radius: 6px;
|
| 400 |
-
padding: 20px;
|
| 401 |
-
}
|
| 402 |
-
|
| 403 |
-
/* Force chatbot background with highest specificity */
|
| 404 |
.gradio-container-5-42-0 .gradio-chatbot,
|
| 405 |
-
.gradio-container-5-42-0
|
| 406 |
-
.gradio-container-5-42-0 div[data-testid="chatbot"],
|
| 407 |
.gradio-container-5-42-0 .gradio-chatbot > div,
|
| 408 |
.gradio-container-5-42-0 .gradio-chatbot .scroll-hide,
|
| 409 |
-
.gradio-container-5-42-0 .gradio-chatbot .overflow-y-auto
|
| 410 |
-
.gradio-container-5-42-0 #main-chatbot,
|
| 411 |
-
.gradio-container-5-42-0 [data-testid="chatbot"] {
|
| 412 |
background-color: #d9d1ce !important;
|
| 413 |
border: 1pt solid #59524f !important;
|
| 414 |
border-radius: 6px !important;
|
| 415 |
padding: 20px !important;
|
| 416 |
-
|
| 417 |
-
}
|
| 418 |
-
|
| 419 |
-
/* Target all nested chatbot divs */
|
| 420 |
-
.gradio-container-5-42-0 .gradio-chatbot > div > div,
|
| 421 |
-
.gradio-container-5-42-0 .gradio-chatbot > div > div > div {
|
| 422 |
-
background-color: #d9d1ce !important;
|
| 423 |
-
}
|
| 424 |
-
|
| 425 |
-
/* Force inheritance on all chatbot children */
|
| 426 |
-
.gradio-container-5-42-0 .gradio-chatbot * {
|
| 427 |
-
background-color: inherit !important;
|
| 428 |
}
|
| 429 |
|
| 430 |
-
/* Message styling
|
| 431 |
.gradio-container-5-42-0 .gradio-chatbot .message.bot .markdown {
|
| 432 |
background-color: #f09c7d !important;
|
| 433 |
color: #120f0e !important;
|
| 434 |
border-radius: 8px !important;
|
| 435 |
padding: 12px 16px !important;
|
| 436 |
-
box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
|
| 437 |
border: 1pt solid #59524f !important;
|
| 438 |
max-width: 70%;
|
| 439 |
margin-left: 0;
|
| 440 |
margin-right: auto;
|
| 441 |
word-wrap: break-word;
|
| 442 |
-
font-family: "Oswald", sans-serif !important;
|
| 443 |
font-weight: 400 !important;
|
| 444 |
}
|
| 445 |
|
| 446 |
-
/* User messages same as clear button color */
|
| 447 |
.gradio-container-5-42-0 .gradio-chatbot .message.user .markdown {
|
| 448 |
background-color: #ada3a0 !important;
|
| 449 |
color: #120f0e !important;
|
| 450 |
border-radius: 8px !important;
|
| 451 |
padding: 12px 16px !important;
|
| 452 |
-
box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
|
| 453 |
border: 1pt solid #59524f !important;
|
| 454 |
max-width: 70%;
|
| 455 |
margin-left: auto;
|
| 456 |
margin-right: 0;
|
| 457 |
word-wrap: break-word;
|
| 458 |
-
font-family: "Oswald", sans-serif !important;
|
| 459 |
font-weight: 400 !important;
|
| 460 |
}
|
| 461 |
|
| 462 |
-
/* Apply Oswald to all markdown content */
|
| 463 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown p,
|
| 464 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h1,
|
| 465 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h2,
|
| 466 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h3,
|
| 467 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h4,
|
| 468 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h5,
|
| 469 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown h6,
|
| 470 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown ul,
|
| 471 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown ol,
|
| 472 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown li,
|
| 473 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown strong,
|
| 474 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown em,
|
| 475 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown code {
|
| 476 |
-
font-family: "Oswald", sans-serif !important;
|
| 477 |
-
color: #120f0e !important;
|
| 478 |
-
}
|
| 479 |
-
|
| 480 |
-
/* Mode indicators with Oswald */
|
| 481 |
-
.gradio-container-5-42-0 .gradio-chatbot .markdown strong {
|
| 482 |
-
font-weight: 600 !important;
|
| 483 |
-
color: #120f0e !important;
|
| 484 |
-
}
|
| 485 |
-
|
| 486 |
/* Hide avatars */
|
| 487 |
.gradio-container-5-42-0 .gradio-chatbot .avatar-container {
|
| 488 |
display: none !important;
|
|
@@ -490,47 +411,35 @@ body {
|
|
| 490 |
|
| 491 |
/* Input section styling */
|
| 492 |
.input-section {
|
| 493 |
-
background-color: rgb(240, 236, 230);
|
| 494 |
border-top: 1pt solid #59524f;
|
| 495 |
padding: 20px;
|
| 496 |
}
|
| 497 |
|
| 498 |
-
/* Button styling
|
| 499 |
-
.gradio-container-5-42-0 .
|
| 500 |
-
background-color: #
|
| 501 |
color: #120f0e !important;
|
| 502 |
border: 1pt solid #59524f !important;
|
| 503 |
border-radius: 6px !important;
|
| 504 |
padding: 8px 16px !important;
|
| 505 |
cursor: pointer !important;
|
| 506 |
margin: 5px !important;
|
| 507 |
-
font-family: "Oswald", sans-serif !important;
|
| 508 |
font-weight: 500 !important;
|
| 509 |
-
font-optical-sizing: auto !important;
|
| 510 |
}
|
| 511 |
|
| 512 |
-
.gradio-container-5-42-0 .clear-button
|
| 513 |
-
background-color:
|
| 514 |
-
}
|
| 515 |
-
|
| 516 |
-
.gradio-container-5-42-0 .send-button {
|
| 517 |
-
background-color: #f09c7d !important;
|
| 518 |
color: #120f0e !important;
|
| 519 |
border: 1pt solid #59524f !important;
|
| 520 |
border-radius: 6px !important;
|
| 521 |
padding: 8px 16px !important;
|
| 522 |
cursor: pointer !important;
|
| 523 |
margin: 5px !important;
|
| 524 |
-
font-family: "Oswald", sans-serif !important;
|
| 525 |
font-weight: 500 !important;
|
| 526 |
-
font-optical-sizing: auto !important;
|
| 527 |
}
|
| 528 |
|
| 529 |
-
|
| 530 |
-
background-color: rgba(240, 156, 125, 0.8) !important;
|
| 531 |
-
}
|
| 532 |
-
|
| 533 |
-
/* Textbox styling with chat history color */
|
| 534 |
.gradio-container-5-42-0 .input-textbox {
|
| 535 |
background-color: #d9d1ce !important;
|
| 536 |
border: 1pt solid #59524f !important;
|
|
@@ -543,26 +452,13 @@ body {
|
|
| 543 |
color: #120f0e !important;
|
| 544 |
padding: 15px !important;
|
| 545 |
font-size: 16px !important;
|
| 546 |
-
font-family: "Oswald", sans-serif !important;
|
| 547 |
font-weight: 400 !important;
|
| 548 |
-
font-optical-sizing: auto !important;
|
| 549 |
}
|
| 550 |
|
| 551 |
.gradio-container-5-42-0 .input-textbox textarea::placeholder {
|
| 552 |
-
font-family: "Oswald", sans-serif !important;
|
| 553 |
font-weight: 300 !important;
|
| 554 |
color: rgba(18, 15, 14, 0.6) !important;
|
| 555 |
}
|
| 556 |
-
|
| 557 |
-
/* Ensure all input elements use Oswald and new colors */
|
| 558 |
-
.gradio-container-5-42-0 input,
|
| 559 |
-
.gradio-container-5-42-0 textarea,
|
| 560 |
-
.gradio-container-5-42-0 button,
|
| 561 |
-
.gradio-container-5-42-0 select {
|
| 562 |
-
font-family: "Oswald", sans-serif !important;
|
| 563 |
-
font-optical-sizing: auto !important;
|
| 564 |
-
color: #120f0e !important;
|
| 565 |
-
}
|
| 566 |
"""
|
| 567 |
|
| 568 |
# --- UI: HTML Head Content ---
|
|
@@ -647,7 +543,8 @@ def create_interface():
|
|
| 647 |
height=880,
|
| 648 |
elem_classes=["chat-container"],
|
| 649 |
container=True,
|
| 650 |
-
elem_id="main-chatbot"
|
|
|
|
| 651 |
)
|
| 652 |
|
| 653 |
# Row 3: Input Section
|
|
|
|
| 317 |
/* Import Oswald font - Google Fonts */
|
| 318 |
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
|
| 319 |
|
| 320 |
+
/* Force light mode */
|
| 321 |
+
@media (prefers-color-scheme: dark) {
|
| 322 |
+
.gradio-container-5-42-0 {
|
| 323 |
+
color-scheme: light !important;
|
| 324 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
}
|
| 326 |
+
|
| 327 |
+
html, body {
|
| 328 |
+
color-scheme: light !important;
|
| 329 |
+
background-color: rgb(240, 236, 230) !important;
|
| 330 |
+
margin: 0 !important;
|
| 331 |
+
padding: 0 !important;
|
| 332 |
+
color: #120f0e !important;
|
| 333 |
}
|
| 334 |
|
| 335 |
+
/* Main container styling */
|
| 336 |
.gradio-container-5-42-0 {
|
| 337 |
background-color: rgb(240, 236, 230) !important;
|
| 338 |
font-family: "Oswald", sans-serif !important;
|
|
|
|
|
|
|
|
|
|
| 339 |
color: #120f0e !important;
|
| 340 |
padding-top: 0 !important;
|
| 341 |
margin-top: 0 !important;
|
| 342 |
}
|
| 343 |
|
| 344 |
+
/* Apply Oswald globally */
|
| 345 |
*, *::before, *::after {
|
| 346 |
font-family: "Oswald", sans-serif !important;
|
|
|
|
| 347 |
color: #120f0e !important;
|
| 348 |
}
|
| 349 |
|
| 350 |
+
/* Title styling */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
.title-header {
|
| 352 |
+
background-color: rgb(240, 236, 230) !important;
|
| 353 |
padding: 5px 20px 10px 20px;
|
| 354 |
margin: 0;
|
| 355 |
border-bottom: 1pt solid #59524f;
|
|
|
|
| 361 |
color: #120f0e !important;
|
| 362 |
margin: 0;
|
| 363 |
padding: 0;
|
|
|
|
| 364 |
}
|
| 365 |
|
| 366 |
+
/* Chat container and chatbot styling */
|
| 367 |
+
.chat-container,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
.gradio-container-5-42-0 .gradio-chatbot,
|
| 369 |
+
.gradio-container-5-42-0 #main-chatbot,
|
|
|
|
| 370 |
.gradio-container-5-42-0 .gradio-chatbot > div,
|
| 371 |
.gradio-container-5-42-0 .gradio-chatbot .scroll-hide,
|
| 372 |
+
.gradio-container-5-42-0 .gradio-chatbot .overflow-y-auto {
|
|
|
|
|
|
|
| 373 |
background-color: #d9d1ce !important;
|
| 374 |
border: 1pt solid #59524f !important;
|
| 375 |
border-radius: 6px !important;
|
| 376 |
padding: 20px !important;
|
| 377 |
+
min-height: 900px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
}
|
| 379 |
|
| 380 |
+
/* Message styling */
|
| 381 |
.gradio-container-5-42-0 .gradio-chatbot .message.bot .markdown {
|
| 382 |
background-color: #f09c7d !important;
|
| 383 |
color: #120f0e !important;
|
| 384 |
border-radius: 8px !important;
|
| 385 |
padding: 12px 16px !important;
|
|
|
|
| 386 |
border: 1pt solid #59524f !important;
|
| 387 |
max-width: 70%;
|
| 388 |
margin-left: 0;
|
| 389 |
margin-right: auto;
|
| 390 |
word-wrap: break-word;
|
|
|
|
| 391 |
font-weight: 400 !important;
|
| 392 |
}
|
| 393 |
|
|
|
|
| 394 |
.gradio-container-5-42-0 .gradio-chatbot .message.user .markdown {
|
| 395 |
background-color: #ada3a0 !important;
|
| 396 |
color: #120f0e !important;
|
| 397 |
border-radius: 8px !important;
|
| 398 |
padding: 12px 16px !important;
|
|
|
|
| 399 |
border: 1pt solid #59524f !important;
|
| 400 |
max-width: 70%;
|
| 401 |
margin-left: auto;
|
| 402 |
margin-right: 0;
|
| 403 |
word-wrap: break-word;
|
|
|
|
| 404 |
font-weight: 400 !important;
|
| 405 |
}
|
| 406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
/* Hide avatars */
|
| 408 |
.gradio-container-5-42-0 .gradio-chatbot .avatar-container {
|
| 409 |
display: none !important;
|
|
|
|
| 411 |
|
| 412 |
/* Input section styling */
|
| 413 |
.input-section {
|
| 414 |
+
background-color: rgb(240, 236, 230) !important;
|
| 415 |
border-top: 1pt solid #59524f;
|
| 416 |
padding: 20px;
|
| 417 |
}
|
| 418 |
|
| 419 |
+
/* Button styling */
|
| 420 |
+
.gradio-container-5-42-0 .send-button {
|
| 421 |
+
background-color: #f09c7d !important;
|
| 422 |
color: #120f0e !important;
|
| 423 |
border: 1pt solid #59524f !important;
|
| 424 |
border-radius: 6px !important;
|
| 425 |
padding: 8px 16px !important;
|
| 426 |
cursor: pointer !important;
|
| 427 |
margin: 5px !important;
|
|
|
|
| 428 |
font-weight: 500 !important;
|
|
|
|
| 429 |
}
|
| 430 |
|
| 431 |
+
.gradio-container-5-42-0 .clear-button {
|
| 432 |
+
background-color: #ada3a0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
color: #120f0e !important;
|
| 434 |
border: 1pt solid #59524f !important;
|
| 435 |
border-radius: 6px !important;
|
| 436 |
padding: 8px 16px !important;
|
| 437 |
cursor: pointer !important;
|
| 438 |
margin: 5px !important;
|
|
|
|
| 439 |
font-weight: 500 !important;
|
|
|
|
| 440 |
}
|
| 441 |
|
| 442 |
+
/* Textbox styling */
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
.gradio-container-5-42-0 .input-textbox {
|
| 444 |
background-color: #d9d1ce !important;
|
| 445 |
border: 1pt solid #59524f !important;
|
|
|
|
| 452 |
color: #120f0e !important;
|
| 453 |
padding: 15px !important;
|
| 454 |
font-size: 16px !important;
|
|
|
|
| 455 |
font-weight: 400 !important;
|
|
|
|
| 456 |
}
|
| 457 |
|
| 458 |
.gradio-container-5-42-0 .input-textbox textarea::placeholder {
|
|
|
|
| 459 |
font-weight: 300 !important;
|
| 460 |
color: rgba(18, 15, 14, 0.6) !important;
|
| 461 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
"""
|
| 463 |
|
| 464 |
# --- UI: HTML Head Content ---
|
|
|
|
| 543 |
height=880,
|
| 544 |
elem_classes=["chat-container"],
|
| 545 |
container=True,
|
| 546 |
+
elem_id="main-chatbot",
|
| 547 |
+
elem_style={"background-color": "#d9d1ce", "border": "1pt solid #59524f"}
|
| 548 |
)
|
| 549 |
|
| 550 |
# Row 3: Input Section
|