Skip to content

Commit

Permalink
feat: add dsheet()
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 14, 2018
1 parent 2ea6b3e commit 744149c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addon/dsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ exports.addon = function (renderer) {
var styles = renderer.sheet(map, block);
var closures = {};

var createClosure = function (modifier) {
var createClosure = function (elementModifier) {
var closure = function (dynamicStyles) {
if (!dynamicStyles) {
return styles[modifier];
return styles[elementModifier];
}

var dynamicClassName = renderer.cache(dynamicStyles);

return styles[modifier] + dynamicClassName;
return styles[elementModifier] + dynamicClassName;
};

closure.toString = function () {
return styles[modifier];
return styles[elementModifier];
};

return closure;
};

for (var modifier in map) {
closures[modifier] = createClosure(modifier);
for (var elementModifier in map) {
closures[elementModifier] = createClosure(elementModifier);
}

return closures;
Expand Down

0 comments on commit 744149c

Please sign in to comment.