csstools/precss

Any breaking changes in v3?

Closed this issue · 3 comments

The changelog for v3 mentions that the code has been completely rewritten but doesn't say if the APIs have changed or if there are any breaking changes. Is it safe to upgrade to v3?

I think it does have breaking changes, I tried to upgrade my dependencies in my project, and webpack3 keep throws me error on variables during compilation. After change it back to version 2, it works again.

Hopefully, you can build the project using rollup because in a lot of node environment, it does not support import.

The original issue is resolved by aaedc9e

The last comment is resolved by 8876377

Yes, precss 3 is a major update, and a breaking update if you were using the non-Sass @mixin syntax, or if you were using the old color() function.

PostCSS Advanced Variables handles all Sass-like variables and at-rules, which means Sass @mixin, @include, and @content syntax work like Sass now. This also means the PostCSS Mixins non-Sass syntax no longer works. There is also an “un-breaking” change, because @import is now an at-rule handled by PostCSS Advanced Variables, which means @import statements can now be placed other than at the top of the document.

Second, PostCSS Preset Env handles all future CSS syntax. Other than color() being renamed to color-mod by the CSSWG, nothing has changed that I know of. However, other future syntaxes may begin working if they weren’t previously.