Permalink
Browse files

Add template as an option to pass in

  • Loading branch information...
1 parent 6565234 commit c7192eaef76bc7c182b8dbdcfb0bea3b19f2e456 @jefflembeck jefflembeck committed Dec 26, 2013
Showing with 30 additions and 6 deletions.
  1. +3 −1 Gruntfile.js
  2. +21 −0 README.md
  3. +2 −2 package.json
  4. +4 −3 tasks/grunticon.js
View
@@ -77,7 +77,9 @@ module.exports = function(grunt) {
customselectors: {
"cat" : ["#el-gato"],
"gummy-bears-2" : ["nav li a.deadly-bears:before"]
- }
+ },
+
+ template: "example/default-css.hbs"
}
}
View
@@ -171,6 +171,27 @@ Default value: `"300px"`
similar to defaultWidth, but for height
+#### options.template
+Type: `String`
+Default value: `""`
+
+Location of a handlebars template that will allow you to structure your
+CSS file the way that you choose. As more data becomes available via
+[directory-encoder](https://github.com/filamentgroup/directory-encoder),
+more options will be available for you to tap into during templating.
+
+
+Example of .hbs file contents:
+
+```
+{{#each customselectors}}{{this}},{{/each}}
+{{prefix}}{{name}} {
+ background-image: url('{{datauri}}');
+ background-repeat: no-repeat;
+}
+```
+
+
#### options.colors
Allows you to predefine colors as variables that can be used in filename color configuration.
View
@@ -1,7 +1,7 @@
{
"name": "grunt-grunticon",
"description": "A mystical CSS icon solution",
- "version": "1.0.0-alpha.8",
+ "version": "1.0.0-alpha.9",
"homepage": "https://github.com/filamentgroup/grunticon",
"author": {
"name": "Scott Jehl",
@@ -34,7 +34,7 @@
"handlebars": "1.1.2",
"lodash":"2.4.0",
"grunt-svgmin": "0.3.0",
- "directory-encoder": "0.3.6",
+ "directory-encoder": "0.3.7",
"directory-colorfy": "0.1.0",
"rsvp": "1.2.0",
"svg-to-png": "0.2.0"
View
@@ -44,7 +44,8 @@ module.exports = function( grunt , undefined ) {
defaultWidth: "400px",
defaultHeight: "300px",
colors: {},
- pngfolder: "png"
+ pngfolder: "png",
+ template: ""
});
// just a quick starting message
@@ -87,15 +88,15 @@ module.exports = function( grunt , undefined ) {
var o = {
pngfolder: pngfolder,
customselectors: config.customselectors,
- template: path.resolve( path.join( config.src, "..", "default-css.hbs" ) ),
+ template: path.resolve( config.template ),
noencodepng: false,
prefix: config.cssprefix
};
var o2 = {
pngfolder: pngfolder,
customselectors: config.customselectors,
- template: path.resolve( path.join( config.src, "..", "default-css.hbs" ) ),
+ template: path.resolve( config.template ),
noencodepng: true,
prefix: config.cssprefix
};

0 comments on commit c7192ea

Please sign in to comment.