- Instant help with your CSS coding problems

Fix the Using / for division outside of calc() is deprecated

Question:
How to fix the Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.?
Answer:
@use "sass:math";
math.div($gutter / 3);

// OR simply
calc($gutter / 3);
Description:

In future new versions of sass, you will not be able to use slash as a division except for the calc() function. Current sass compilers such as dart-sass warn about this with the following warning message:

Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($gutter, 3) or calc($gutter / 3)

More info and automated migrator: https://sass-lang.com/d/slash-div
You have two options to deal with the problem:
  1. Use the math module and the math.div() function:

    @use "sass:math";
    math.div($gutter / 3);​

     

  2. Use the old calc() function:

    calc($gutter / 3);​
Share "How to fix the Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.?"
Tags:
deprecation, warning, sass, scss, division, calc, removed
Technical term:
Fix the Using / for division outside of calc() is deprecated waring
Interesting things
OpanAi's ChatGPT