Spaces:
Running on Zero
Running on Zero
fix(ui): make checkbox checked state visible
Browse filesNative browser checkboxes were invisible against the Brutalist Mono
dark palette — the checkmark indicator washed out on dark surfaces
and the box outline was nearly imperceptible.
Replaced with a custom appearance:none style:
- Unchecked: dark fill, 1.5 px muted-ink border
- Checked: white fill with a black checkmark SVG drawn inline
via data URI (no external asset, CSP-safe)
- Hover: border brightens to full ink
- Focus: 2 px white outline
Affects all checkboxes inside .ams-content (Advanced accordion's
4 LM CoT toggles + ADG, plus any future ones).
theme.py
CHANGED
|
@@ -405,6 +405,70 @@ main, .contain {{
|
|
| 405 |
accent-color:{PRIMARY} !important;
|
| 406 |
}}
|
| 407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
/* ============================================================
|
| 409 |
* Form Radio (Vocal mode) — compact pills, NOT the sidebar tabs
|
| 410 |
* ============================================================ */
|
|
|
|
| 405 |
accent-color:{PRIMARY} !important;
|
| 406 |
}}
|
| 407 |
|
| 408 |
+
/* ============================================================
|
| 409 |
+
* Checkbox — native browser checkboxes render almost invisibly on
|
| 410 |
+
* the Brutalist Mono dark palette (white outline on dark surface,
|
| 411 |
+
* no visible fill when checked). Replace with a custom drawn box:
|
| 412 |
+
* - unchecked: dark surface, subtle 1.5 px white border
|
| 413 |
+
* - checked: WHITE fill with a black checkmark SVG drawn inline
|
| 414 |
+
* (no external asset, no CSP issues)
|
| 415 |
+
* - hover: border brightens
|
| 416 |
+
* - focus: 2 px white outline
|
| 417 |
+
* ``accent-color`` alone isn't enough — Gradio 6.14's checkbox style
|
| 418 |
+
* has tiny dimensions (12 px) and a transparent background that
|
| 419 |
+
* still hides the indicator on cool-temperature phone displays.
|
| 420 |
+
* ============================================================ */
|
| 421 |
+
.ams-content input[type="checkbox"] {{
|
| 422 |
+
-webkit-appearance:none !important;
|
| 423 |
+
appearance:none !important;
|
| 424 |
+
width:16px !important;
|
| 425 |
+
height:16px !important;
|
| 426 |
+
min-width:16px !important;
|
| 427 |
+
min-height:16px !important;
|
| 428 |
+
margin:0 8px 0 0 !important;
|
| 429 |
+
padding:0 !important;
|
| 430 |
+
border:1.5px solid {INK_MUTED} !important;
|
| 431 |
+
border-radius:2px !important;
|
| 432 |
+
background:{SURFACE_STRONG} !important;
|
| 433 |
+
cursor:pointer !important;
|
| 434 |
+
transition:background 80ms ease, border-color 80ms ease;
|
| 435 |
+
vertical-align:middle !important;
|
| 436 |
+
flex-shrink:0;
|
| 437 |
+
}}
|
| 438 |
+
.ams-content input[type="checkbox"]:hover {{
|
| 439 |
+
border-color:{INK} !important;
|
| 440 |
+
}}
|
| 441 |
+
.ams-content input[type="checkbox"]:focus-visible {{
|
| 442 |
+
outline:2px solid {PRIMARY} !important;
|
| 443 |
+
outline-offset:2px !important;
|
| 444 |
+
}}
|
| 445 |
+
.ams-content input[type="checkbox"]:checked {{
|
| 446 |
+
background:{PRIMARY} !important;
|
| 447 |
+
border-color:{PRIMARY} !important;
|
| 448 |
+
/* Black checkmark drawn inline (no external assets) — uses a small
|
| 449 |
+
polyline SVG sized to fit the 16 px box. */
|
| 450 |
+
background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230A0A0A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3,8 7,12 13,4'/%3E%3C/svg%3E") !important;
|
| 451 |
+
background-repeat:no-repeat !important;
|
| 452 |
+
background-position:center !important;
|
| 453 |
+
background-size:12px 12px !important;
|
| 454 |
+
}}
|
| 455 |
+
/* The label that wraps the checkbox + text should align them on a
|
| 456 |
+
single baseline so the new larger box doesn't push the text down. */
|
| 457 |
+
.ams-content label.checkbox-container {{
|
| 458 |
+
display:inline-flex !important;
|
| 459 |
+
align-items:center !important;
|
| 460 |
+
gap:2px !important;
|
| 461 |
+
cursor:pointer !important;
|
| 462 |
+
padding:4px 0 !important;
|
| 463 |
+
}}
|
| 464 |
+
.ams-content label.checkbox-container .label-text {{
|
| 465 |
+
font-family: {FONT_SANS} !important;
|
| 466 |
+
font-size:12px !important;
|
| 467 |
+
color:{INK} !important;
|
| 468 |
+
letter-spacing:0;
|
| 469 |
+
text-transform:none !important;
|
| 470 |
+
}}
|
| 471 |
+
|
| 472 |
/* ============================================================
|
| 473 |
* Form Radio (Vocal mode) — compact pills, NOT the sidebar tabs
|
| 474 |
* ============================================================ */
|