Fix chip text legibility (inline !important color on YOUR CALL/MACHINE chips)
Browse files- game/ui.py +6 -3
game/ui.py
CHANGED
|
@@ -46,10 +46,13 @@ def _pretty(species: str) -> str:
|
|
| 46 |
def _chip(label: str, tier: str, right: bool) -> str:
|
| 47 |
c = TIER_COLOR.get(tier, "#57544c")
|
| 48 |
mark = "✓" if right else "✕"
|
|
|
|
|
|
|
|
|
|
| 49 |
return (
|
| 50 |
-
f"<div class='gm-chip' style='border-color:{c}
|
| 51 |
-
f"<span class='gm-chip-h'>{label}</span>"
|
| 52 |
-
f"<span class='gm-chip-t'>{tier} {mark}</span></div>"
|
| 53 |
)
|
| 54 |
|
| 55 |
|
|
|
|
| 46 |
def _chip(label: str, tier: str, right: bool) -> str:
|
| 47 |
c = TIER_COLOR.get(tier, "#57544c")
|
| 48 |
mark = "✓" if right else "✕"
|
| 49 |
+
# color set inline with !important on the spans: Gradio's theme paints spans in
|
| 50 |
+
# the display panel a light color that overrides inherited/class color (the big
|
| 51 |
+
# truth div is fine, but these spans aren't) — inline !important wins the cascade.
|
| 52 |
return (
|
| 53 |
+
f"<div class='gm-chip' style='border-color:{c}'>"
|
| 54 |
+
f"<span class='gm-chip-h' style='color:{c} !important'>{label}</span>"
|
| 55 |
+
f"<span class='gm-chip-t' style='color:{c} !important'>{tier} {mark}</span></div>"
|
| 56 |
)
|
| 57 |
|
| 58 |
|