Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.67.0 reports wrong source span for abs-percent deprecation warning #2081

Closed
ntkme opened this issue Sep 14, 2023 · 2 comments · Fixed by #2084
Closed

1.67.0 reports wrong source span for abs-percent deprecation warning #2081

ntkme opened this issue Sep 14, 2023 · 2 comments · Fixed by #2084

Comments

@ntkme
Copy link
Contributor

ntkme commented Sep 14, 2023

Followings are the deprecation warning output of compiling twbs/bootstrap. Dart Sass 1.67.0 appears to have incorrect source span for the abs-percent deprecation warning.

With sass 1.66.1:

Deprecation Warning: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent

   ╷
57 │   $dividend: abs($dividend);
   │              ^^^^^^^^^^^^^^
   ╵
    scss/vendor/_rfs.scss 57:14         divide()
    scss/mixins/_grid.scss 59:12        row-cols()
    scss/mixins/_grid.scss 85:13        @content
    scss/mixins/_breakpoints.scss 68:5  media-breakpoint-up()
    scss/mixins/_grid.scss 72:5         make-grid-columns()
    scss/_grid.scss 38:3                @import
    scss/bootstrap.scss 20:9            root stylesheet


With sass 1.67.0:

Deprecation Warning: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent

   ╷
1  │ ┌ @import "mixins/banner";
2  │ │ @include bsBanner("");
3  │ │ 
4  │ │ 
5  │ │ // scss-docs-start import-stack
6  │ │ // Configuration
7  │ │ @import "functions";
8  │ │ @import "variables";
9  │ │ @import "variables-dark";
10 │ │ @import "maps";
11 │ │ @import "mixins";
12 │ │ @import "utilities";
13 │ │ 
14 │ │ // Layout & components
15 │ │ @import "root";
16 │ │ @import "reboot";
17 │ │ @import "type";
18 │ │ @import "images";
19 │ │ @import "containers";
20 │ │ @import "grid";
21 │ │ @import "tables";
22 │ │ @import "forms";
23 │ │ @import "buttons";
24 │ │ @import "transitions";
25 │ │ @import "dropdown";
26 │ │ @import "button-group";
27 │ │ @import "nav";
28 │ │ @import "navbar";
29 │ │ @import "card";
30 │ │ @import "accordion";
31 │ │ @import "breadcrumb";
32 │ │ @import "pagination";
33 │ │ @import "badge";
34 │ │ @import "alert";
35 │ │ @import "progress";
36 │ │ @import "list-group";
37 │ │ @import "close";
38 │ │ @import "toasts";
39 │ │ @import "modal";
40 │ │ @import "tooltip";
41 │ │ @import "popover";
42 │ │ @import "carousel";
43 │ │ @import "spinners";
44 │ │ @import "offcanvas";
45 │ │ @import "placeholders";
46 │ │ 
47 │ │ // Helpers
48 │ │ @import "helpers";
49 │ │ 
50 │ │ // Utilities
51 │ │ @import "utilities/api";
52 │ └ // scss-docs-end import-stack
   ╵
    scss/bootstrap.scss 1:1             divide()
    scss/mixins/_grid.scss 59:12        row-cols()
    scss/mixins/_grid.scss 85:13        @content
    scss/mixins/_breakpoints.scss 68:5  media-breakpoint-up()
    scss/mixins/_grid.scss 72:5         make-grid-columns()
    scss/_grid.scss 38:3                @import
    scss/bootstrap.scss 20:9            root stylesheet

@ntkme
Copy link
Contributor Author

ntkme commented Sep 15, 2023

bootstrap just fixed abs deprecation warning in 5.3.2. So here is a minimum reproduction instead:

a {
  b: c;
}

d {
  e: calc(abs(100%));
}
Deprecation Warning: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent

  ╷
1 │ ┌ a {
2 │ │   b: c;
3 │ │ }
4 │ │ 
5 │ │ d {
6 │ │   e: calc(abs(100%));
7 │ └ }
  ╵
    a.scss 1:1  root stylesheet

@ntkme
Copy link
Contributor Author

ntkme commented Sep 15, 2023

The issue is that in 1.66.1 abs() is evaluated with _runBuiltInCallable so that it sets the _callableNode to the abs() span, in 1.67.0 abs() is simplified without setting _callableNode, therefore causing an incorrect span to be reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant