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: mitigate Dart Sass depreciation warnings #2027

Closed
wants to merge 2 commits into from

Conversation

classicrocker883
Copy link
Contributor

@classicrocker883 classicrocker883 commented Nov 2, 2024

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (refactoring and improving code)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Description

When using bundle exec jekyll s this warning appears:

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

So, I performed the following:

$ npm install -g sass-migrator
$ sass-migrator module --migrate-deps _sass/main.scss

This automatically made most of the changes, but then I had to manually make a few others like:

  • add ../ to 'colors/syntax-light'; / dark
  • manually change @import to @use in main.bundle.scss + jekyll-theme-chirpy.scss
  • change @extend * with sed -i 's/@extend [^;]*/& !optional/g' FILENAME to be like.... @extend * !optional;

Additional context

These changes will fix the error/warning for depreciation

@cotes2020
Copy link
Owner

Hi @classicrocker883,

Thank you for contributing to the improvement of the source code. This deprecation warning will not affect the normal operation of the project within the next two years. Instead of using automated tools to change @import to @use, I believe the best approach is to improve the existing Sass architecture of the project to align with the design principles of @use. However, this is not a task that can be completed in a day or two.

Before that happens, if you do not want to see these warning messages, you can modify the Sass options in the configuration file:

# _config.yml
sass:
  quiet_deps: true

@ZhengYuan-Public
Copy link
Contributor

@cotes2020 Hi, I've added quiet_deps: true in the config file and most warnings are gone. However the following one is still showing. What should I do?

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 'main';
  │         ^^^^^^
  ╵

@cotes2020 cotes2020 mentioned this pull request Nov 20, 2024
2 tasks
@github-actions github-actions bot added the released Included or resolved in the release label Nov 28, 2024
Repository owner deleted a comment from github-actions bot Nov 29, 2024
@cotes2020 cotes2020 removed the released Included or resolved in the release label Nov 29, 2024
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

Successfully merging this pull request may close these issues.

3 participants