jekyll / minima

Minima is a one-size-fits-all Jekyll theme for writers.
https://jekyll.github.io/minima/
MIT License
3.44k stars 3.62k forks source link

Saas `@import` is deprecated #815

Open martgil opened 1 week ago

martgil commented 1 week ago

This page from Sass documentation announced that usage of @import is deprecated: https://sass-lang.com/blog/import-is-deprecated.

The current theme however is still using this deprecated rule. When executing jekyll build, the warning the deprecation of the said rule is described where the source file for sass files is not present where it is installed.

I have this original Gemfile from fresh installation of jekyll project:

source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.4"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
  gem "tzinfo", ">= 1", "< 3"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
logs: ```bash jekyll build /home/mart/.rvm/gems/ruby-3.3.3/gems/jekyll-4.3.4/lib/jekyll.rb:28: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of jekyll-4.3.4 to add csv into its gemspec. /home/mart/.rvm/gems/ruby-3.3.3/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb:1: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. Also contact author of safe_yaml-1.0.5 to add base64 into its gemspec. Configuration file: /home/mart/Downloads/minima-test/minima-test/_config.yml Source: /home/mart/Downloads/minima-test/minima-test Destination: /home/mart/Downloads/minima-test/minima-test/_site Incremental build: disabled. Enable with --incremental Generating... Jekyll Feed: Generating feed for posts Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 1 │ @import "minima"; │ ^^^^^^^^ ╵ /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 48 │ "minima/base", │ ^^^^^^^^^^^^^ ╵ minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 49 │ "minima/layout", │ ^^^^^^^^^^^^^^^ ╵ minima.scss 49:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 50 │ "minima/syntax-highlighting" │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ minima.scss 50:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 18 │ $grey-color-light: lighten($grey-color, 40%) !default; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ minima.scss 18:20 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 81.6%) color.adjust($color, $lightness: 40%) More info: https://sass-lang.com/d/color-functions ╷ 18 │ $grey-color-light: lighten($grey-color, 40%) !default; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ minima.scss 18:20 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 19 │ $grey-color-dark: darken($grey-color, 25%) !default; │ ^^^^^^^^^^^^^^^^^^^^^^^^ ╵ minima.scss 19:20 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: darken() is deprecated. Suggestions: color.scale($color, $lightness: -49.0384615385%) color.adjust($color, $lightness: -25%) More info: https://sass-lang.com/d/color-functions ╷ 19 │ $grey-color-dark: darken($grey-color, 25%) !default; │ ^^^^^^^^^^^^^^^^^^^^^^^^ ╵ minima.scss 19:20 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 110 │ color: darken($brand-color, 15%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 110:12 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: darken() is deprecated. Suggestions: color.scale($color, $lightness: -28.5447761194%) color.adjust($color, $lightness: -15%) More info: https://sass-lang.com/d/color-functions ╷ 110 │ color: darken($brand-color, 15%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 110:12 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 235 │ color: lighten($text-color, 18%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 235:10 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 19.2857142857%) color.adjust($color, $lightness: 18%) More info: https://sass-lang.com/d/color-functions ╷ 235 │ color: lighten($text-color, 18%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 235:10 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 240 │ background-color: lighten($grey-color-light, 6%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 240:25 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Deprecation Warning: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 66.5217391304%) color.adjust($color, $lightness: 6%) More info: https://sass-lang.com/d/color-functions ╷ 240 │ background-color: lighten($grey-color-light, 6%); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../../../minima-2.5.2/_sass/minima/_base.scss 240:25 @import minima.scss 48:3 @import /home/mart/Downloads/minima-test/minima-test/assets/main.scss 1:9 root stylesheet Warning: 6 repetitive deprecation warnings omitted. Run in verbose mode to see all warnings. done in 0.186 seconds. Auto-regeneration: disabled. Use --watch to enable. ```
ashmaroli commented 1 week ago

Thank you for reporting this, @martgil. However, Minima won't be switching over to the @use API from DartSass in order to maintain compatibility for users still on Jekyll 3.x but using jekyll/minima:master via the jekyll-remote-theme plugin.

To reduce the warnings to a minimum, you may set the quiet_deps sass config in your config file as following:

# _config.yml

sass:
  quiet_deps: true

Ideally, silence_deprecation: import or silence_deprecations: [import] should also work, but for some reason, it doesn't. Perhaps @ntkme can provide insight on that.

ntkme commented 1 week ago

@ashmaroli PR to add new deprecation options: https://github.com/jekyll/jekyll-sass-converter/pull/164

Please take a look when you get a chance.

martgil commented 1 week ago

Thanks, @ashmaroli, for the detailed explanation, and @ntkme for creating the PR. I understand the reasoning and the decision.