css-minifier: Lint for '+' operator in calc().

Fixes: #8403.
This commit is contained in:
Aditya Bansal
2018-02-26 00:19:13 +05:30
committed by Tim Abbott
parent aae11bf88d
commit bd0a5d5d69
5 changed files with 9 additions and 5 deletions

View File

@@ -461,6 +461,10 @@ def build_custom_checkers(by_lang):
' to set -x|set -e'},
] + whitespace_rules[0:1] # type: RuleList
css_rules = cast(RuleList, [
{'pattern': 'calc\([^+]+\+[^+]+\)',
'description': "Avoid using calc with '+' operator. See #8403 : in CSS.",
'good_lines': ["width: calc(20% - -14px);"],
'bad_lines': ["width: calc(20% + 14px);"]},
{'pattern': '^[^:]*:\S[^:]*;$',
'description': "Missing whitespace after : in CSS",
'good_lines': ["background-color: white;", "text-size: 16px;"],