8000 Re-consider deprecating @import & global imports · Issue #3628 · sass/sass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Re-consider deprecating @import & global imports #3628

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

Closed
ShadiestGoat opened this issue Jul 3, 2023 · 1 comment
Closed

Re-consider deprecating @import & global imports #3628

ShadiestGoat opened this issue Jul 3, 2023 · 1 comment

Comments

@ShadiestGoat
Copy link

Hello!

I could not find a discussion relating to this anywhere, so I started a new one.

The SASS @import documentation clearly states that @import will soon be deprecated and removed, with several reasons given for this action. However, please consider the following setup:

// main.scss

@use "vars.scss" as *;

@import "partial1.scss";
@import "partial2.scss";
@import "partial3.scss";

// vars.scss
$blue-1: #0000ff;

//partialX.scss
.foo {
    color: $blue-1;
}

In this setup, the partials use variables defined in vars.scss. With @use, this requires an extra line in each partial importing the variables again. This is especially annoying for conditional exports such as for themes, which require more lines to import.

Global imports have their uses - it should not be phased out from the spec. Although I do recognize that @import is easy to misinterpret as the non-global syntax, perhaps a new at-rule should be created that acts exactly like @import, but called @global? This way, it still allows for the desired functionality, but explicitly states that this is a global import.

@nex3
Copy link
Contributor
nex3 commented Jul 5, 2023

#3513 is the issue for discussing imports.

@nex3 nex3 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
Sign up for free to join this c 4329 onversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0