mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-25 12:39:03 +08:00
remove injectCSS
This commit is contained in:
parent
8da3b61d46
commit
bb742c1db2
@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user