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:
683 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | exports.addon = function (renderer) {
|
---|
4 | if (process.env.NODE_ENV !== 'production') {
|
---|
5 | require('./__dev__/warnOnMissingDependencies')('drule', renderer, ['rule', 'cache']);
|
---|
6 | }
|
---|
7 |
|
---|
8 | renderer.drule = function (styles, block) {
|
---|
9 | var className = renderer.rule(styles, block);
|
---|
10 |
|
---|
11 | var closure = function (dynamicStyles) {
|
---|
12 | if (!dynamicStyles) {
|
---|
13 | return className;
|
---|
14 | }
|
---|
15 |
|
---|
16 | var dynamicClassName = renderer.cache(dynamicStyles);
|
---|
17 |
|
---|
18 | return className + dynamicClassName;
|
---|
19 | };
|
---|
20 |
|
---|
21 | closure.toString = function () {
|
---|
22 | return className;
|
---|
23 | };
|
---|
24 |
|
---|
25 | return closure;
|
---|
26 | };
|
---|
27 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.