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

A bug when compiling @include boxShadow(inset 0 -$depth 0 0 rgba(0, 0, 0, 0.15)); #2601

Closed
tanin47 opened this issue Feb 2, 2019 · 1 comment

Comments

@tanin47
Copy link

tanin47 commented Feb 2, 2019

It seems Sass drops the first zero. Here's the minimal reproducible example:

$ sass --scss src.scss  test.css

$ cat src.scss
@mixin boxShadow($statement){
  -webkit-box-shadow: $statement;
  -moz-box-shadow: $statement;
  box-shadow: $statement;
}
@mixin buttonSize($depth){
  @include boxShadow(inset 0 -$depth 0 0 rgba(0, 0, 0, 0.15));
}
.test {
  @include buttonSize(3px);
}

$ cat test.css
.test {
  -webkit-box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.15);
  -moz-box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.15);
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.15); }

/*# sourceMappingURL=test.css.map */

Please notice that: @include boxShadow(inset 0 -$depth 0 0 rgba(0, 0, 0, 0.15)); in src.scss is compiled to inset -3px 0 0 rgba(0, 0, 0, 0.15); in test.css.

The root cause is definitely the - in -$depth. Once I remove that minus sign and use @include buttonSize(-3px) instead, it works properly.

@nex3
Copy link
Contributor

nex3 commented Feb 2, 2019

Duplicate of #1912.

@nex3 nex3 closed this as completed Feb 2, 2019
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

No branches or pull requests

2 participants