- Add a
--pkg-importer
flag to enable loading dependencies frompkg:
URLs with the same behavior as the compiler. Currently this only supports the Node.js package resolution algorithm, via--pkg-importer=node
. For example,@use "pkg:bootstrap"
will loadnode_modules/bootstrap/scss/bootstrap.scss
.
- Fix a bug where plain CSS
min()
andmax()
functions would incorrectly be migrated tomath.min()
andmath.max()
.
-
Add a new
--built-in-only
flag, which migrates global functions to theirsass:
module equivalents, while leaving@import
rules unchanged. -
Fix bug where some functions (
opacity
,is-bracketed
, andselector-extend
) would not be migrated.
- Adds a new
color
migrator that migrates off of legacy color functions that were deprecated in Dart Sass 1.79.0.
- Fixes some crashes due to null pointer errors.
- Fix the interpretation of a dash in a variable name as a minus sign.
- Add parentheses in place of interpolation when necessary to preserve the evaluation order.
- Keep interpolation in
var()
CSS functions.
-
Breaking change: The
media-logic
migrator has been removed as the corresponding breaking change has been completed in Dart Sass. If you still need to migrate legacy code, use migrator version 1.8.1. -
Update to be compatible with the latest version of the Dart Sass AST.
/
division should now be left untouched in all CSS calculation functions. This was already the case forcalc
,clamp
,min
, andmax
, but it now applies to the new functions that Dart Sass 1.67.0 added support for.
- Migration for more than one interpolation or expressions in a calc function parameter.
- Removes interpolation in calculation functions
calc()
,clamp()
,min()
, andmax()
. See the scss/function-calculation-no-interpolation rule for more information.
- Fixes a bug where path arguments on the command line were incorrectly treated as URLs, resulting in errors finding paths containing certain special characters.
- Fixes a rare crash in certain cases involving reassignments of variables from another module.
- Eliminates invalid warnings when running
--migrate-deps
on a file that uses a built-in module.
- Adds a new migrator for migrating deprecated
@media
query logic.
- Add a new migrator for eliminating ambiguous syntax for the
+
and-
operators that will soon be deprecated.
- No user-visible changes.
- No user-visible changes.
- Fix a bug where the built-in function
keywords
was incorrectly migrated.
- Fix a bug where division inside calc expressions was unnecessarily migrated.
- No user-visible changes.
- Fix a bug where some division nested in a parenthesized expression would not be migrated.
-
When migrating division where the divisor is a common constant value, the migrator will now convert it to multiplication, rather than
math.div
.For example:
$variable / 2
would be migrated to$variable * 0.5
.To disable this and migrate all division to
math.div
, pass--no-multiplication
.
- Glob syntax will no longer be resolved if a file with that literal name exists.
- Fix a bug where
@use "sass:math"
would sometimes be incorrectly inserted after other rules.
- Fix a crash when encountering parentheses in an expression that's definitely not division.
- Fix a bug where negated division could be migrated incorrectly.
- Globs containing
**
should now be properly resolved when running on Node.
- The division migrator is now enabled, and will convert slash-as-division to
the
math.div
function.
- Fix crash when running on Node.
- No user-visible changes.
- Fix a crash in a rare edge case involving orphan import-only files and multiple load paths.
- Fix a bug that could result in unnecessary import-only files being generated
when running
--forward=import-only
on a file with no dependencies.
-
Fix a bug where
@use
rules could be duplicated if the same file is depended on via both an indirect@import
and an existing@use
rule. -
Fix a bug where imports of orphan import-only files that only forward other import-only files would not be removed.
- Fix a crash when resolving references to orphan import-only files in a different directory from the file depending on them.
- No user-visible changes.
- Fix a bug on Windows where load paths would not be used in some cases.
-
Prefixes will now be removed from private members (e.g. a variable
$_lib-variable
will be renamed to$_variable
when--remove-prefix=lib-
is passed). -
Fix a bug where private members would be incorrectly added to
hide
clauses in generated import-only files.
-
Add a new migrator for changing namespaces of
@use
rules.This migrator lets you change namespaces by matching regular expressions on existing namespaces or on
@use
rule URLs.You do this by passing expressions to the
--rename
in one of the following forms:-
<old-namespace> to <new-namespace>
: The<old-namespace>
regular expression matches the entire existing namespace, and<new-namespace>
is the replacement. -
url <rule-url> to <new-namespace>
: The<old-namespace>
regular expression matches the entire URL in the@use
rule, and<new-namespace>
is the namespace that's chosen for it.
The
<new-namespace>
patterns can include references to captured groups from the matching regular expression (e.g.\1
).You can pass
--rename
multiple times and they will be checked in order until one matches (at which point subsequent renames will be ignored). You can also separate multiple rename expressions with semicolons or line breaks.By default, if the renaming results in a conflict between multiple
@use
rules, the migration will fail, but you can force it to resolve conflicts with numerical suffixes by passing--force
. -
-
Fix a bug where generated import-only files for index files would contain invalid forwards.
-
Better handling for import-only files without corresponding regular files, including fixing a crash when
@import
rules for two files like this are adjacent to each other. -
Midstream files that both forward configurable variables and configure other variables themselves should now be properly migrated.
-
When an
@import
rule is migrated to both a@use
rule and a@forward
rule, both rules will now be migrated in-place (previously, the@use
rule would replace the@import
rule and the@forward
rule would be added after all other dependencies).
- The migrator now properly migrates built-in function calls with underscores
(e.g.
map_get
).
- The migrator no longer crashes when it encounters an import-only file without a corresponding regular file.
- If an import-only file does not forward its corresponding regular file, the
migrator no longer includes a
@use
rule for it.
- Updates help text to use the correct binary name (
sass-migrator
).
- No user-visible changes.
- Fixes a bug where semicolons would be missing when migrating an
@import
rule with multiple imports.
-
The
--remove-prefix
flag can now take multiple prefixes. -
Correctly migrate assignments to members in already-migrated modules.
- Fix a few bugs when migrating files that imported members through multiple layers of import-only files.
-
When generating import-only files that for files that used to import import-only files, forward the upstream import-only files.
-
Don't double-prefix members imported from a prefixed
@forward
rule.
- Don't remove prefixes from members that would become invalid identifiers afterwards.
- Generate better
@use
rules for index files.
-
When using
--forward=import-only
,@forward
rules in an import-only file are now sorted with the regular file last, allowing variables in indirect dependencies to be configured. -
Fixes a bug where some references weren't renamed if a variable is declared twice when using
--remove-prefix
.
- Add support for glob inputs on the command line.
-
Add
--forward=import-only
option, which will not forward any members through the regular entrypoint, but it will forward all members through the entrypoint's import-only file.--forward=prefixed,import-only
is also supported, which will forward prefixed members through the regular entrypoint and all members through the import-only file. -
Make
--remove-prefix=<prefix> --forward=prefixed
forward members that previously started with<prefix>
and were unprefixed by a previous migrator run. This includes cases where the previously removed prefix is longer than the prefix for the current migrator run. -
Better handling when migrating files whose dependencies have complex import-only files.
-
Improve ordering of
@use
and@forward
rules. -
Fix a bug in the migrating of configurable variables. Variables should now only be considered configured when the configuring declaration is upstream of the
!default
declaration. -
When namespacing a negated variable, adds parentheses around it to prevent the
-
from being parsed as part of the namespace. -
Fix a bug in the migrating of removed color functions when the amount is a variable being namespaced.
- Initial release.