Spaces:
Sleeping
Sleeping
Commit ·
c9df750
1
Parent(s): 68aebec
[fix] Dark/light mode compatibility for Gradio UI
Browse files- assets/styles.css +67 -16
- src/ui.py +1 -1
assets/styles.css
CHANGED
|
@@ -20,11 +20,14 @@ html, body, #app, body > div, .gradio-container {
|
|
| 20 |
color: white;
|
| 21 |
}
|
| 22 |
|
|
|
|
| 23 |
#app-container p,
|
| 24 |
#app-container ol,
|
| 25 |
-
#app-container li
|
|
|
|
| 26 |
font-size: 16px;
|
| 27 |
line-height: 1.6;
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
#app-title {
|
|
@@ -49,7 +52,7 @@ html, body, #app, body > div, .gradio-container {
|
|
| 49 |
|
| 50 |
#intro-text {
|
| 51 |
font-size: 16px;
|
| 52 |
-
color: white;
|
| 53 |
margin-top: 20px;
|
| 54 |
line-height: 1.6;
|
| 55 |
}
|
|
@@ -62,7 +65,7 @@ html, body, #app, body > div, .gradio-container {
|
|
| 62 |
|
| 63 |
.button-link {
|
| 64 |
background: linear-gradient(to left, #ff416c, #ff4b2b);
|
| 65 |
-
color: white;
|
| 66 |
padding: 10px 20px;
|
| 67 |
text-decoration: none;
|
| 68 |
font-weight: bold;
|
|
@@ -83,16 +86,19 @@ html, body, #app, body > div, .gradio-container {
|
|
| 83 |
|
| 84 |
.label-box label {
|
| 85 |
background-color: #1f2937;
|
| 86 |
-
color: white;
|
| 87 |
padding: 4px 10px;
|
| 88 |
border-radius: 8px;
|
| 89 |
display: inline-block;
|
| 90 |
margin-bottom: 6px;
|
| 91 |
}
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
.label-box {
|
| 94 |
background-color: #1f2937;
|
| 95 |
-
color: white;
|
| 96 |
padding: 4px 10px;
|
| 97 |
border-radius: 8px;
|
| 98 |
display: inline-block;
|
|
@@ -116,6 +122,7 @@ html, body, #app, body > div, .gradio-container {
|
|
| 116 |
|
| 117 |
textarea, input[type="text"] {
|
| 118 |
background-color: #374151 !important;
|
|
|
|
| 119 |
}
|
| 120 |
|
| 121 |
#custom-dropdown .wrap {
|
|
@@ -123,12 +130,38 @@ textarea, input[type="text"] {
|
|
| 123 |
border-radius: 6px;
|
| 124 |
}
|
| 125 |
|
| 126 |
-
|
|
|
|
| 127 |
background-color: #374151 !important;
|
| 128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
input[type="number"] {
|
| 131 |
-
background-color: #374151
|
|
|
|
| 132 |
}
|
| 133 |
|
| 134 |
#business-problem-box {
|
|
@@ -139,9 +172,14 @@ input[type="number"] {
|
|
| 139 |
width: 100% !important;
|
| 140 |
}
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
#run-btn {
|
| 143 |
background: linear-gradient(to left, #ff416c, #ff4b2b);
|
| 144 |
-
color: white;
|
| 145 |
font-weight: bold;
|
| 146 |
border: none;
|
| 147 |
padding: 10px 20px;
|
|
@@ -160,18 +198,31 @@ input[type="number"] {
|
|
| 160 |
border-radius: 8px;
|
| 161 |
padding: 10px;
|
| 162 |
margin-top: 16px;
|
| 163 |
-
color: white;
|
| 164 |
font-weight: 500;
|
| 165 |
}
|
| 166 |
|
| 167 |
-
#download-box .label {
|
| 168 |
-
color: #ff416c;
|
| 169 |
-
font-weight: bold;
|
| 170 |
-
font-size: 15px;
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
#download-box a {
|
| 174 |
color: #00c3ff !important;
|
| 175 |
text-decoration: underline;
|
| 176 |
font-weight: bold;
|
| 177 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
color: white;
|
| 21 |
}
|
| 22 |
|
| 23 |
+
#app-container h4,
|
| 24 |
#app-container p,
|
| 25 |
#app-container ol,
|
| 26 |
+
#app-container li,
|
| 27 |
+
#app-container strong {
|
| 28 |
font-size: 16px;
|
| 29 |
line-height: 1.6;
|
| 30 |
+
color: white !important;
|
| 31 |
}
|
| 32 |
|
| 33 |
#app-title {
|
|
|
|
| 52 |
|
| 53 |
#intro-text {
|
| 54 |
font-size: 16px;
|
| 55 |
+
color: white !important;
|
| 56 |
margin-top: 20px;
|
| 57 |
line-height: 1.6;
|
| 58 |
}
|
|
|
|
| 65 |
|
| 66 |
.button-link {
|
| 67 |
background: linear-gradient(to left, #ff416c, #ff4b2b);
|
| 68 |
+
color: white !important;
|
| 69 |
padding: 10px 20px;
|
| 70 |
text-decoration: none;
|
| 71 |
font-weight: bold;
|
|
|
|
| 86 |
|
| 87 |
.label-box label {
|
| 88 |
background-color: #1f2937;
|
|
|
|
| 89 |
padding: 4px 10px;
|
| 90 |
border-radius: 8px;
|
| 91 |
display: inline-block;
|
| 92 |
margin-bottom: 6px;
|
| 93 |
}
|
| 94 |
|
| 95 |
+
.label-box span {
|
| 96 |
+
color: white !important;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
.label-box {
|
| 100 |
background-color: #1f2937;
|
| 101 |
+
color: white;
|
| 102 |
padding: 4px 10px;
|
| 103 |
border-radius: 8px;
|
| 104 |
display: inline-block;
|
|
|
|
| 122 |
|
| 123 |
textarea, input[type="text"] {
|
| 124 |
background-color: #374151 !important;
|
| 125 |
+
color: white !important;
|
| 126 |
}
|
| 127 |
|
| 128 |
#custom-dropdown .wrap {
|
|
|
|
| 130 |
border-radius: 6px;
|
| 131 |
}
|
| 132 |
|
| 133 |
+
input[role="listbox"] {
|
| 134 |
+
color: white !important;
|
| 135 |
background-color: #374151 !important;
|
| 136 |
}
|
| 137 |
+
.dropdown-arrow {
|
| 138 |
+
color: white !important;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
ul[role="listbox"] {
|
| 142 |
+
background-color: #111827 !important; /* dark navy */
|
| 143 |
+
color: white !important;
|
| 144 |
+
border-radius: 6px;
|
| 145 |
+
padding: 4px 0;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
ul[role="listbox"] li {
|
| 149 |
+
color: white !important;
|
| 150 |
+
padding: 8px 12px;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
ul[role="listbox"] li:hover {
|
| 154 |
+
background-color: #1f2937 !important; /* slightly lighter hover */
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
ul[role="listbox"] li[aria-selected="true"] {
|
| 158 |
+
background-color: #111827 !important; /* same dark as others */
|
| 159 |
+
color: white !important;
|
| 160 |
+
}
|
| 161 |
|
| 162 |
input[type="number"] {
|
| 163 |
+
background-color: #374151;
|
| 164 |
+
color: white !important;
|
| 165 |
}
|
| 166 |
|
| 167 |
#business-problem-box {
|
|
|
|
| 172 |
width: 100% !important;
|
| 173 |
}
|
| 174 |
|
| 175 |
+
#business-problem-box textarea::placeholder {
|
| 176 |
+
color: #9ca3af !important; /* Tailwind's "gray-400" */
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
|
| 180 |
#run-btn {
|
| 181 |
background: linear-gradient(to left, #ff416c, #ff4b2b);
|
| 182 |
+
color: white !important;
|
| 183 |
font-weight: bold;
|
| 184 |
border: none;
|
| 185 |
padding: 10px 20px;
|
|
|
|
| 198 |
border-radius: 8px;
|
| 199 |
padding: 10px;
|
| 200 |
margin-top: 16px;
|
|
|
|
| 201 |
font-weight: 500;
|
| 202 |
}
|
| 203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
#download-box a {
|
| 205 |
color: #00c3ff !important;
|
| 206 |
text-decoration: underline;
|
| 207 |
font-weight: bold;
|
| 208 |
+
}
|
| 209 |
+
#download-box td.filename {
|
| 210 |
+
color: rgb(255, 255, 255) !important;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
#download-box .file-preview-holder,
|
| 214 |
+
#download-box .file-preview,
|
| 215 |
+
#download-box table,
|
| 216 |
+
#download-box tr,
|
| 217 |
+
#download-box td {
|
| 218 |
+
background-color: #1f2937 !important;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/* #download-box label {
|
| 222 |
+
background-color: #1f2937 !important;
|
| 223 |
+
color: white !important;
|
| 224 |
+
font-weight: bold;
|
| 225 |
+
} */
|
| 226 |
+
#download-box > label {
|
| 227 |
+
display: none !important;
|
| 228 |
+
}
|
src/ui.py
CHANGED
|
@@ -143,7 +143,7 @@ def build_ui(css_path="assets/styles.css"):
|
|
| 143 |
)
|
| 144 |
|
| 145 |
# Hidden file component for dataset download
|
| 146 |
-
file_download = gr.File(
|
| 147 |
|
| 148 |
# Component to display status messages
|
| 149 |
status_message = gr.Markdown("", label="Status")
|
|
|
|
| 143 |
)
|
| 144 |
|
| 145 |
# Hidden file component for dataset download
|
| 146 |
+
file_download = gr.File(visible=False, elem_id="download-box", label=None)
|
| 147 |
|
| 148 |
# Component to display status messages
|
| 149 |
status_message = gr.Markdown("", label="Status")
|