generator-angular-webpack-es6 icon indicating copy to clipboard operation
generator-angular-webpack-es6 copied to clipboard

[Question] Global scss variables

Open awojtczyk opened this issue 8 years ago • 1 comments

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'
              },
            },
          ],
        }

awojtczyk avatar Sep 18 '17 13:09 awojtczyk

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

STUkh avatar Mar 19 '18 22:03 STUkh