style-merge icon indicating copy to clipboard operation
style-merge copied to clipboard

Incorrectly parsing calc(expr) functions

Open vladsandu opened this issue 3 years ago • 0 comments

We seem to be incorrectly parsing calc(expr) functions.

Input CSS:

body { 
	width: calc(100% - 32px);
	height: calc(100% - 64px); 
}

Output CSS:

body { 
	width: calc(100% = 32px);
	height: calc(100% = 64px); 
}

Short-term Workaround: Escaping the operator seems to fix the issue: width: calc(100% \- 32px)

Digging through the code, this is caused by the ExCSS Stylesheet parser. We are using a very old version of this, where this issue was probably occurring: https://github.com/TylerBrinks/ExCSS/issues/74. This seems to have been fixed in newer versions.

vladsandu avatar Mar 23 '21 15:03 vladsandu