Comparing version 0.0.8 to 0.0.9
@@ -31,11 +31,15 @@ /* | ||
}); | ||
handlebars.registerHelper('stylusVar', function(options){ | ||
return options.fn(this).toLowerCase().replace(/_/g, '-'); | ||
}); | ||
handlebars.registerHelper('lessVar', function(options){ | ||
return '@' + options.fn(this).toLowerCase().replace(/_/g, '-'); | ||
}); | ||
handlebars.registerHelper('auraVar', function(options){ | ||
return camelCase(options.fn(this)); | ||
}); | ||
handlebars.registerHelper('htmlValue', function(options){ | ||
@@ -49,2 +53,3 @@ var value = options.fn(this); | ||
}); | ||
handlebars.registerHelper('iOSValue', function(options){ | ||
@@ -61,2 +66,9 @@ var value = options.fn(this); | ||
handlebars.registerHelper('if_eq', function(a, b, opts) { | ||
if(a == b) // Or === depending on your needs | ||
return opts.fn(this); | ||
else | ||
return opts.inverse(this); | ||
}); | ||
var getExtensionByType = function(type){ | ||
@@ -119,3 +131,3 @@ switch(type){ | ||
convert: function(type, variable){ | ||
var templateFile = path.join(path.dirname(fs.realpathSync(__filename)), '../templates/' + type.toLowerCase() + '.hbs') | ||
var templateFile = path.join(path.dirname(fs.realpathSync(__filename)), '../templates/' + type.toLowerCase() + '.hbs'); | ||
if(fs.existsSync(templateFile)){ | ||
@@ -122,0 +134,0 @@ var template = handlebars.compile(fs.readFileSync(templateFile).toString()); |
{ | ||
"name": "theo", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Theme tokenizer working with JSON input generating variables for Sass, Stylus, Less, Aura, iOS (plist) and Android (XML)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -23,15 +23,10 @@ theo | ||
"name": "Name of the theme", | ||
"categories": [ | ||
"properties": [ | ||
{ | ||
"name": "Name of the category like colors", | ||
"properties": [ | ||
{ | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d6" | ||
}, | ||
{ | ||
"name":"COLOR_LINK", | ||
"value":"#006eb3" | ||
} | ||
] | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d6" | ||
}, | ||
{ | ||
"name":"COLOR_LINK", | ||
"value":"#006eb3" | ||
} | ||
@@ -38,0 +33,0 @@ ] |
{ | ||
"theme": { | ||
"name": "S1 base", | ||
"categories": [ | ||
"properties": [ | ||
{ | ||
"name": "Salesforce Brand", | ||
"properties": [ | ||
{ | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d6" | ||
}, | ||
{ | ||
"name":"COLOR_LINK", | ||
"value":"#006eb3" | ||
}, | ||
{ | ||
"name":"FONT_BOLD", | ||
"value":"'ProximaNovaSoft-Bold'", | ||
"comment": "Fonts" | ||
} | ||
] | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d6", | ||
"category": "text-color" | ||
}, | ||
{ | ||
"name":"COLOR_LINK", | ||
"value":"#006eb3", | ||
"category": "text-color" | ||
}, | ||
{ | ||
"name":"BG_1", | ||
"value":"#ff9900", | ||
"category": "background-color" | ||
}, | ||
{ | ||
"name":"BORDER_1", | ||
"value":"#ff0000", | ||
"category": "border-color" | ||
}, | ||
{ | ||
"name":"FORM", | ||
"value":"#ff0000", | ||
"category": "input-background-color" | ||
}, | ||
{ | ||
"name":"BORDER_DEFAULT", | ||
"value":"1px dotted green", | ||
"category": "border-style" | ||
}, | ||
{ | ||
"name":"FONT_BOLD", | ||
"value":"'ProximaNovaSoft-Bold'", | ||
"category": "font" | ||
}, | ||
{ | ||
"name":"SMALL", | ||
"value":"15px", | ||
"category": "font-size" | ||
}, | ||
{ | ||
"name":"MEDIUM", | ||
"value":"17px", | ||
"category": "font-size" | ||
}, | ||
{ | ||
"name":"LARGE", | ||
"value":"20px", | ||
"category": "font-size" | ||
}, | ||
{ | ||
"name":"LINE_HEIGHT_DEFAULT", | ||
"value":"25px", | ||
"category": "line-height" | ||
}, | ||
{ | ||
"name":"LINE_HEIGHT_SIDEBAR", | ||
"value":"18px", | ||
"category": "line-height" | ||
}, | ||
{ | ||
"name":"NARROW_SPACING", | ||
"value":"8px", | ||
"category": "spacing" | ||
}, | ||
{ | ||
"name":"WIDE_SPACING", | ||
"value":"16px", | ||
"category": "spacing" | ||
}, | ||
{ | ||
"name":"STAGE_LEFT_WIDTH", | ||
"value":"88%", | ||
"category": "misc" | ||
}, | ||
{ | ||
"name":"FOO", | ||
"value":"20px", | ||
"category": "misc" | ||
} | ||
] | ||
} | ||
} | ||
} |
@@ -5,18 +5,15 @@ { | ||
"extends": "one:theme", | ||
"categories": [ | ||
"properties": [ | ||
{ | ||
"name": "COLORS", | ||
"properties": [ | ||
{ | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d7" | ||
}, | ||
{ | ||
"name": "COLOR_LOCKED", | ||
"value": "#f1b524" | ||
} | ||
] | ||
"name":"COLOR_PRIMARY", | ||
"value":"#2a94d7", | ||
"category": "text-color" | ||
}, | ||
{ | ||
"name": "COLOR_LOCKED", | ||
"value": "#f1b524", | ||
"category": "text-color" | ||
} | ||
] | ||
} | ||
} | ||
} |
@@ -152,3 +152,3 @@ /* | ||
describe('convert HTML', function(){ | ||
describe('create docs', function(){ | ||
@@ -159,3 +159,3 @@ it('should convert a variables object to a HTML documentation.', function(){ | ||
result.should.exist; | ||
result.should.containEql('<h1>Salesforce Brand</h1>'); | ||
result.should.containEql('<html>'); | ||
}); | ||
@@ -162,0 +162,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
33103
354
54