mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
...
This commit is contained in:
parent
26618a2a9d
commit
a14bc99af6
@ -123,11 +123,11 @@ class Document(QWebPage): # {{{
|
|||||||
opts = config().parse()
|
opts = config().parse()
|
||||||
bg = opts.background_color or 'white'
|
bg = opts.background_color or 'white'
|
||||||
brules = ['background-color: %s !important'%bg]
|
brules = ['background-color: %s !important'%bg]
|
||||||
if opts.text_color:
|
|
||||||
brules += ['color: %s !important'%opts.text_color]
|
|
||||||
prefix = '''
|
prefix = '''
|
||||||
body { %s }
|
body { %s }
|
||||||
'''%('; '.join(brules))
|
'''%('; '.join(brules))
|
||||||
|
if opts.text_color:
|
||||||
|
prefix += '\n\nbody, p, div { color: %s !important }'%opts.text_color
|
||||||
raw = prefix + opts.user_css
|
raw = prefix + opts.user_css
|
||||||
raw = '::selection {background:#ffff00; color:#000;}\n'+raw
|
raw = '::selection {background:#ffff00; color:#000;}\n'+raw
|
||||||
data = 'data:text/css;charset=utf-8;base64,'
|
data = 'data:text/css;charset=utf-8;base64,'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user