使用grunt将.scss编译为css,返回奇怪的错误

时间:2016-10-26 19:07:31

标签: css sass gruntjs grunt-contrib-sass grunt-cli

所以这就是我的咕噜声:

concat: {
      css: {
        src: [
          'assets/**.scss.liquid', 'assets/**.css'
        ],
        dest: 'assets/build.scss.liquid',
      }
    },
    sass: {
      dist: {
        options: {
          style: 'compressed',
          sourcemap: 'none',
          noCache: true
        },
        files: {
          'assets/build.css.liquid':'assets/build.scss.liquid'
        }
      }
    }

SCSS:

.all-collection {
  padding-top: 50px;
  height: 100%;
  width: 100%;
  color: white !important;
  justify-content: center;
  display: flex;

  p {
    color: white !important;
  }
}

这是运行grunt concatgrunt sass后返回的内容: Error: Invalid CSS after "50px": expected expression (e.g. 1px, bold), was ";" on line 2 of all-collection.scss

我尝试删除它指定的行上的;,但错误只是更改为具有;的下一行。不确定为什么会发出此错误。

1 个答案:

答案 0 :(得分:0)

通过切换插件解决。我改为使用xcodebuild -configuration Debug -target kern