postcss / postcss-calc

PostCSS plugin to reduce calc()
MIT License
213 stars 34 forks source link

Transformation removes of inner calc #64

Closed leimonio closed 5 years ago

leimonio commented 5 years ago

ccsnano offers some configurable optimizations, like calc. Using webpack with optimize-css-assets-webpack-plugin for production builds results in transforming calc(100vh - 5rem - calc(10rem + 100px)) to calc(100vh - 5rem - 10rem + 100px).

This is not happening though when disabling calc optimizations on default preset

preset: [`default`, { calc: false }]

To be more specific I'm trying to solve this issue gatsbyjs/gatsby#9858

(Opening issue as mentioned in https://github.com/cssnano/cssnano/issues/657#issuecomment-442144659)

andyjansson commented 5 years ago

Thanks for the report. Will try to fix so it outputs the correct transformation.

alexander-akait commented 5 years ago

/cc @andyjansson let's fix this issue and release new version of cssnano, thanks for helping