mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Fix a regression in 6.0 that caused incorrect rendering of comments metadata in the book details panel in dark mode. Fixes #1981886 [[Content Server] Back ground of Comments section is white on dark mode](https://bugs.launchpad.net/calibre/+bug/1981886)
This commit is contained in:
parent
563c1089df
commit
ffeb7f5e3c
@ -15,7 +15,9 @@ from book_list.library_data import (
|
|||||||
set_book_metadata
|
set_book_metadata
|
||||||
)
|
)
|
||||||
from book_list.router import back, home, open_book, report_a_load_failure
|
from book_list.router import back, home, open_book, report_a_load_failure
|
||||||
from book_list.theme import get_color, get_color_as_rgba, get_font_size
|
from book_list.theme import (
|
||||||
|
browser_in_dark_mode, get_color, get_color_as_rgba, get_font_size
|
||||||
|
)
|
||||||
from book_list.top_bar import add_button, clear_buttons, create_top_bar, set_title
|
from book_list.top_bar import add_button, clear_buttons, create_top_bar, set_title
|
||||||
from book_list.ui import query_as_href, set_panel_handler, show_panel
|
from book_list.ui import query_as_href, set_panel_handler, show_panel
|
||||||
from book_list.views import search_query_for
|
from book_list.views import search_query_for
|
||||||
@ -148,7 +150,8 @@ if window?:
|
|||||||
|
|
||||||
def adjusting_sandboxed_html(html, extra_css):
|
def adjusting_sandboxed_html(html, extra_css):
|
||||||
color = get_color_as_rgba('window-foreground')
|
color = get_color_as_rgba('window-foreground')
|
||||||
css = f'html, body {{ overflow: hidden; color: rgba({color[0]}, {color[1]}, {color[2]}, {color[3]}) }}'
|
cs = 'dark' if browser_in_dark_mode() else 'light'
|
||||||
|
css = f'\n\n:root {{ color-scheme: {cs} }}\n\nhtml, body {{ overflow: hidden; color: rgba({color[0]}, {color[1]}, {color[2]}, {color[3]}) }}'
|
||||||
if extra_css:
|
if extra_css:
|
||||||
css += '\n\n' + extra_css
|
css += '\n\n' + extra_css
|
||||||
# allow-same-origin is needed for resizing and allow-popups is needed for
|
# allow-same-origin is needed for resizing and allow-popups is needed for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user