Skip to content

Commit

Permalink
feat: add tachyons hover rules
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 25, 2018
1 parent 2829c33 commit 0aabd1c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions addon/tachyons.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,30 @@ exports.addon = function (renderer, ruleOverrides) {
for (var i = 0; i < tachyons.length; i++)
onTachyon(tachyons[i]);

// Add hover rules
rules.grow = function () {
this['-moz-osx-font-smoothing'] = 'grayscale';
this.backfaceVisibility = 'hidden';
this.transform = 'translateZ(0)';
this.transition = 'transform 0.25s ease-out';
this[':hover'] = {
transform: 'scale(1.05)',
};
this[':focus'] = {
transform: 'scale(1.05)',
};
};

rules.dim = function () {
this.opacity = 1;
this.transition = 'opacity .15s ease-in';
this[':hover'] = {
opacity: '.5',
};
this[':focus'] = {
opacity: '.5',
};
};

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

0 comments on commit 0aabd1c

Please sign in to comment.