Add support for negative calc values

This commit is contained in:
Ari Seyhun 2019-08-01 13:32:10 +09:30
parent 03b73b135d
commit d3675ebd23
2 changed files with 5 additions and 1 deletions

View file

@ -12,7 +12,7 @@ const configUtils = {
.reduce(
(negativeScale, key) => ({
...negativeScale,
[`-${key}`]: startsWith(scale[key], 'var(')
[`-${key}`]: ['var(', 'calc('].some(prefix => startsWith(scale[key], prefix))
? `calc(${scale[key]} * -1)`
: `-${scale[key]}`,
}),