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

Deprecation warnings Dart Sass 3.0.0 #470

Closed
Crossed-Omega opened this issue Nov 17, 2024 · 9 comments · Fixed by #478
Closed

Deprecation warnings Dart Sass 3.0.0 #470

Crossed-Omega opened this issue Nov 17, 2024 · 9 comments · Fixed by #478
Assignees
Labels
dependencies Pull requests that update a dependency file fix

Comments

@Crossed-Omega
Copy link

Upon using bundle exec jekyll serve the generator emits many warnings about the deprecation of the @import system in Dart Sass.

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 "type-on-strap";
  │         ^^^^^^^^^^^^^^^
  ╵
    C:\Users\Windows-PC\Documents\Coding\Jekyll\type-on-strap\Type-on-Strap\assets\css\main.scss 1:9  root stylesheet

The webpage linked by Sass has an automatic migrator that can be ran over the style sheets with

$ npm install -g sass-migrator
$ sass-migrator module --migrate-deps your-entrypoint.scss

or, alternatively on Windows, downloading the dart executable and running (dry run and normal run emit the same exception)

.\sass-migrator module --migrate-deps -n C:\Users\Windows-PC\Documents\Coding\Jekyll\type-on-strap\Type-on-Strap\assets\css\main.scss

This however yields an exception that complains about an element miss in a list. Fairly sure that this is a bug on Sass-migrators' side.

Obviously, it would be nice to fix the deprecation warnings so as to not clutter the generation output, as well as future stability.

@sylhare
Copy link
Owner

sylhare commented Nov 18, 2024

I think the problem is from the GitHub Page gem which does not support the most recent jekyll-sass-converter.
cf: github/pages-gem#813

If I wear to update, not sure how compatible it will be as a GitHub page.

@Crossed-Omega
Copy link
Author

Hmm, fair. Is this a roadblock that needs to be cleared from GitHub Pages' side or is manual conversion possible? I use GitLab pages, I am fairly sure they have different compatibilities.

@sylhare
Copy link
Owner

sylhare commented Nov 20, 2024

From the link https://sass-lang.com/documentation/breaking-changes/import/ it says:

We’re deprecating both Sass @import rules and global built-in functions now that the module system (@use and @forward rules) has been available for several years.

So the new way might be compatible with the older jekyll-sass-converter 🤔
I can try it out, see if I can do the migration and make it work.

@sylhare
Copy link
Owner

sylhare commented Nov 26, 2024

@Crossed-Omega good news! After digging into how to migrate and remove the deprecated scss notation, it seems that there's no problem running it with the current version of jekyll-sass-converter

I had to run the sass migration on the fontawesome lib still, but now there's no more warning that I can see.
I'll close the issue.

@sylhare sylhare closed this as completed Nov 26, 2024
@sylhare sylhare reopened this Nov 26, 2024
@sylhare
Copy link
Owner

sylhare commented Nov 26, 2024

Actually let me track back, it seemed fine locally but I think I might have spoken too soon as the github hosted version is not reacting well to it.

@sylhare
Copy link
Owner

sylhare commented Nov 26, 2024

So I had both version of jekyll-sass-converter locally (1.5.2 and 3) that's why it was working fine with v3 but when I switched to the GitHub page one v1.5.2, the style wasn't rendering at all.

So you can use #471 and #474 to make it v3 compatible (and remove the warnings), however it won't work on GitHub page, so I am not sure how to do. I'll revert for now.

@sylhare sylhare added dependencies Pull requests that update a dependency file fix and removed bug labels Nov 26, 2024
@sylhare
Copy link
Owner

sylhare commented Nov 26, 2024

I think the best fix, I can provide is to quiet the warnings for now 🤔 Once the github page uses the latest converter, I'll push the sass update.

@Crossed-Omega
Copy link
Author

Brilliant, thanks a bunch!

@sylhare
Copy link
Owner

sylhare commented Nov 27, 2024

With #478 I can remove all but one warnings for the sass. I guess that's the max I can do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants