Skip to content

Sass update: migrate away from @import #755

@maureenlholland

Description

@maureenlholland

Description

Sass's target date to drop support for @import is Oct. 2022***. The Sass team has a blog post on their reasoning for this.. We can use their migration tool, but there will likely be some manual restructuring/troubleshooting required.

***update July 2022: this target date has been postponed indefinitely, as the Sass team waits for greater migration to dart-sass

tl;dr:

  • it was difficult to identify where “members” (variables, mixins, and functions) were set
  • library authors struggled to manually namespace things to ensure they wouldn’t conflict with user names
  • scope was unclear and could result in strange side effects

Miriam Suzanne has the best breakdown of this in my opinion, a shorter primer on her site and a longer CSS tricks article.

If you want to see what this looks like in practice with bedrock, I opened an experimental branch and documented some errors I ran into: maureenlholland/bedrock@bfa5cf1#diff-8e07af2048c8e9d32f1610%5B%E2%80%A6%5D1161183c678f0d2a9b67f517455

⚠️ this messed with my mental model of sass and will definitely take some getting used to

Success Criteria

  • No @import statements in Sass
  • Library still works as expected
  • Any BREAKING CHANGES have migration tips in the changelog
  • Docs are updated

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions