sass / migrator

Tool for migrating stylesheets to new Sass versions
MIT License
84 stars 10 forks source link

division: it fails to convert on some expressions #202

Closed myakura closed 3 years ago

myakura commented 3 years ago

Hello folks. Thanks for providing this tool. I was able to migrate my SCSS files without too much effort.

One thing I found while migrating is there seems to be some cases it does not convert slash to math.div() or multiplication. Here's the snippet from such code.

-      left: ($gutter / 2 * -1) - ( $_icon-size / 2 );
+      left: ($gutter / 2 * -1) - ( $_icon-size * 0.5 );

Here, ($gutter / 2 * -1) stays the same but it should be converted. I guess 2 * -1 is a bit tricky for the converter? Besides this, the converted files compiled with no error. Again thanks for working on it!

jathak commented 3 years ago

It looks like there's a bug where we're not visiting many parenthesized expressions. The bug is actually in the Dart Sass codebase, so I'll cut a new release of the migrator once the fix is merged there.