21 lines
410 B
JavaScript
21 lines
410 B
JavaScript
function createContentStyles({
|
|
STYLE_ID,
|
|
redwoodStyles,
|
|
environment
|
|
}) {
|
|
const { document } = environment;
|
|
function ensureExtensionStyles() {
|
|
if (document.getElementById(STYLE_ID)) {
|
|
return;
|
|
}
|
|
|
|
const style = document.createElement("style");
|
|
style.id = STYLE_ID;
|
|
style.textContent = redwoodStyles;
|
|
|
|
document.head.append(style);
|
|
}
|
|
|
|
return { ensureExtensionStyles };
|
|
}
|