refs #703: enforce chat answer contrast in dark mode

This commit is contained in:
devmrko
2026-07-22 20:49:28 +09:00
parent 20836e458d
commit 63f294a857

View File

@@ -44,6 +44,18 @@ def apply_console_theme(st: Any, profile: AppProfile) -> None:
[data-testid="stJson"] code {{ [data-testid="stJson"] code {{
background:transparent !important; color:var(--console-text) !important; background:transparent !important; color:var(--console-text) !important;
-webkit-text-fill-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 {{ div[data-testid="stButton"] > button, div[data-testid="stFormSubmitButton"] > button {{
background:#fff !important; color:var(--console-text) !important; background:#fff !important; color:var(--console-text) !important;
-webkit-text-fill-color:var(--console-text) !important; -webkit-text-fill-color:var(--console-text) !important;