Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const cx = (styles) => {
const sx = formatStyles(styles)
return injectStyle(styletron, sx)
// return renderer.renderRule(() => sx)
}
module.exports = (rules, synthetic) => {
const len = rules.length;
let first;
let last;
let middle;
const styletron = new StyletronServer();
for (let i = 0; i < len; i++) {
let className = StyletronUtils.injectStyle(styletron, rules[i]);
if (i === 0) {
first = className;
} else if (i === 1000) {
middle = className;
} else if (i === len - 1) {
last = className;
}
}
const styleElement = synthetic
? `<style class="styletron"></style>`
: styletron.getStylesheetsHtml();
return `
Object.keys(st).forEach(k => {
styles[k] = typeof st[k] === 'object'
? injectStyle(styletron, st[k])
: st[k];
});
return styles;
const classMap = Object.keys(styles).reduce((acc, key) => {
acc[key] = utils.injectStyle(this.context.styletron, styles[key])
return acc;
}, {});
return React.createElement(Component, Object.assign({