migrator icon indicating copy to clipboard operation
migrator copied to clipboard

Handle case where configuration variable has already been patched

Open jathak opened this issue 7 years ago • 2 comments

Right now something like:

// entrypoint.scss
$background: mix(red, blue)
@import "library";

// _library.scss
$background: green !default;

would error, since the patch to add the color namespace and the patch to delete the configuration variable would conflict.

We should handle this case by removing the existing patches and instead applying them to the configuration, e.g:

@use "sass:color";
@use "library" with ($background: color.mix(red, blue));

jathak avatar Apr 26 '19 23:04 jathak

In the first example, is $background: green supposed to have a !default flag?

nex3 avatar Apr 27 '19 00:04 nex3

Yes. Fixed.

jathak avatar Apr 29 '19 16:04 jathak