csstools / postcss-preset-env

Convert modern CSS into something browsers understand
https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env
Creative Commons Zero v1.0 Universal
2.22k stars 90 forks source link

Error in calc() #193

Closed fedorovsky closed 3 years ago

fedorovsky commented 3 years ago

This code throws a compilation error:

:root {
    --variable-top: 50px;
}

.some-class {
    margin-top: calc(-1 * var(--variable-top)); 
}

The problem is -1. But my code above is valid. But if I change -1 to -1px, it works

margin-top: calc(-1px * var(--variable-top)); 

image