Skip to content

Commit 2829c33

Browse files
committed
feat: creat tachyons snake rules
1 parent bd1bfa7 commit 2829c33

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

addon/tachyons.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,19 @@ for (var name in colors) {
172172
tachyons.push(['b' + capitalized, 'borderColor', color]);
173173
}
174174

175-
exports.addon = function (renderer, rules) {
175+
exports.addon = function (renderer, ruleOverrides) {
176+
var rules = {};
176177

177-
addonSnake(renderer, rules);
178+
function onTachyon (tachyon) {
179+
rules[tachyon[0]] = function () {
180+
for (var i = 1; i < tachyon.length; i += 2) {
181+
this[tachyon[i]] = tachyon[i + 1];
182+
}
183+
};
184+
}
185+
186+
for (var i = 0; i < tachyons.length; i++)
187+
onTachyon(tachyons[i]);
188+
189+
addonSnake(renderer, renderer.assign(rules, ruleOverrides || {}));
178190
};

0 commit comments

Comments
 (0)