【问题标题】:Import compass into SCSS将指南针导入 SCSS
【发布时间】:2016-01-27 17:25:12
【问题描述】:

如何将指南针导入我的 SCSS 以便我可以使用 mixins 等。

我目前使用 grunt 来生成我的 SCSS 文件,但我不确定我该如何做到这一点。

我的watch任务如下:

module.exports = {
   jade: {
      files: 'app/views/**/*.jade',
      tasks: ['jade']
    },
     css: {
        files: '**/*.scss',
        tasks: ['sass']
    }
}

我的 sass 任务是:

module.exports = {
   dist: {

         files: [{
           expand: true,
           cwd: 'scss',
           src: ['**/*.scss'],
           dest: 'stylesheets',
           ext: '.css'
         }]
   }
 }

谢谢

【问题讨论】:

标签: sass gruntjs compass


【解决方案1】:

您可以使用此处找到的 Compass Grunt Task:

https://github.com/gruntjs/grunt-contrib-compass

这是来自 git repo 的示例用法:

grunt.initConfig({
  compass: {                  // Task
    dist: {                   // Target
      options: {              // Target options
        sassDir: 'sass',
        cssDir: 'css',
        environment: 'production'
      }
    },
    dev: {                    // Another target
      options: {
        sassDir: 'sass',
        cssDir: 'css'
      }
    }
  }
});

grunt.loadNpmTasks('grunt-contrib-compass');

grunt.registerTask('default', ['jshint', 'compass']);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-25
    • 2013-09-10
    • 2013-02-05
    • 2014-10-17
    • 1970-01-01
    • 2013-03-09
    • 2012-10-16
    相关资源
    最近更新 更多