mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-04 05:16:36 +01:00
Avoid unnecessary color: currentColor for body
This commit is contained in:
parent
d0a5b4b2a5
commit
a697d27e2f
1 changed files with 5 additions and 2 deletions
|
|
@ -453,7 +453,7 @@ def generate_css(self, dest_dir, docx, notes_nopb, nosupsub):
|
|||
ef = self.fonts.embed_fonts(dest_dir, docx)
|
||||
|
||||
s = '''\
|
||||
body { font-family: %s; font-size: %s; color: %s }
|
||||
body { font-family: %s; font-size: %s; %s }
|
||||
|
||||
/* In word all paragraphs have zero margins unless explicitly specified in a style */
|
||||
p, h1, h2, h3, h4, h5, h6, div { margin: 0; padding: 0 }
|
||||
|
|
@ -496,7 +496,10 @@ def generate_css(self, dest_dir, docx, notes_nopb, nosupsub):
|
|||
sub { vertical-align: bottom }
|
||||
'''
|
||||
|
||||
prefix = textwrap.dedent(s) % (self.body_font_family, self.body_font_size, self.body_color)
|
||||
body_color = ''
|
||||
if self.body_color.lower() not in ('currentcolor', 'inherit'):
|
||||
body_color = 'color: {};'.format(self.body_color)
|
||||
prefix = textwrap.dedent(s) % (self.body_font_family, self.body_font_size, body_color)
|
||||
if ef:
|
||||
prefix = ef + '\n' + prefix
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue