Skip to content

Commit

Permalink
feat: creat tachyons snake rules
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 25, 2018
1 parent bd1bfa7 commit 2829c33
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions addon/tachyons.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,19 @@ for (var name in colors) {
tachyons.push(['b' + capitalized, 'borderColor', color]);
}

exports.addon = function (renderer, rules) {
exports.addon = function (renderer, ruleOverrides) {
var rules = {};

addonSnake(renderer, rules);
function onTachyon (tachyon) {
rules[tachyon[0]] = function () {
for (var i = 1; i < tachyon.length; i += 2) {
this[tachyon[i]] = tachyon[i + 1];
}
};
}

for (var i = 0; i < tachyons.length; i++)
onTachyon(tachyons[i]);

addonSnake(renderer, renderer.assign(rules, ruleOverrides || {}));
};

0 comments on commit 2829c33

Please sign in to comment.