Skip to content

Why negative sign before a variable inside round function is a syntax error #2523

Closed
@Sesna

Description

@Sesna

I'm migrating node-sass to dart-sass, this code works in node-sass, but got a syntax error in dart-sass.

.abc {
  $sqrt: 1.41;
  $dim: 30px;
  top: round(-$dim / $sqrt);
}
Image

https://sass-lang.com/playground/#eJwzNNRLTEpWqOZSUFApLiwqsVIw1DMxtAZxUzJzrRSMDQoqQLyS/AIrhaL80rwUDV2QjII+RL2mNVctAGRnEoU=

After looking through the official docs, I found that in the early version, the round is always parsed as a sass function
see docs: https://sass-lang.com/documentation/values/calculations/#round

But I look through the docs of variables and operators, I still don't know why -$dim / $sqrt inside round can't be compiled to round(-30px / 1.41)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions