mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure selection color does not change when iframe is de-focused
This commit is contained in:
parent
5bab8e8292
commit
51d7ac1baa
@ -3,7 +3,8 @@
|
|||||||
from __python__ import hash_literals
|
from __python__ import hash_literals
|
||||||
|
|
||||||
from elementmaker import E
|
from elementmaker import E
|
||||||
from read_book.globals import runtime
|
|
||||||
|
from read_book.globals import dark_link_color, runtime
|
||||||
from session import defaults
|
from session import defaults
|
||||||
|
|
||||||
opts = {}
|
opts = {}
|
||||||
@ -63,6 +64,15 @@ def apply_colors():
|
|||||||
# priority than the override all selectors above
|
# priority than the override all selectors above
|
||||||
text += f'\nhtml > body :link, html > body :link * {{ color: {c} !important }} html > body :visited, html > body :visited * {{ color: {c} !important }}'
|
text += f'\nhtml > body :link, html > body :link * {{ color: {c} !important }} html > body :visited, html > body :visited * {{ color: {c} !important }}'
|
||||||
|
|
||||||
|
if opts.is_dark_theme:
|
||||||
|
selbg = dark_link_color
|
||||||
|
selfg = 'black'
|
||||||
|
else:
|
||||||
|
selbg = '#3297FD'
|
||||||
|
selfg = 'white'
|
||||||
|
text += f'\n::selection {{ background-color: {selbg}; color: {selfg} }}'
|
||||||
|
text += f'\n::selection:window-inactive {{ background-color: {selbg}; color: {selfg} }}'
|
||||||
|
|
||||||
ss.textContent = text
|
ss.textContent = text
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user