From aa9ea48b244b40a31cd0e7a0c0a8e5b41f40ca08 Mon Sep 17 00:00:00 2001 From: devmrko Date: Wed, 22 Jul 2026 20:49:28 +0900 Subject: [PATCH] refs #703: enforce chat answer contrast in dark mode --- .../ai_web_agent_console/presentation.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ai-web-agent-console/ai_web_agent_console/presentation.py b/ai-web-agent-console/ai_web_agent_console/presentation.py index b11e06e..14bfecf 100644 --- a/ai-web-agent-console/ai_web_agent_console/presentation.py +++ b/ai-web-agent-console/ai_web_agent_console/presentation.py @@ -46,6 +46,18 @@ def apply_console_theme(st: Any, profile: AppProfile) -> None: [data-testid="stJson"] code {{ background:transparent !important; color:var(--console-text) !important; -webkit-text-fill-color:var(--console-text) !important; }} + /* Chat responses are rendered in a separate Streamlit surface. Without + these rules a dark browser theme can leave the answer card dark while + its Markdown keeps the light-theme text color. */ + div[data-testid="stChatMessage"], div[data-testid="stChatMessageContent"] {{ + background:#fff !important; color:var(--console-text) !important; + border-color:var(--console-border) !important; color-scheme:light !important; }} + div[data-testid="stChatMessage"] [data-testid="stMarkdownContainer"], + div[data-testid="stChatMessage"] [data-testid="stMarkdownContainer"] *, + div[data-testid="stChatMessage"] [data-testid="stCaptionContainer"], + div[data-testid="stChatMessage"] [data-testid="stCaptionContainer"] * {{ + color:var(--console-text) !important; + -webkit-text-fill-color:var(--console-text) !important; }} div[data-testid="stButton"] > button, div[data-testid="stFormSubmitButton"] > button {{ background:#fff !important; color:var(--console-text) !important; -webkit-text-fill-color:var(--console-text) !important;