sass-generate-contents
v0.0.1
Published
creates a file with all sass imports neccessary to build single website css file. It also creates a contents type directory based on the first comments line of each imported sass file
Downloads
2
Readme
sass-generate-contents
Gulp plugin to generate an imports file with a table of contents
This plugin was written to help with large scale website builds that use a CSS preprocessor and Gulp as a task runner.
It's purpose is to create a master SASS file to hold the css @imports of all the specified SASS files. It also generates a list of contents of all SASS files with a description (*manual).
The contents are generated from the first line of each individual SASS file.
* The plugin requires a comment at the top of each SASS file formatted starting with // (double slash).
The plugin will ignore any files that do not have this on the first line of the file to be imported.
Example of SASS file to be imported
// Navigation Primary ..... CSS styles for the primary navigation
.navigation-primary {
background: red;
}
Example of Gulp task
// Settings
var sgc = require('sass-generate-contents');
var creds = {
"Author": "Andrew Brandwood",
"Website": "www.Brandwood.com"
}
// *creds are optional*
// Gulp task
gulp.task('sass-generate-contents', function () {
gulp.src(['sass/**/*.scss','partials/**/*.scss'])
.pipe(sgc('css/main.scss', creds))
.pipe(gulp.dest('css'));
});