Skip to content

Files

Latest commit

 

History

History
49 lines (35 loc) · 830 Bytes

function-calc-no-unspaced-operator.md

File metadata and controls

49 lines (35 loc) · 830 Bytes

Pattern: Unspaced operator in calc()

Issue: -

Description

Before the operator, there must be a single whitespace or a newline plus indentation. After the operator, there must be a single whitespace or a newline.

Examples

The following patterns are considered violations:

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

The following patterns are not considered violations:

a { top: calc(1px + 2px); }
/**               ↑
 * The space around this operator */
a { top: calc(calc(1em * 2) / 3); }
a {
  top: calc(var(--foo) +
    var(--bar));
}
a {
  top: calc(var(--foo)
    + var(--bar));
}

Further Reading