AF-HuggingFace commited on
Commit
bfa8c9a
Β·
verified Β·
1 Parent(s): 4083d5b

Upload 3 files

Browse files
Files changed (1) hide show
  1. app.py +117 -32
app.py CHANGED
@@ -2191,6 +2191,7 @@ custom_css = """
2191
  .gradio-container { background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 100%); font-family: 'Inter', system-ui, sans-serif; color: #FFFFFF !important; }
2192
 
2193
  /* === FORCE ALL TEXT BRIGHT β€” NUCLEAR OVERRIDES === */
 
2194
  .gradio-container *, .gradio-container *::before, .gradio-container *::after { color: inherit; }
2195
  .gradio-container label, .gradio-container span, .gradio-container p,
2196
  .gradio-container div, .gradio-container td, .gradio-container th,
@@ -2201,48 +2202,132 @@ custom_css = """
2201
  color: #FFFFFF !important;
2202
  }
2203
 
2204
- /* === FIX INVISIBLE TEXT (the real problem) === */
2205
- .legend-section span, .legend-section td, .legend-section th,
2206
- .legend-section p, .legend-section div, .gr-markdown span {
2207
- color: #FFFFFF !important;
 
2208
  }
2209
 
2210
- /* Darker, high-contrast badge examples (the light-cyan rectangles) */
2211
- .legend-section .legend-color,
2212
- .gr-markdown .legend-color,
2213
- .gr-markdown span[style*="background"] {
2214
- background: #0A2A3A !important;
2215
- color: #00FFFF !important;
2216
- border: 2px solid #00FFFF !important;
2217
- padding: 2px 6px;
2218
- border-radius: 4px;
2219
- font-weight: bold;
 
 
2220
  }
2221
 
2222
- /* Telemetry Key colored boxes */
2223
- .gr-markdown code, .gr-markdown span[class*="cyan"] {
2224
- background: #0A2A3A !important;
2225
- color: #00FFFF !important;
2226
- padding: 2px 5px;
2227
- border-radius: 3px;
2228
  }
2229
 
2230
- /* Tables in legend */
2231
- .legend-section table td, .legend-section table th,
2232
- .gr-markdown table td, .gr-markdown table th {
2233
- color: #FFFFFF !important;
2234
- background: #1A1A1A !important;
2235
  }
2236
 
