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

Invalid CSS when importing another SASS file #150

Closed
matfin opened this issue Oct 21, 2015 · 4 comments
Closed

Invalid CSS when importing another SASS file #150

matfin opened this issue Oct 21, 2015 · 4 comments

Comments

@matfin
Copy link

matfin commented Oct 21, 2015

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

  • I am using 3.4.0-beta1
  • Meteor 1.2.0.2
  • wolves:bourbon@3.1.0 also installed (but commenting this out doesn't change anything)
  • OSX El Capitan
@sebakerckhof
Copy link
Collaborator

There's an error in node-sass when importing sass files:
sass/node-sass#1192

@sebakerckhof
Copy link
Collaborator

tracked here: #120

@select
Copy link

select commented Sep 18, 2016

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

@GreggOrdHume
Copy link

GreggOrdHume commented Jun 27, 2018

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.

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

No branches or pull requests

4 participants