mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-24 17:47:50 +08:00
16 lines
370 B
TypeScript
16 lines
370 B
TypeScript
|
export default function (css: string) {
|
||
|
if (process.env.NODE_ENV !== 'test') {
|
||
|
const style = document.createElement('style')
|
||
|
style.type = 'text/css'
|
||
|
style.textContent = css
|
||
|
const { head } = document
|
||
|
const { firstChild } = head
|
||
|
|
||
|
if (firstChild) {
|
||
|
head.insertBefore(style, firstChild)
|
||
|
} else {
|
||
|
head.appendChild(style)
|
||
|
}
|
||
|
}
|
||
|
}
|