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

Fix deprecation warnings from Dart Sass #700

Merged
merged 1 commit into from
Dec 26, 2022
Merged

Fix deprecation warnings from Dart Sass #700

merged 1 commit into from
Dec 26, 2022

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Dec 24, 2022

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

However, math.div is not supported by sass or sassc used in older version of jekyll-sass-converter. Therefore this PR fixes it in a backward compatible way by replaceing / 2 with * .5, and replacing / 3 with * 33.3333333333 * .01 (a hack for precision in Sass). The css output is exactly same as before.

@ashmaroli

@ashmaroli ashmaroli closed this Dec 25, 2022
@ashmaroli ashmaroli reopened this Dec 25, 2022
@ashmaroli
Copy link
Member

@ntkme Thanks for submitting a proposal. But why can't we use calc() like the deprecation message suggests?

@ntkme
Copy link
Contributor Author

ntkme commented Dec 25, 2022

We can, but calc is less performant here. The idea of calc is that you can compute based on dynamic values that changes, e.g. calc(100% - 30px), at runtimes. calc(30px / 2) certainly works, but is less optimal since it can be replaced with a constant.

@ashmaroli ashmaroli changed the title Fix deprecation warnings Fix deprecation warnings from Dart Sass Dec 26, 2022
@ashmaroli
Copy link
Member

Thanks @ntkme
@jekyylbot: merge +fix

@jekyllbot jekyllbot merged commit 21b4274 into jekyll:master Dec 26, 2022
jekyllbot added a commit that referenced this pull request Dec 26, 2022
@ntkme ntkme deleted the fix-deprecation-warnings branch December 26, 2022 16:47
@CarloWood
Copy link

Has this been released in a new version yet?

@patch-work
Copy link

grep -rai "spacing-unit / 2" /opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima.scss://     padding-right: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima.scss://     padding-left: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_base.scss:  margin-bottom: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_base.scss:  padding-left: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_base.scss:    padding-right: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_base.scss:    padding-left: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_base.scss:    padding: ($spacing-unit / 3) ($spacing-unit / 2);
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_layout.scss:    right: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_layout.scss:  margin-bottom: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_layout.scss:  margin-left: -$spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_layout.scss:  margin-bottom: $spacing-unit / 2;
/opt/ruby/lib/ruby/gems/3.2.0/gems/minima-2.5.1/_sass/minima/_layout.scss:  padding-left: $spacing-unit / 2;

@agregen
Copy link

agregen commented Sep 9, 2023

Has this been released in a new version yet?

The latest release was made over 4 years ago…

@DaveEveritt
Copy link

I see here https://github.com/jekyll/minima/tree/master/_sass/minima that "Fix deprecation warnings from Dart Sass" #700 is done, so can someone please explain why - although I have the latest Jekyll and minima in my Gemfile - that I’m still getting these deprecation warnings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SASS moving to math.div and Minima is using deprecated division
8 participants