org.sonar.l10n.css.rules.css.S4650.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-javascript-plugin Show documentation
Show all versions of sonar-javascript-plugin Show documentation
Code Analyzer for JavaScript/TypeScript/CSS
calc
is a CSS3 function that provides the possibility to do simple math in CSS (add, subtract, divide, multiply). Without spaces
around operators, calc
will have no effect.
More precisely, before an operator, there must be a single whitespace or a newline plus indentation. After an operator, there must be a single
whitespace or a newline.
Noncompliant Code Example
#div1 {
position: absolute;
width: calc(100%- 100px); /* Noncompliant; no space after the % sign */
}
Compliant Solution
#div1 {
position: absolute;
width: calc(100% - 100px);
}