Meteor-Community-Packages / meteor-scss

Node-sass wrapped to work with meteor.
MIT License
311 stars 72 forks source link

Invalid CSS when importing another SASS file #150

Closed matfin closed 8 years ago

matfin commented 8 years ago

Hi,

When I add some styling to a _partial.sass file in the SASS syntax and @import that to my main.sass file, I get the following error:

While processing files with fourseven:scss (for target web.browser):
   /client/styles/main.sass: Scss compiler error: Invalid CSS after "": expected
   1 selector or at-rule, was "body "

I have a main.sass file with the following in it:

/**
 *  Third party
 */
@import "{wolves:bourbon}/bourbon"

/**
 *  Setup
 */
@import "mixins"

Inside my _mixins.sass file (same directory) I have the following:

body 
    color: red

This gives rise to the error above but oddly enough if I delete the body styling and put it back into main.sass it works.

Further useful info

sebakerckhof commented 8 years ago

There's an error in node-sass when importing sass files: https://github.com/sass/node-sass/issues/1192

sebakerckhof commented 8 years ago

tracked here: https://github.com/fourseven/meteor-scss/issues/120

select commented 8 years ago

As @sebakerckhof said this should be merged into issue #120

GreggOrdHume commented 6 years ago

I had this issue recently. I fixed it by changing everything to scss. In your webpack config you can change you sass loader to scss. Its as simple as that, no need to install other packages etc.

So it would be this:

      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {
          loaders: {
            'scss': [
              'vue-style-loader',
              'css-loader',
              'sass-loader',
              {
                loader: 'sass-resources-loader',
                options: {
                  resources: resolve('src/scss/variables.scss')
                },
              }
            ]
          }
        }
      },

Now my variables are available globally throughout my app.