Files to Sass
Converts a list of files to (a map of) Sass variables with their content.
GitHub | NPM | @jelmerdemaat
Early beta: see todo for functionality that's not yet included.
Configuration
filesToSass(options, callback(Object fileList));
Use as follows:
var filesToSass = ; ;
Using Gulp it's possible to access this module directly:
var filesToSass = ; gulp;
Example output, using SVG's as input, would be:
;;;
And using the Sass map functionality:
;
Options
options.src
Required. Sets the path to the source folder.
options.dest
Required. Sets the path and name of the destination Sass file, including extension.
options.sassMap
Optional. Set to true if you want to output a Sass map.
Default: false
options.sassMapName
Optional. String to be used as the Sass map variable name. The $
will be prepended.
Default: fileMap
options.base64
Optional. Convert strings to Base64
Default: false
options.imageSizes
Optional. Only available when using Sass maps and (SVG) images. Returns width and height in addition to the file contents.
Default: false
options.debug
Optional. Set to true if you want to see which files are being processed.
Default: false
Todo
- Switch to async module structure.
- Add ability to use files as source input.
Add the output folder if it doesn't exist already.Add option to use maps in stead of plain variables.Thanks @sebsmi