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

Update @function documentation for css calc function changes #797

Closed
ntkme opened this issue Aug 10, 2023 · 0 comments · Fixed by #798
Closed

Update @function documentation for css calc function changes #797

ntkme opened this issue Aug 10, 2023 · 0 comments · Fixed by #798
Assignees

Comments

@ntkme
Copy link
Contributor

ntkme commented Aug 10, 2023

Since 1.65.0 pow() is always parsed as calculation instead of custom function. If user defines a custom function with the same name as native css function, Sass would not parse it as function any more.

It means the example that defines a custom pow() function is no longer correct and need to be updated: https://sass-lang.com/documentation/at-rules/function/

@function pow($base, $exponent) {
  $result: 1;
  @for $_ from 1 through $exponent {
    $result: $result * $base;
  }
  @return $result;
}

// This example still produce the same output, but the custom function is not called due to `pow(4, 3)` being parsed as calc.
.sidebar {
  float: left;
  margin-left: pow(4, 3) * 1px;
}

Also, it is probably worth to have a breaking change notice as some users got bite by this behavior change:

@pamelalozano16

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.

2 participants