Repository URL to install this package:
|
Version:
1.2.11 ▾
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// @flow
const hash_1 = __importDefault(require("../vendor/glamor/hash"));
const StyleSheet_1 = __importDefault(require("../models/StyleSheet"));
exports.default = (stringifyRules, css) => {
const injectGlobal = (...args) => {
const styleSheet = StyleSheet_1.default.master;
const rules = css(...args);
const hash = hash_1.default(JSON.stringify(rules));
const id = `sc-global-${hash}`;
if (!styleSheet.hasId(id)) {
styleSheet.inject(id, stringifyRules(rules));
}
};
return injectGlobal;
};
//# sourceMappingURL=injectGlobal.js.map