Skip to content

Commit fa376da

Browse files
committed
feat: add basic spread implementation
1 parent 14f60fc commit fa376da

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

addon/spread.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
exports.addon = function (renderer) {
4+
if (process.env.NODE_ENV !== 'production') {
5+
require('./__dev__/warnOnMissingDependencies')('spread', renderer, ['put']);
6+
}
7+
8+
renderer.spread = function (css, block) {
9+
block = block || renderer.hash(css);
10+
block = renderer.pfx + block;
11+
renderer.put('.' + block + ',[data-' + block + ']', css);
12+
13+
var spread = {
14+
toString: function () {
15+
return ' ' + block;
16+
}
17+
};
18+
19+
spread['data-' + block] = '';
20+
21+
return spread;
22+
};
23+
};

0 commit comments

Comments
 (0)