source: imaps-frontend/node_modules/nano-css/addon/hyperstyle.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 750 bytes
Line 
1'use strict';
2
3exports.addon = function (renderer) {
4 if (process.env.NODE_ENV !== 'production') {
5 require('./__dev__/warnOnMissingDependencies')('hyperstyle', renderer, ['sheet']);
6 }
7
8 renderer.hyperstyle = function (map, block) {
9 var styles = renderer.sheet(map, block);
10
11 return function (type, props) {
12 if (props) {
13 var styleName = props.styleName;
14
15 if (styleName) {
16 var className = styles[styleName];
17
18 if (className) {
19 props.className = (props.className || '') + className;
20 }
21 }
22 }
23
24 return renderer.h.apply(null, arguments);
25 };
26 };
27};
Note: See TracBrowser for help on using the repository browser.