Open
Description
When using the migrator with npx sass-migrator module --migrate-deps src/theme/theme.scss
Some variables get renamed
Example
- $--color-info-light: mix($--color-white, $--color-info, 80%) !default;
- $--color-success-light: mix($--color-white, $--color-success, 80%) !default;
- $--color-warning-light: mix($--color-white, $--color-warning, 80%) !default;
- $--color-danger-light: mix($--color-white, $--color-danger, 80%) !default;
+ $-color-success-light: color.mix($-color-white, $-color-success, 80%) !default;
+ $-color-warning-light: color.mix($-color-white, $-color-warning, 80%) !default;
+ $-color-danger-light: color.mix($-color-white, $-color-danger, 80%) !default;
+ $--color-info-light: color.mix($-color-white, $-color-info, 80%) !default;
I do not want this renaming to happen, I tried with --remove-prefix=app
but that changed nothing
migrator/lib/src/migrators/module.dart
Lines 346 to 366 in 364b644
Seems there is no way to opt out, every variable starting with -
will have one -
removed if it's referenced outside the file
Repro:
//test.scss
@import "test2";
$color-black: $--color-black;
//test2.scss
$--color-black: #000000 !default;
npx sass-migrator module --migrate-deps test.scss
And also
npx sass-migrator module --migrate-deps test.scss --remove-prefix=--
Results in
@use "test";
$color-black: test.$-color-black;
Which is unexpected