Skip to content

Commit

Permalink
you can rename outputfile with setting filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Lavr committed Mar 21, 2017
1 parent b3d74ad commit a3e79d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"filename": "smart-grid",
"outputStyle": "less",
"columns": 12,
"offset": "30px",
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function(dest, options){
console.log('It`s test mode, because you don`t set destination folder');
}
else{
var buildFile = dest + '/smart-grid.' + res.type;
var buildFile = dest + '/' + options.filename + '.' + res.type;
fs.writeFileSync(buildFile, res.grid);
console.log('Grid placed into ' + buildFile);
}
Expand Down
10 changes: 9 additions & 1 deletion system/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Helpers.prototype.parseUnit = function(str){
res.value = str.substr(0, str.length - 1);
res.unit = '%';
}
else if(this.isRem(str)){
res.value = str.substr(0, str.length - 3);
res.unit = 'rem';
}
else{
throw new Error('what is "' + str + '" value? We use px and %.');
throw new Error('what is "' + str + '" value? We use px, % and rem.');
}

return res;
Expand All @@ -44,6 +48,10 @@ Helpers.prototype.isPercentage = function(str){
return str.substr(-1) === '%';
}

Helpers.prototype.isRem = function(str){
return str.substr(-3) === 'rem';
}

Helpers.prototype.math = function(a, b, op){
var res = null;

Expand Down

0 comments on commit a3e79d0

Please sign in to comment.