fix: css issue
Browse files
app.py
CHANGED
|
@@ -611,7 +611,7 @@ def refresh_gallery_table():
|
|
| 611 |
return load_gallery_table()
|
| 612 |
|
| 613 |
|
| 614 |
-
# Enhanced CSS with
|
| 615 |
enhanced_css = """
|
| 616 |
/* Hide Gradio footer */
|
| 617 |
footer {visibility: hidden}
|
|
@@ -626,7 +626,7 @@ body {
|
|
| 626 |
max-height: 700px;
|
| 627 |
overflow-y: auto;
|
| 628 |
padding: 20px;
|
| 629 |
-
background-color: #f8f9fa;
|
| 630 |
}
|
| 631 |
|
| 632 |
/* Demo notice */
|
|
@@ -650,14 +650,15 @@ body {
|
|
| 650 |
opacity: 0.9;
|
| 651 |
}
|
| 652 |
|
| 653 |
-
/* Eval card styling */
|
| 654 |
.eval-card {
|
| 655 |
-
background: white;
|
|
|
|
| 656 |
border-radius: 12px;
|
| 657 |
padding: 25px;
|
| 658 |
margin-bottom: 25px;
|
| 659 |
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
| 660 |
-
border: 1px solid #e0e0e0;
|
| 661 |
transition: all 0.3s ease;
|
| 662 |
position: relative;
|
| 663 |
overflow: hidden;
|
|
@@ -689,7 +690,7 @@ body {
|
|
| 689 |
}
|
| 690 |
|
| 691 |
.card-title {
|
| 692 |
-
color: #1976d2;
|
| 693 |
margin: 0;
|
| 694 |
font-size: 1.4em;
|
| 695 |
font-weight: 600;
|
|
@@ -716,6 +717,7 @@ body {
|
|
| 716 |
margin: 0 0 15px 0;
|
| 717 |
line-height: 1.6;
|
| 718 |
font-size: 1.02em;
|
|
|
|
| 719 |
}
|
| 720 |
|
| 721 |
.card-meta {
|
|
@@ -728,19 +730,20 @@ body {
|
|
| 728 |
.card-meta p {
|
| 729 |
margin: 0;
|
| 730 |
padding: 8px 12px;
|
| 731 |
-
background: #f5f5f5;
|
|
|
|
| 732 |
border-radius: 6px;
|
| 733 |
font-size: 0.95em;
|
| 734 |
}
|
| 735 |
|
| 736 |
/* Coverage section */
|
| 737 |
.coverage-section {
|
| 738 |
-
border-top: 1px solid #e0e0e0;
|
| 739 |
padding-top: 20px;
|
| 740 |
}
|
| 741 |
|
| 742 |
.coverage-section h4 {
|
| 743 |
-
color: #1976d2;
|
| 744 |
margin: 0 0 15px 0;
|
| 745 |
font-size: 1.1em;
|
| 746 |
font-weight: 600;
|
|
@@ -761,12 +764,12 @@ body {
|
|
| 761 |
|
| 762 |
.coverage-label {
|
| 763 |
font-weight: 500;
|
| 764 |
-
color: #333;
|
| 765 |
font-size: 0.9em;
|
| 766 |
}
|
| 767 |
|
| 768 |
.coverage-bar {
|
| 769 |
-
background: #e0e0e0;
|
| 770 |
border-radius: 10px;
|
| 771 |
height: 8px;
|
| 772 |
overflow: hidden;
|
|
@@ -781,7 +784,7 @@ body {
|
|
| 781 |
|
| 782 |
.coverage-text {
|
| 783 |
font-size: 0.85em;
|
| 784 |
-
color: #666;
|
| 785 |
min-width: 100px;
|
| 786 |
text-align: right;
|
| 787 |
}
|
|
@@ -792,7 +795,7 @@ body {
|
|
| 792 |
display: flex;
|
| 793 |
gap: 12px;
|
| 794 |
flex-wrap: wrap;
|
| 795 |
-
border-top: 1px solid #e0e0e0;
|
| 796 |
padding-top: 15px;
|
| 797 |
}
|
| 798 |
|
|
@@ -801,7 +804,7 @@ body {
|
|
| 801 |
align-items: center;
|
| 802 |
padding: 8px 16px;
|
| 803 |
background: linear-gradient(135deg, #1976d2, #1565c0);
|
| 804 |
-
color: white;
|
| 805 |
text-decoration: none;
|
| 806 |
border-radius: 6px;
|
| 807 |
font-size: 0.9em;
|
|
@@ -813,7 +816,7 @@ body {
|
|
| 813 |
transform: translateY(-1px);
|
| 814 |
box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
|
| 815 |
text-decoration: none;
|
| 816 |
-
color: white;
|
| 817 |
}
|
| 818 |
|
| 819 |
/* Error styling */
|
|
@@ -821,15 +824,123 @@ body {
|
|
| 821 |
text-align: center;
|
| 822 |
padding: 40px;
|
| 823 |
color: #d32f2f;
|
| 824 |
-
background: #ffebee;
|
| 825 |
border-radius: 8px;
|
| 826 |
-
border: 1px solid #ffcdd2;
|
| 827 |
}
|
| 828 |
|
| 829 |
.error-message h3 {
|
| 830 |
margin: 0 0 15px 0;
|
| 831 |
}
|
| 832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 833 |
/* Responsive design */
|
| 834 |
@media (max-width: 768px) {
|
| 835 |
.gallery-container {
|
|
@@ -862,6 +973,52 @@ body {
|
|
| 862 |
grid-template-columns: 1fr;
|
| 863 |
}
|
| 864 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 865 |
"""
|
| 866 |
|
| 867 |
# Create the interface
|
|
|
|
| 611 |
return load_gallery_table()
|
| 612 |
|
| 613 |
|
| 614 |
+
# Enhanced CSS with dark mode support
|
| 615 |
enhanced_css = """
|
| 616 |
/* Hide Gradio footer */
|
| 617 |
footer {visibility: hidden}
|
|
|
|
| 626 |
max-height: 700px;
|
| 627 |
overflow-y: auto;
|
| 628 |
padding: 20px;
|
| 629 |
+
background-color: var(--background-fill-primary, #f8f9fa);
|
| 630 |
}
|
| 631 |
|
| 632 |
/* Demo notice */
|
|
|
|
| 650 |
opacity: 0.9;
|
| 651 |
}
|
| 652 |
|
| 653 |
+
/* Eval card styling - Light mode default */
|
| 654 |
.eval-card {
|
| 655 |
+
background: var(--background-fill-secondary, white);
|
| 656 |
+
color: var(--body-text-color, #374151);
|
| 657 |
border-radius: 12px;
|
| 658 |
padding: 25px;
|
| 659 |
margin-bottom: 25px;
|
| 660 |
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
| 661 |
+
border: 1px solid var(--border-color-primary, #e0e0e0);
|
| 662 |
transition: all 0.3s ease;
|
| 663 |
position: relative;
|
| 664 |
overflow: hidden;
|
|
|
|
| 690 |
}
|
| 691 |
|
| 692 |
.card-title {
|
| 693 |
+
color: var(--color-accent, #1976d2);
|
| 694 |
margin: 0;
|
| 695 |
font-size: 1.4em;
|
| 696 |
font-weight: 600;
|
|
|
|
| 717 |
margin: 0 0 15px 0;
|
| 718 |
line-height: 1.6;
|
| 719 |
font-size: 1.02em;
|
| 720 |
+
color: var(--body-text-color, #374151);
|
| 721 |
}
|
| 722 |
|
| 723 |
.card-meta {
|
|
|
|
| 730 |
.card-meta p {
|
| 731 |
margin: 0;
|
| 732 |
padding: 8px 12px;
|
| 733 |
+
background: var(--input-background-fill, #f5f5f5);
|
| 734 |
+
color: var(--body-text-color, #374151);
|
| 735 |
border-radius: 6px;
|
| 736 |
font-size: 0.95em;
|
| 737 |
}
|
| 738 |
|
| 739 |
/* Coverage section */
|
| 740 |
.coverage-section {
|
| 741 |
+
border-top: 1px solid var(--border-color-primary, #e0e0e0);
|
| 742 |
padding-top: 20px;
|
| 743 |
}
|
| 744 |
|
| 745 |
.coverage-section h4 {
|
| 746 |
+
color: var(--color-accent, #1976d2);
|
| 747 |
margin: 0 0 15px 0;
|
| 748 |
font-size: 1.1em;
|
| 749 |
font-weight: 600;
|
|
|
|
| 764 |
|
| 765 |
.coverage-label {
|
| 766 |
font-weight: 500;
|
| 767 |
+
color: var(--body-text-color, #333);
|
| 768 |
font-size: 0.9em;
|
| 769 |
}
|
| 770 |
|
| 771 |
.coverage-bar {
|
| 772 |
+
background: var(--neutral-200, #e0e0e0);
|
| 773 |
border-radius: 10px;
|
| 774 |
height: 8px;
|
| 775 |
overflow: hidden;
|
|
|
|
| 784 |
|
| 785 |
.coverage-text {
|
| 786 |
font-size: 0.85em;
|
| 787 |
+
color: var(--body-text-color-subdued, #666);
|
| 788 |
min-width: 100px;
|
| 789 |
text-align: right;
|
| 790 |
}
|
|
|
|
| 795 |
display: flex;
|
| 796 |
gap: 12px;
|
| 797 |
flex-wrap: wrap;
|
| 798 |
+
border-top: 1px solid var(--border-color-primary, #e0e0e0);
|
| 799 |
padding-top: 15px;
|
| 800 |
}
|
| 801 |
|
|
|
|
| 804 |
align-items: center;
|
| 805 |
padding: 8px 16px;
|
| 806 |
background: linear-gradient(135deg, #1976d2, #1565c0);
|
| 807 |
+
color: white !important;
|
| 808 |
text-decoration: none;
|
| 809 |
border-radius: 6px;
|
| 810 |
font-size: 0.9em;
|
|
|
|
| 816 |
transform: translateY(-1px);
|
| 817 |
box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
|
| 818 |
text-decoration: none;
|
| 819 |
+
color: white !important;
|
| 820 |
}
|
| 821 |
|
| 822 |
/* Error styling */
|
|
|
|
| 824 |
text-align: center;
|
| 825 |
padding: 40px;
|
| 826 |
color: #d32f2f;
|
| 827 |
+
background: var(--error-background, #ffebee);
|
| 828 |
border-radius: 8px;
|
| 829 |
+
border: 1px solid var(--error-border, #ffcdd2);
|
| 830 |
}
|
| 831 |
|
| 832 |
.error-message h3 {
|
| 833 |
margin: 0 0 15px 0;
|
| 834 |
}
|
| 835 |
|
| 836 |
+
/* Dark mode specific overrides */
|
| 837 |
+
.dark .gallery-container {
|
| 838 |
+
background-color: var(--background-fill-primary, #0b0f19);
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
.dark .eval-card {
|
| 842 |
+
background: var(--background-fill-secondary, #1f2937);
|
| 843 |
+
color: var(--body-text-color, #f3f4f6);
|
| 844 |
+
border: 1px solid var(--border-color-primary, #374151);
|
| 845 |
+
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
.dark .eval-card:hover {
|
| 849 |
+
box-shadow: 0 8px 30px rgba(0,0,0,0.4);
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
.dark .card-title {
|
| 853 |
+
color: var(--color-accent, #60a5fa);
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
.dark .card-summary {
|
| 857 |
+
color: var(--body-text-color, #f3f4f6);
|
| 858 |
+
}
|
| 859 |
+
|
| 860 |
+
.dark .card-meta p {
|
| 861 |
+
background: var(--input-background-fill, #374151);
|
| 862 |
+
color: var(--body-text-color, #f3f4f6);
|
| 863 |
+
}
|
| 864 |
+
|
| 865 |
+
.dark .coverage-section {
|
| 866 |
+
border-top: 1px solid var(--border-color-primary, #4b5563);
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
.dark .coverage-section h4 {
|
| 870 |
+
color: var(--color-accent, #60a5fa);
|
| 871 |
+
}
|
| 872 |
+
|
| 873 |
+
.dark .coverage-label {
|
| 874 |
+
color: var(--body-text-color, #f3f4f6);
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
.dark .coverage-bar {
|
| 878 |
+
background: var(--neutral-700, #4b5563);
|
| 879 |
+
}
|
| 880 |
+
|
| 881 |
+
.dark .coverage-text {
|
| 882 |
+
color: var(--body-text-color-subdued, #9ca3af);
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
.dark .card-links {
|
| 886 |
+
border-top: 1px solid var(--border-color-primary, #4b5563);
|
| 887 |
+
}
|
| 888 |
+
|
| 889 |
+
.dark .error-message {
|
| 890 |
+
background: var(--error-background, #7f1d1d);
|
| 891 |
+
border: 1px solid var(--error-border, #991b1b);
|
| 892 |
+
color: #fca5a5;
|
| 893 |
+
}
|
| 894 |
+
|
| 895 |
+
/* Alternative dark mode detection using data attributes or CSS variables */
|
| 896 |
+
[data-theme="dark"] .eval-card,
|
| 897 |
+
html[data-theme="dark"] .eval-card {
|
| 898 |
+
background: #1f2937;
|
| 899 |
+
color: #f3f4f6;
|
| 900 |
+
border: 1px solid #374151;
|
| 901 |
+
}
|
| 902 |
+
|
| 903 |
+
[data-theme="dark"] .card-title,
|
| 904 |
+
html[data-theme="dark"] .card-title {
|
| 905 |
+
color: #60a5fa;
|
| 906 |
+
}
|
| 907 |
+
|
| 908 |
+
[data-theme="dark"] .card-meta p,
|
| 909 |
+
html[data-theme="dark"] .card-meta p {
|
| 910 |
+
background: #374151;
|
| 911 |
+
color: #f3f4f6;
|
| 912 |
+
}
|
| 913 |
+
|
| 914 |
+
[data-theme="dark"] .coverage-section,
|
| 915 |
+
html[data-theme="dark"] .coverage-section {
|
| 916 |
+
border-top: 1px solid #4b5563;
|
| 917 |
+
}
|
| 918 |
+
|
| 919 |
+
[data-theme="dark"] .coverage-section h4,
|
| 920 |
+
html[data-theme="dark"] .coverage-section h4 {
|
| 921 |
+
color: #60a5fa;
|
| 922 |
+
}
|
| 923 |
+
|
| 924 |
+
[data-theme="dark"] .coverage-label,
|
| 925 |
+
html[data-theme="dark"] .coverage-label {
|
| 926 |
+
color: #f3f4f6;
|
| 927 |
+
}
|
| 928 |
+
|
| 929 |
+
[data-theme="dark"] .coverage-bar,
|
| 930 |
+
html[data-theme="dark"] .coverage-bar {
|
| 931 |
+
background: #4b5563;
|
| 932 |
+
}
|
| 933 |
+
|
| 934 |
+
[data-theme="dark"] .coverage-text,
|
| 935 |
+
html[data-theme="dark"] .coverage-text {
|
| 936 |
+
color: #9ca3af;
|
| 937 |
+
}
|
| 938 |
+
|
| 939 |
+
[data-theme="dark"] .card-links,
|
| 940 |
+
html[data-theme="dark"] .card-links {
|
| 941 |
+
border-top: 1px solid #4b5563;
|
| 942 |
+
}
|
| 943 |
+
|
| 944 |
/* Responsive design */
|
| 945 |
@media (max-width: 768px) {
|
| 946 |
.gallery-container {
|
|
|
|
| 973 |
grid-template-columns: 1fr;
|
| 974 |
}
|
| 975 |
}
|
| 976 |
+
|
| 977 |
+
/* Force dark theme detection using Gradio's CSS variables */
|
| 978 |
+
@media (prefers-color-scheme: dark) {
|
| 979 |
+
.eval-card {
|
| 980 |
+
background: var(--background-fill-secondary, #1f2937) !important;
|
| 981 |
+
color: var(--body-text-color, #f3f4f6) !important;
|
| 982 |
+
border: 1px solid var(--border-color-primary, #374151) !important;
|
| 983 |
+
}
|
| 984 |
+
|
| 985 |
+
.card-title {
|
| 986 |
+
color: var(--color-accent, #60a5fa) !important;
|
| 987 |
+
}
|
| 988 |
+
|
| 989 |
+
.card-summary {
|
| 990 |
+
color: var(--body-text-color, #f3f4f6) !important;
|
| 991 |
+
}
|
| 992 |
+
|
| 993 |
+
.card-meta p {
|
| 994 |
+
background: var(--input-background-fill, #374151) !important;
|
| 995 |
+
color: var(--body-text-color, #f3f4f6) !important;
|
| 996 |
+
}
|
| 997 |
+
|
| 998 |
+
.coverage-section {
|
| 999 |
+
border-top: 1px solid var(--border-color-primary, #4b5563) !important;
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
.coverage-section h4 {
|
| 1003 |
+
color: var(--color-accent, #60a5fa) !important;
|
| 1004 |
+
}
|
| 1005 |
+
|
| 1006 |
+
.coverage-label {
|
| 1007 |
+
color: var(--body-text-color, #f3f4f6) !important;
|
| 1008 |
+
}
|
| 1009 |
+
|
| 1010 |
+
.coverage-bar {
|
| 1011 |
+
background: var(--neutral-700, #4b5563) !important;
|
| 1012 |
+
}
|
| 1013 |
+
|
| 1014 |
+
.coverage-text {
|
| 1015 |
+
color: var(--body-text-color-subdued, #9ca3af) !important;
|
| 1016 |
+
}
|
| 1017 |
+
|
| 1018 |
+
.card-links {
|
| 1019 |
+
border-top: 1px solid var(--border-color-primary, #4b5563) !important;
|
| 1020 |
+
}
|
| 1021 |
+
}
|
| 1022 |
"""
|
| 1023 |
|
| 1024 |
# Create the interface
|