-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
@import rule is now deprecated. Migrate to @use and @forward #7031
Comments
@adidahiya I'd like to contribute a PR in the future for this. Would this be welcome, or would your team prefer this be done under the scope of something larger in the future roadmap? |
Thanks for flagging this issue. We'd be open to a contribution for this change. |
Hey @justinbhopper, we generally consider |
@ggdouglas Sure, its my pleasure! Regarding the public API: I believe these warnings would occur when importing Currently, our team is consuming Here is some extra info:
|
@justinbhopper Thanks for the clarification—that makes sense. We're looking to formalize this customization process in future releases, but for now, I'm okay with migrating the syntax here as long as it doesn’t break current Blueprint consumers. 👍 |
@ggdouglas Looks like we should reopen this issue, since #7157 had to be reverted. Is there a long-term plan in mind to migrate to @use? I suspect it may require breaking changes. Migrating has to happen eventually, since SASS is dropping support for @import. I'm not sure if there is a way to do it that is backwards compatible, unless Blueprint ships two sets of stylesheets for a time. |
@ggdouglas I noticed in another thread you mentioned v6, so perhaps the best plan is to prepare this migration to happen in v6 release. This way, the use of @import can just be deprecated in v5 and v6 can be where the transition happens. Thoughts? cc: @jscheiny |
Sass 1.80.0 has recently deprecated the
@import
rule, causing warnings to appear during compile. Now might be a good time to migrate blueprint's scss to@use
and@forward
rules, which have been supported since v1.23.0 (2019). Support for@import
will be removed entirely in 2 years.No doubt migration is non-trivial, but I believe the changes necessary are:
@import
occurring for the purpose of importing variables, mixins, or functions, use@use
instead. Multiple files may need to be imported using@use
, since Sass only includes variables that were defined in the file directly imported. The variables/functions will be available via a namespace, although it is possible to import them as global for an even easier migration.@import
occurring for the purpose of including the contents of another file (e.g. as seen incore/src/blueprint.scss
), use@forward
instead.They provide a migration tool, although I have not tried it so I cannot speak on it.
The text was updated successfully, but these errors were encountered: