From 368c7552dbec69d71b21e68f0d403ff38e68707a Mon Sep 17 00:00:00 2001 From: backwardspy Date: Fri, 11 Oct 2024 23:15:08 +0100 Subject: [PATCH] feat(pygments): remove line-height (#86) --- scripts/build-gh-pages | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/build-gh-pages b/scripts/build-gh-pages index c8da780..47df9ff 100755 --- a/scripts/build-gh-pages +++ b/scripts/build-gh-pages @@ -22,6 +22,8 @@ PYGMENTS_STYLES = { PALETTE.mocha.identifier: MochaStyle, } +BANNED_DECLARATIONS = {"padding", "line-height"} + def write(content: str, path: Path) -> None: path.parent.mkdir(parents=True, exist_ok=True) @@ -29,7 +31,8 @@ def write(content: str, path: Path) -> None: def postprocess_css(content: str, important: bool) -> str: - rules = tinycss2.parse_stylesheet(content, skip_comments=True, skip_whitespace=True) + rules = tinycss2.parse_stylesheet( + content, skip_comments=True, skip_whitespace=True) for rule in rules: declarations = tinycss2.parse_declaration_list( rule.content, skip_comments=True, skip_whitespace=True @@ -39,7 +42,7 @@ def postprocess_css(content: str, important: bool) -> str: declarations = [ declaration for declaration in declarations - if "padding" not in declaration.lower_name + if all(decl not in declaration.lower_name for decl in BANNED_DECLARATIONS) ] # add !important if needed