UNPKG

759 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Stylesheet_1 = require("./Stylesheet");
4/**
5 * Renders a given string and returns both html and css needed for the html.
6 * @param onRender - Function that returns a string.
7 * @param namespace - Optional namespace to prepend to css classnames to avoid collisions.
8 */
9function renderStatic(onRender, namespace) {
10 var stylesheet = Stylesheet_1.Stylesheet.getInstance();
11 stylesheet.setConfig({
12 injectionMode: Stylesheet_1.InjectionMode.none,
13 namespace: namespace,
14 });
15 stylesheet.reset();
16 return {
17 html: onRender(),
18 css: stylesheet.getRules(true),
19 };
20}
21exports.renderStatic = renderStatic;
22//# sourceMappingURL=server.js.map
\No newline at end of file