source: imaps-frontend/node_modules/nano-css/addon/limit.js

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 735 bytes
Line 
1'use strict';
2
3exports.addon = function (renderer, limit) {
4 limit = limit || 50000;
5
6 if (process.env.NODE_ENV !== 'production') {
7 require('./__dev__/warnOnMissingDependencies')('limit', renderer, ['putRaw']);
8 }
9
10 if (!renderer.client) {
11 var putRaw = renderer.putRaw;
12
13 renderer.putRaw = function (rawCssRule) {
14 if (renderer.raw.length + rawCssRule.length > limit) {
15 /* eslint-disable */
16 console.info('CSS was not injected, because total CSS would go over ' + limit + ' byte limit.');
17 console.log(rawCssRule);
18 /* eslint-enable */
19
20 return;
21 }
22
23 putRaw(rawCssRule);
24 };
25 }
26};
Note: See TracBrowser for help on using the repository browser.