Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.13 KB

File metadata and controls

63 lines (48 loc) · 1.13 KB

function-calc-no-unspaced-operator

Disallow an unspaced operator within calc functions.

a { top: calc(1px + 2px); }
/**               ↑
 * The space around this operator */

This rule checks that there is a single whitespace or a newline plus indentation before the + or - operator, and a single whitespace or a newline after that operator.

The fix option can automatically fix all of the problems reported by this rule.

Options

true

The following patterns are considered problems:

a { top: calc(1px+2px); }
a { top: calc(1px+ 2px); }

The following patterns are not considered problems:

a { top: calc(1px + 2px); }
a { top: calc(calc(1em * 2) / 3); }
a { top: calc(calc(1em*2)/3); }
a {
  top: calc(var(--foo) +
    var(--bar));
}
a {
  top: calc(var(--foo)
    + var(--bar));
}