From a8b10662762be1924f14f5064dee05abc9c23ef9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Aug 2022 19:29:25 +0530 Subject: [PATCH] Also set color scheme for content popup iframe --- src/pyj/read_book/content_popup.pyj | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/content_popup.pyj b/src/pyj/read_book/content_popup.pyj index 187d8f2f3b..380b42a355 100644 --- a/src/pyj/read_book/content_popup.pyj +++ b/src/pyj/read_book/content_popup.pyj @@ -7,7 +7,7 @@ from gettext import gettext as _ from dom import add_extra_css, build_rule, clear, svgicon from iframe_comm import create_wrapped_iframe -from read_book.globals import runtime, ui_operations +from read_book.globals import runtime, ui_operations, is_dark_theme from read_book.resources import load_resources CLASS_NAME = 'book-content-popup-container' @@ -71,6 +71,7 @@ class ContentPopupOverlay: iframe, self.iframe_wrapper = create_wrapped_iframe( handlers, _('Loading data, please wait...'), entry_point, iframe_kw ) + iframe.style.colorScheme = 'dark' if is_dark_theme() else 'light' c = self.container c.firstChild.appendChild(iframe) @@ -107,6 +108,10 @@ class ContentPopupOverlay: c = self.container.firstChild c.style.backgroundColor = bg c.style.color = fg + try: + self.iframe.style.colorScheme = 'dark' if is_dark_theme() else 'light' + except: + pass def create_footnote_header(self, header): clear(header)