Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Sanitize the string as will be used in development to prefix the generated
// class name.
meta = meta.replace(new RegExp(/[!"#$%&'()*+,./:; <=>?@[\\\]^`{|}~]/g), '-');
return `${meta}-${rule.key}-${ruleCounter}`;
}
return `${rule.key}-${ruleCounter}`;
};
//const jss = create(preset());
jss.setup(preset());
jss.options.createGenerateClassName = () => generateClassName;
const sheetsManager = new Map();
const sheetsRegistry = new SheetsRegistry();
export default function createJssContext() {
return {
jss,
theme: getCurrentTheme(),
// This is needed in order to deduplicate the injection of CSS in the page.
sheetsManager,
// This is needed in order to inject the critical CSS.
sheetsRegistry,
};
}