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

[Question] Global scss variables #26

Open
awojtczyk opened this issue Sep 18, 2017 · 1 comment
Open

[Question] Global scss variables #26

awojtczyk opened this issue Sep 18, 2017 · 1 comment

Comments

@awojtczyk
Copy link

awojtczyk commented Sep 18, 2017

Great starter, I'm loving it.

Would you let me know is it possible to have let's say _variables.scss file, which will be available from components .scss files?

For example,
_variables.scss contains

$blue:'blue';

which can be imported in footer.scss like a:

a {color:$blue}

Thanks in advance!

Update:
I have switched loader to sass-resources-loader, so my global.js rule looks like this one:
Is that correct?

{
          test: /\.scss$/,
          use: [
            'style-loader',
            'css-loader',
            'postcss-loader',
            'sass-loader',
            {
              loader: 'sass-resources-loader',
              options: {
                // Provide path to the file with resources
                resources: './src/assets/styles/_vars.scss'
              },
            },
          ],
        }
@STUkh
Copy link
Owner

STUkh commented Mar 19, 2018

Why not to import variables.scss directly to your footer.scss?

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

2 participants