Add support for calc for margin and padding. Other properties such as width, top, ... already support calc.
More properties should support calc, but I haven't included them all in this PR:
background-position: calc(100% - 0%) calc(100% - 10%). Not included because parse function splits on whitespace, but whitespace can also occur inside calc parentheses.
border-bottom-width (and other "length" types): uses parseLength (from parsers.js), didn't want to change because too many usages. It could be done though, for example parseMeasurement already allows calc.
Add support for
calc
formargin
andpadding
. Other properties such aswidth
,top
, ... already support calc.More properties should support
calc
, but I haven't included them all in this PR:background-position: calc(100% - 0%) calc(100% - 10%)
. Not included becauseparse
function splits on whitespace, but whitespace can also occur inside calc parentheses.border-bottom-width
(and other "length" types): usesparseLength
(fromparsers.js
), didn't want to change because too many usages. It could be done though, for exampleparseMeasurement
already allowscalc
.This PR should fix https://github.com/jsdom/cssstyle/issues/154