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

Variable Hoisting #1543

Closed
aleemb opened this issue Nov 25, 2014 · 2 comments
Closed

Variable Hoisting #1543

aleemb opened this issue Nov 25, 2014 · 2 comments

Comments

@aleemb
Copy link

aleemb commented Nov 25, 2014

I for one would love to see support for variable hoisting:

.foo { color: $color }
$color: red !hoist;

Without having support for variable hoisting, it becomes necessary to rely on include order which can be very limiting especially when defining user overrides etc.

@nex3
Copy link
Contributor

nex3 commented Nov 25, 2014

The semantics of this would be extremely unclear for anyone who doesn't know programming language terminology. The issues with include order will also become largely moot when we move to the more module-based @use.

@nex3 nex3 closed this as completed Nov 25, 2014
@andreyvolokitin
Copy link

Maybe it could be described in the docs? After all, users aren't forced to use it...

My problem is that I have a variable which is included in the middle of a file. This variable is there for convenience/readability, in order to be around a block of styles it is related to. And then I have styles for completely different components, located in different files and included before this variable (also for good reasons). And these components would like to use this variable. I could declare this variable at the top of the file with all project-wide global variables. But then I need to jump back and forth between the block of styles and its variable. Later this will be multiplied by the number of such cases.

Instead if I could just hoist this variable, then it will be located at convenient readable place and also could be available elsewhere if it needs to be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants