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

Saas @import is deprecated #815

Open
martgil opened this issue Oct 27, 2024 · 6 comments
Open

Saas @import is deprecated #815

martgil opened this issue Oct 27, 2024 · 6 comments

Comments

@martgil
Copy link

martgil commented Oct 27, 2024

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:
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
Copy link
Member

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.

@ashmaroli ashmaroli pinned this issue Oct 27, 2024
@ntkme
Copy link
Contributor

ntkme commented Oct 27, 2024

@ashmaroli PR to add new deprecation options: jekyll/jekyll-sass-converter#164

Please take a look when you get a chance.

@martgil
Copy link
Author

martgil commented Oct 28, 2024

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

@UlyssesZh
Copy link

The correct way is to ask users using Jekyll 3 to write gem 'minima', '< xxx' in their Gemfile, where xxx is the first version of minima that migrated to @use.

@maxkapur
Copy link

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.

If I understand correctly, you are saying that neither the v2.x branch nor the v3.x branch of Minima will be updated to the new DartSass API, right?

Is there any pathway to a later breaking release that is compatible with DartSass v3.x?

@ashmaroli
Copy link
Member

@maxkapur Yes, you understood my earlier comment correctly. But I have thought about this situation over these days.
We may migrate to Dart Sass API completely given that there are already unreleased breaking changes on the default branch.

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

No branches or pull requests

5 participants