-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Variables #105
Comments
+1 |
Yep, that's a known problem of preprocessors (both SASS and Less). I haven't found an easy way for SASS, though. Less introduced the |
@badsyntax if all you need are shared variables, why not have all of them in a file with only variables, that way it doesn't matter if it's imported multiple times? Like this: |
We can't solve this because each |
Hi there
I am facing a problem with sharing sass variables across different require() calls. I am appending values to a list variable and I need that variable to be shared between different SCSS modules.
A real world scenario is attempting to a "import-once" function that prevent CSS from being output more than once:
You cannot use such an approach with sass-loader as each require() call is completely contained from other require() calls, thus
$imported-once-files
is reset with each require() call. I think the only way to resolve this issue to load all component files with sass and have only one entry point require('app.scss') call.I'm hoping I'm making sense! Do you have suggestions on how I could make variables global across different require() calls?
Thanks!
The text was updated successfully, but these errors were encountered: