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

@@ -336,7 +336,7 @@ input.recipient_box {
} }
#subject.recipient_box { #subject.recipient_box {
width: calc(20% + 14px); width: calc(20% - -14px);
min-width: 140px; min-width: 140px;
max-width: 165px; max-width: 165px;
} }

View File

@@ -1169,7 +1169,7 @@ input#zulipbot:checked ~ #tab-zulipbot {
.login-form { .login-form {
margin: auto; margin: auto;
/* plus input padding. */ /* plus input padding. */
width: calc(300px + 28px); width: calc(300px - -28px);
margin-bottom: 10px; margin-bottom: 10px;
} }
@@ -1696,7 +1696,7 @@ input.new-organization-button {
margin-top: -240px; margin-top: -240px;
height: auto; height: auto;
width: calc(100% - 40px); width: calc(100% - 40px);
max-width: calc(768px + 20px); max-width: calc(768px - -20px);
} }
.error_page { .error_page {

View File

@@ -526,7 +526,7 @@ input[type=checkbox].inline-block {
} }
.add-new-filter-box button { .add-new-filter-box button {
margin-left: calc(10em + 20px) !important; margin-left: calc(10em - -20px) !important;
} }
.grey-box .wrapper { .grey-box .wrapper {

View File

@@ -483,7 +483,7 @@ form#add_new_subscription {
} }
.subscriptions-container .right { .subscriptions-container .right {
width: calc(50% + 1px); width: calc(50% - -1px);
} }
.subscriptions-container .right .nothing-selected { .subscriptions-container .right .nothing-selected {

View File

@@ -461,6 +461,10 @@ def build_custom_checkers(by_lang):
' to set -x|set -e'}, ' to set -x|set -e'},
] + whitespace_rules[0:1] # type: RuleList ] + whitespace_rules[0:1] # type: RuleList
css_rules = cast(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[^:]*;$', {'pattern': '^[^:]*:\S[^:]*;$',
'description': "Missing whitespace after : in CSS", 'description': "Missing whitespace after : in CSS",
'good_lines': ["background-color: white;", "text-size: 16px;"], 'good_lines': ["background-color: white;", "text-size: 16px;"],