2237
- /* Rest of your original beautiful CSS (unchanged) */
2238
- .gr-label, [data-testid="label"] { color: #00FFFF !important; text-shadow: 0 0 3px rgba(0, 255, 255, 0.4); font-weight: 600 !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2239
  .gr-image { border: 2px solid #00FFFF; box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); background: #111111; }
2240
- .gr-json { background: #111111; border: 1px solid #00FFFF; color: #00FFFF !important; }
2241
- .gr-button-primary { background: linear-gradient(45deg, #00FFFF, #00FFAA); box-shadow: 0 0 15px #00FFFF, 0 0 30px #00FFAA; color: #000000 !important; }
2242
- .gr-markdown h1 { color: #FFFFFF !important; text-shadow: 0 0 15px #00FFFF, 0 0 30px #00FFFF, 0 0 60px #00AAFF; }
 
 
 
 
 
 
 
 
 
2243
  .gr-markdown h2, .gr-markdown h3, .gr-markdown h4 { color: #00FFFF !important; }
2244
- .gr-accordion summary { color: #00FFFF !important; }
2245
- /* ... (the rest of your original CSS stays exactly as it was) ... */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2246
  """
2247
 
2248
  with gr.Blocks(theme=custom_theme, css=custom_css) as demo:
 
2191
  .gradio-container { background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 100%); font-family: 'Inter', system-ui, sans-serif; color: #FFFFFF !important; }
2192
 
2193
  /* === FORCE ALL TEXT BRIGHT β€” NUCLEAR OVERRIDES === */
2194
+ /* Every possible Gradio text element */
2195
  .gradio-container *, .gradio-container *::before, .gradio-container *::after { color: inherit; }
2196
  .gradio-container label, .gradio-container span, .gradio-container p,
2197
  .gradio-container div, .gradio-container td, .gradio-container th,
 
2202
  color: #FFFFFF !important;
2203
  }
2204
 
2205
+ /* Component labels (Mission Directive, Thinking Budget, etc.) */
2206
+ .gradio-container label, .gr-label, [data-testid="label"],
2207
+ .label-wrap, .label-wrap span, .block label,
2208
+ label span, .gr-block label, .wrap > label {
2209
+ color: #00FFFF !important; text-shadow: 0 0 3px rgba(0, 255, 255, 0.4); font-weight: 600 !important;
2210
  }
2211
 
2212
+ /* INFO TEXT β€” the πŸ’‘ helper text under inputs (Gradio renders these very dim by default) */
2213
+ .gradio-container .info, .gradio-container [class*="info"],
2214
+ .gradio-container .gr-form .info, .gradio-container span.info,
2215
+ .gradio-container .wrap .info, .gradio-container .block .info,
2216
+ .gradio-container [data-testid="info"], .gradio-container .gr-input-label .info,
2217
+ .gradio-container .input-info, .gradio-container .gr-box + span,
2218
+ .gradio-container .gr-form span:not(label span),
2219
+ .gradio-container .block > div > span,
2220
+ .gradio-container .form > div > span,
2221
+ .gradio-container span[class*="desc"], span[class*="hint"],
2222
+ .gradio-container .gr-block > div > span {
2223
+ color: #66FFFF !important; opacity: 1 !important; font-size: 12px !important;
2224
  }
2225
 
2226
+ /* Svelte-generated info text (Gradio 4.x uses svelte-XXXXX classes) */
2227
+ .gradio-container span[data-testid], .gradio-container p[data-testid],
2228
+ span[class^="svelte-"], p[class^="svelte-"] {
2229
+ color: #CCFFFF !important; opacity: 1 !important;
 
 
2230
  }
2231
 
2232
+ /* Input fields β€” text user types */
2233
+ input, textarea, .gr-box, .gr-input, .gr-textbox textarea,
2234
+ input[type="text"], input[type="number"] {
2235
+ color: #FFFFFF !important; background-color: #1A1A1A !important; caret-color: #00FFFF;
 
2236
  }
2237
 
2238
+ /* Slider β€” value display + track label */
2239
+ .gr-slider input, .range-slider span, .gr-number input,
2240
+ input[type="range"] + span, .gr-slider output,
2241
+ .gradio-container input[type="number"] {
2242
+ color: #FFFFFF !important; font-weight: bold !important;
2243
+ }
2244
+
2245
+ /* Textbox and slider borders */
2246
+ .gr-textbox, .gr-slider { border: 1px solid #00FFFF; background: #1A1A1A; color: #FFFFFF; box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.2); }
2247
+
2248
+ /* Buttons */
2249
+ .gr-button-primary { background: linear-gradient(45deg, #00FFFF, #00FFAA); box-shadow: 0 0 15px #00FFFF, 0 0 30px #00FFAA; transition: all 0.3s ease; border: none; color: #000000 !important; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
2250
+ .gr-button-primary:hover { box-shadow: 0 0 25px #00FFFF, 0 0 50px #00FFAA; transform: scale(1.05); }
2251
+ .gr-button-secondary, button[class*="secondary"] { color: #FFFFFF !important; }
2252
+
2253
+ /* Image container */
2254
  .gr-image { border: 2px solid #00FFFF; box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); background: #111111; }
2255
+
2256
+ /* JSON viewer β€” keys, values, brackets */
2257
+ .gr-json { background: #111111; border: 1px solid #00FFFF; color: #00FFFF !important; font-family: 'IBM Plex Mono', monospace; }
2258
+ .gr-json span, .json-holder span, [class*="json"] span { color: #00FFFF !important; }
2259
+ .gr-json .string, [class*="json"] .string { color: #55FF88 !important; }
2260
+ .gr-json .number, [class*="json"] .number { color: #FFDD44 !important; }
2261
+ .gr-json .key, [class*="json"] .key { color: #44DDFF !important; }
2262
+ .gr-json .boolean, [class*="json"] .boolean { color: #FF88AA !important; }
2263
+ .gr-json .null, [class*="json"] .null { color: #BBBBBB !important; }
2264
+
2265
+ /* Markdown */
2266
+ .gr-markdown h1 { color: #FFFFFF !important; text-shadow: 0 0 15px #00FFFF, 0 0 30px #00FFFF, 0 0 60px #00AAFF; font-weight: 900; letter-spacing: 2px; background: none; -webkit-text-fill-color: #FFFFFF; }
2267
  .gr-markdown h2, .gr-markdown h3, .gr-markdown h4 { color: #00FFFF !important; }
2268
+ .gr-markdown p, .gr-markdown li, .gr-markdown td, .gr-markdown span { color: #FFFFFF !important; }
2269
+ .gr-markdown strong, .gr-markdown b { color: #00FFFF !important; }
2270
+ .gr-markdown em, .gr-markdown i { color: #EEEEFF !important; }
2271
+ .gr-markdown code { color: #FFD700 !important; background: #222 !important; }
2272
+
2273
+ /* Checkbox */
2274
+ .gr-checkbox label, .gr-checkbox span,
2275
+ input[type="checkbox"] + label, input[type="checkbox"] + span {
2276
+ color: #FFFFFF !important;
2277
+ }
2278
+
2279
+ /* Accordion headers */
2280
+ .gr-accordion summary, .gr-accordion button, button.label-wrap,
2281
+ details summary, details summary span, .open-close-icon,
2282
+ [class*="accordion"] summary, [class*="accordion"] button {
2283
+ color: #00FFFF !important; font-weight: 600 !important;
2284
+ }
2285
+
2286
+ /* Dataframe / Table β€” light background so text must be dark */
2287
+ .gr-dataframe td, .gr-dataframe th, table.dataframe td, table.dataframe th,
2288
+ .dataframe td, .dataframe th, [class*="table"] td, [class*="table"] th {
2289
+ color: #000000 !important;
2290
+ }
2291
+ .gr-dataframe th, .dataframe th, [class*="table"] th {
2292
+ color: #000000 !important; font-weight: bold !important;
2293
+ }
2294
+
2295
+ /* HTML panel β€” don't override inline styles (they handle their own colors) */
2296
+ .gr-html { color: #FFFFFF; }
2297
+
2298
+ /* Log textbox content */
2299
+ .gr-textbox textarea, textarea { color: #FFFFFF !important; }
2300
+
2301
+ .gr-row { background: rgba(255, 255, 255, 0.02); border-radius: 12px; padding: 20px; }
2302
+
2303
+ /* --- Tooltip system --- */
2304
+ .tooltip-wrap { position: relative; display: inline-block; cursor: help; }
2305
+ .tooltip-wrap .tooltip-text {
2306
+ visibility: hidden; opacity: 0;
2307
+ background: #111; color: #00FFFF; border: 1px solid #00FFFF;
2308
+ padding: 8px 12px; border-radius: 6px; font-size: 12px;
2309
+ position: absolute; z-index: 999; bottom: 125%; left: 50%;
2310
+ transform: translateX(-50%); white-space: normal; width: 280px;
2311
+ box-shadow: 0 0 12px rgba(0,255,255,0.3);
2312
+ transition: opacity 0.2s; text-align: left; line-height: 1.4;
2313
+ }
2314
+ .tooltip-wrap:hover .tooltip-text { visibility: visible; opacity: 1; }
2315
+
2316
+ /* --- Accordion legend --- */
2317
+ .legend-section { font-size: 13px; line-height: 1.6; color: #FFFFFF !important; }
2318
+ .legend-section strong { color: #00FFFF !important; }
2319
+ .legend-section em { color: #EEEEFF !important; }
2320
+ .legend-section code { background: #222 !important; padding: 1px 5px; border-radius: 3px; color: #FFD700 !important; font-size: 12px; }
2321
+ .legend-section td code, .legend-section p code, .gr-markdown td code { background: #222 !important; color: #FFD700 !important; }
2322
+ code, .prose code, .markdown-text code { background: #222 !important; color: #FFD700 !important; }
2323
+ .legend-section .legend-color {
2324
+ display: inline-block; width: 12px; height: 12px; border-radius: 2px;
2325
+ vertical-align: middle; margin-right: 4px; border: 1px solid #555;
2326
+ }
2327
+ .legend-section table { border-collapse: collapse; width: 100%; }
2328
+ .legend-section th { color: #00FFFF !important; border-bottom: 1px solid #00FFFF; padding: 4px 8px; text-align: left; }
2329
+ .legend-section td { color: #FFFFFF !important; border-bottom: 1px solid #444; padding: 4px 8px; }
2330
+ .legend-section hr { border-color: #00FFFF; opacity: 0.3; }
2331
  """
2332
 
2333
  with gr.Blocks(theme=custom_theme, css=custom_css) as demo: