Created
January 31, 2016 11:50
-
-
Save seka/c5894488d7e07d583630 to your computer and use it in GitHub Desktop.
postcss-style-guide のテストに使ったファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var fs = require('fs'); | |
var postcss = require('gulp-postcss'); | |
var scss = require('postcss-scss'); | |
var styleguide = require('postcss-style-guide'); | |
gulp.task('default', function () { | |
var processors = [ | |
styleguide | |
]; | |
return gulp.src('src/*.css') | |
.pipe(postcss(processors, {syntax: scss})) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scss = require('postcss-scss'); | |
var styleguide = require('postcss-style-guide'); | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
postcss: { | |
src: 'src/*.css', | |
options: { | |
syntax: scss, | |
writeDest: false, | |
processors: [ | |
styleguide | |
] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-postcss'); | |
grunt.registerTask('default', ['postcss']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var postcss = require('postcss'); | |
var styleguide = require('postcss-style-guide'); | |
var input = fs.readFileSync('src/fixture.css', 'utf8'); | |
var output = postcss([ | |
styleguide | |
]).process(input) | |
.then(function (reuslt) { | |
var output = fs.readFileSync('styleGuide/index.html', 'utf8'); | |
console.log('output:', output); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment