From 25adbe6bd61cbbb0f825025d5f22ecc2c3ed0b7c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Aug 2020 09:49:39 +0530 Subject: [PATCH] Fix focus outline in dark mode --- src/pyj/book_list/theme.pyj | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pyj/book_list/theme.pyj b/src/pyj/book_list/theme.pyj index 2ac24626a0..0b621e9bc6 100644 --- a/src/pyj/book_list/theme.pyj +++ b/src/pyj/book_list/theme.pyj @@ -51,6 +51,7 @@ DEFAULT_COLORS = { # Native controls 'input-background': c('field', DT_DARK_DARKER), 'input-foreground': c('fieldtext', DT_LIGHT), + 'input-focus-outline-color': c('#4D90FE', DT_LIGHT), } DEFAULT_SIZES = { @@ -79,7 +80,15 @@ def browser_in_dark_mode(): def css_for_variables(): - input_css = 'input, textarea { color: var(--calibre-color-input-foreground); background-color: var(--calibre-color-input-background); }' + input_css = ''' + input, textarea { + color: var(--calibre-color-input-foreground); \ + background-color: var(--calibre-color-input-background); \ + } + input:focus, textarea:focus { + outline-color: var(--calibre-color-input-focus-outline-color); \ + } + ''' is_dark_theme = browser_in_dark_mode() attr = 'dark' if is_dark_theme else 'light' ans = v'[]'