Skip to content

Instantly share code, notes, and snippets.

@matt-bailey
Created May 8, 2015 12:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-bailey/65ecc6d498348d5ff5e9 to your computer and use it in GitHub Desktop.
Save matt-bailey/65ecc6d498348d5ff5e9 to your computer and use it in GitHub Desktop.
SC5 Style Guide Generator Grunt usage instructions
module.exports = function(grunt) {
var gulp = require('gulp'),
styleguide = require('sc5-styleguide');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'main.css': 'main.scss'
}
}
},
gulp: {
'styleguide-generate': function() {
var outputPath = 'output';
return gulp.src(['main.scss'])
.pipe(styleguide.generate({
title: 'My Styleguide',
server: true,
rootPath: outputPath
}))
.pipe(gulp.dest(outputPath));
},
'styleguide-applystyles': function() {
gulp.src('main.scss')
.pipe(styleguide.applyStyles())
.pipe(gulp.dest('output'));
}
},
watch: {
scss: {
files: '**/*.scss',
tasks: ['sass', 'gulp:styleguide-generate', 'gulp:styleguide-applystyles']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-gulp');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['gulp:styleguide-generate', 'gulp:styleguide-applystyles', 'watch']);
};
@sighonara
Copy link

Thank you. This was very helpful. Wasn't sure what was failing with the standard documentation, but your guide got me in the right direction.

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