File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,17 @@ PYGMENTS_STYLES = {
2222 PALETTE .mocha .identifier : MochaStyle ,
2323}
2424
25+ BANNED_DECLARATIONS = {"padding" , "line-height" }
26+
2527
2628def write (content : str , path : Path ) -> None :
2729 path .parent .mkdir (parents = True , exist_ok = True )
2830 path .write_text (content )
2931
3032
3133def 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
You can’t perform that action at this time.
0 commit comments