qodesmith / datepicker

Get a date with JavaScript! A datepicker with no dependencies.
344 stars 101 forks source link

Replace Sass Division with Multiplication to Resolve Dart Sass Deprecation Warnings #122

Closed chadrschroeder closed 1 year ago

chadrschroeder commented 2 years ago

When I use Webpack to import the Sass from this project in my app I get deprecation warnings like:

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

Recommendation: math.div($transition, 2)

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

    ╷
119 │     transition: opacity $transition / 2;
    │                         ^^^^^^^^^^^^^^^
    ╵
    node_modules/js-datepicker/src/datepicker.scss 119:25  @import

This pull request will replace the use of division with multiplication. The updates here are similar to this pull request in the Bootstrap repo.

The compiled results should be identical to what they were before. But I didn't know exactly which compression rules you were using to generate datepicker.min.css, so you may want to test to make sure the results really are the same.

qodesmith commented 2 years ago

Sweet, thanks for the PR! I'm gonna test this in a bit and see if the generated results are good.

qodesmith commented 2 years ago

For the life of me, I can't figure out what's going on. The calc's are now being stripped out of the final minified css. Those need to be in there. It's not from your code. Nothing has changed, yet the build output is different.

qodesmith commented 1 year ago

This has been resolved in a different PR. Latest version 5.18.1 has been published to npm!