Skip to content

Commit 368c755

Browse files
authored
feat(pygments): remove line-height (#86)
1 parent c3a3fdf commit 368c755

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/build-gh-pages

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ PYGMENTS_STYLES = {
2222
PALETTE.mocha.identifier: MochaStyle,
2323
}
2424

25+
BANNED_DECLARATIONS = {"padding", "line-height"}
26+
2527

2628
def write(content: str, path: Path) -> None:
2729
path.parent.mkdir(parents=True, exist_ok=True)
2830
path.write_text(content)
2931

3032

3133
def postprocess_css(content: str, important: bool) -> str:
32-
rules = tinycss2.parse_stylesheet(content, skip_comments=True, skip_whitespace=True)
34+
rules = tinycss2.parse_stylesheet(
35+
content, skip_comments=True, skip_whitespace=True)
3336
for rule in rules:
3437
declarations = tinycss2.parse_declaration_list(
3538
rule.content, skip_comments=True, skip_whitespace=True
@@ -39,7 +42,7 @@ def postprocess_css(content: str, important: bool) -> str:
3942
declarations = [
4043
declaration
4144
for declaration in declarations
42-
if "padding" not in declaration.lower_name
45+
if all(decl not in declaration.lower_name for decl in BANNED_DECLARATIONS)
4346
]
4447

4548
# add !important if needed

0 commit comments

Comments
 (0)