twbs / bootstrap-rubygem

Bootstrap rubygem for Rails / Sprockets / Hanami / etc
https://rubygems.org/gems/bootstrap
MIT License
2.02k stars 447 forks source link

Sass Division Depreciation Warning #220

Open Okomikeruko opened 3 years ago

Okomikeruko commented 3 years ago

When running a compiler on the scss files in this repository I recently got about 16 of these warnings pointing to various lines in 3 different file names:

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($rfs-base-value, math.div($rfs-base-value * 0 + 1, $rfs-rem-value))

More info and automated migrator: [https://sass-lang.com/d/slash-div](https://sass-lang.com/d/slash-div)

62 │   $rfs-base-value: $rfs-base-value / ($rfs-base-value * 0 + 1 / $rfs-rem-value);

    .../bootstrap/vendor/_rfs.scss 62:20  @import

It looks like Sass is depreciating the / operator for division and replacing it with math.div(a, b); which requires the use of @use 'sass:math'; in the .scss files.

The files listed containing multiple instances of this error were:

This is more of Bootstrap's problem than this gem specifically. I just wanted to share my discovery in case it leads to something more substantial later. BTW. I'm only using the bootstrap-grid.scss file, so there may be more instances of division by \ that need replacing throughout.

jdelStrother commented 3 years ago

Presumably this would be fixed by updating to the Bootstrap 5.0.2 release (https://github.com/twbs/bootstrap-rubygem/pull/223)