Skip to content

Commit

Permalink
feat: add basic spread implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 22, 2018
1 parent 14f60fc commit fa376da
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions addon/spread.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

exports.addon = function (renderer) {
if (process.env.NODE_ENV !== 'production') {
require('./__dev__/warnOnMissingDependencies')('spread', renderer, ['put']);
}

renderer.spread = function (css, block) {
block = block || renderer.hash(css);
block = renderer.pfx + block;
renderer.put('.' + block + ',[data-' + block + ']', css);

var spread = {
toString: function () {
return ' ' + block;
}
};

spread['data-' + block] = '';

return spread;
};
};

0 comments on commit fa376da

Please sign in to comment.