remove injectCSS

This commit is contained in:
Philipp Kühn 2020-04-10 23:09:31 +02:00
parent 8da3b61d46
commit bb742c1db2
2 changed files with 1 additions and 15 deletions

View File

@ -8,7 +8,6 @@ import { dropCursor } from 'prosemirror-dropcursor'
import { gapCursor } from 'prosemirror-gapcursor'
import magicMethods from './utils/magicMethods'
import elementFromString from './utils/elementFromString'
import injectCSS from './utils/injectCSS'
import getAllMethodNames from './utils/getAllMethodNames'
import nodeIsActive from './utils/nodeIsActive'
import markIsActive from './utils/markIsActive'
@ -72,7 +71,7 @@ export class Editor extends EventEmitter {
this.registerCommand('removeMarks', require('./commands/removeMarks').default)
if (this.options.injectCSS) {
this.css = injectCSS(require('./style.css'))
require('./style.css')
}
}

View File

@ -1,13 +0,0 @@
export default function injectCSS(css: string) {
const style = document.createElement('style')
style.type = 'text/css'
style.textContent = css
const { head } = document
const { firstChild } = head
if (firstChild) {
return head.insertBefore(style, firstChild)
} else {
return head.appendChild(style)
}
}