Skip to content

Commit 0ce72f9

Browse files
committed
Use inherited font size for em_pt
1 parent 8780076 commit 0ce72f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/formats/format.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,6 @@ def __init__(self, inherited=None):
17871787
self.inherited = inherited
17881788

17891789
INITIAL_STYLE = {
1790-
'font-size': '12pt'
17911790
}
17921791

17931792
def __call__(self, declarations_str):
@@ -2022,9 +2021,10 @@ def compute_css(cls, declarations_str, inherited=None):
20222021

20232022
# 2. resolve relative font size
20242023
if props.get('font-size'):
2025-
em_pt = self.INITIAL_STYLE['font-size']
2026-
assert em_pt[-2:] == 'pt'
2027-
em_pt = float(em_pt[:-2])
2024+
if 'font-size' in inherited:
2025+
em_pt = inherited['font-size']
2026+
assert em_pt[-2:] == 'pt'
2027+
em_pt = float(em_pt[:-2])
20282028
font_size = self.font_size_to_pt(props['font-size'], em_pt)
20292029
props['font-size'] = '%fpt' % font_size
20302030

0 commit comments

Comments
 (0)