swiftlang / swift-org-website

Swift.org website
https://swift.org
Other
477 stars 187 forks source link

Replace `@import` with `@use` #515

Open VladimirCreator opened 9 months ago

VladimirCreator commented 9 months ago

Description

The use of @import at-rule is discouraged by the SASS team and it will be removed from the language. @use at-rule is now recommended.

The solution I'd like

Replace @import at-rules with @use at-rules.

Additional context

Here’s a note on SASS website where you can find a migration tool.

deirdresm commented 4 weeks ago

A couple of notes on this:

  1. Gemfile jekyll imports jekyll-sass-converter, which is what imports sass-embedded on the various architectures.
  2. The current version of sass-embedded in the Gemfile.lock is 1.77.8, but @import wasn't deprecated until 1.8.0.
  3. The current version of Jekyll-sass-converter uses @import (rather than @use) in all its code, so that may need to be addressed first (but that seems like a far smaller issue).
  4. 1.8.x of sass-embedded would require an update to google-protobuf 4.2.8, but that doesn't have other side effects.

So, from a rubygems perspective, the update seems straightforward. Haven't assessed the sass impact yet.

deirdresm commented 4 weeks ago

It seems that the reason Jekyll-sass-converter has not yet updated to @use is related to heavy GitHub Pages use, plus a feature of Pages: ignoring the Gemfile.lock. See discussion here, specifically the last comment.

GitHub Pages uses a quite old set of dependencies, including the pre-Dart version of sass that was archived in April 2019.

This could lead to people using @use instead of @import in a local copy (if that repo converted) and then not being able to deploy because GitHub Pages doesn't understand the newer syntax.