Skip to content

Commit

Permalink
fix(sass): use map.inspect instead of inspect to avoid deprecatio…
Browse files Browse the repository at this point in the history
…n warnings

Error:
- Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use meta.inspect instead.

Reason:
- We are deprecating the global functions now that the module system has been available for several years in sass: modules.
While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0.

Solution:
- Import the `sass:meta` module to use the functions: `@use "sass:meta"`
You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in.
- Use `meta.inspect` instead of `inspect()`:
From `inspect(map.get($breakpoints, $breakpoint))` to `meta.inspect(map.get($breakpoints, $breakpoint))`.

References:
- https://sass-lang.com/d/import
- https://sass-lang.com/documentation/modules/meta/#inspect
  • Loading branch information
beatrizsmerino committed Oct 22, 2024
1 parent 3912550 commit 8812be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets/scss/tools/tools-media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
} @else if meta.variable-exists(breakpoints) {
@if map.has-key($breakpoints, $breakpoint) {
@media (#{$rule}-#{$dimension}: #{inspect(map.get($breakpoints, $breakpoint))}) {
@media (#{$rule}-#{$dimension}: #{meta.inspect(map.get($breakpoints, $breakpoint))}) {
@content;
}
} @else {
Expand Down

0 comments on commit 8812be7

Please sign in to comment.