Use the font family from the theme instead of hard coding it to sans-serif

This commit is contained in:
Kovid Goyal 2017-11-04 05:20:12 +05:30
parent 2f08ebb35a
commit 35d4f21b98
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -19,10 +19,11 @@ LOADING_DOC = '''
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" id="bootstrap">
window.iframe_type = '__IFRAME_TYPE__'; // different in different iframes
window.default_font_family = '__FONT__'; // from the theme
__SCRIPT__
end_script
</head>
<body style="font-family: __FONT__">
<body>
<div style="font-size:larger; font-weight: bold; margin-top:48vh; text-align:center">
__BS__
</div>

View File

@ -231,7 +231,7 @@ def unserialize_html(serialized_data, proceed, postprocess_dom):
head, body = tree[1], tree[2] # noqa: unused-local
clear(document.head, document.body)
# Default stylesheet
document.head.appendChild(E.style('html { font-family: sans-serif }'))
document.head.appendChild(E.style(type='text/css', 'html {{ font-family: {} }}'.format(window.default_font_family or "sans-serif")))
resource_urls = {}
load_required = set()
proceeded = False