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

Feature request - Shorthand for passing a list of variables to config to @use rule #2889

Closed
davejtoews opened this issue Aug 10, 2020 · 4 comments

Comments

@davejtoews
Copy link

Passing a large number of variables as config introduces a lot of extra code compared to the old way of @import-ing a file with all your variables before @import-ing a module with a lot of !default values you wish to override. It would be handy if I could pass a variable scope to a @use statement or have some other such shorthand way of overriding a significant number of values.

e.g.

@use 'variables' as variables;
@use 'module' with variables;

A bit more about my use case can be seen in this StackOverflow question.

@Awjin
Copy link
Contributor

Awjin commented Aug 10, 2020

It looks like Miriam provided an extensive answer on StackOverflow. For more complex use cases, such as overriding a significant number of values, I would recommend using mixins instead of @use ... with.

@Awjin Awjin closed this as completed Aug 10, 2020
@davejtoews
Copy link
Author

@Awjin I may be missing something but the The StackOverflow answer doesn't seem to cover the idea above of pulling the variables from another file. Those answers only seem to work if the variables are defined in the same file I'm writing the @use rule in.

@mirisuzanne
Copy link
Contributor

@davejtoews I'll work through it with you on SO. You may have to update your mental model a bit -- I also had to rethink several of my project configurations -- but I'm pretty confident the current approach provides what you'll need. I'll reply there with more detail this afternoon.

We can reopen a more specific issue here if it really is a use-case that's totally unsupported.

@davejtoews
Copy link
Author

I'm satisfied with the answer on StackOverflow, thank you both.

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