File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,11 @@ const injectFunc = `
4
4
function injectStyle(css) {
5
5
if (!css || typeof document === 'undefined') return
6
6
7
- const head = document.head || document.getElementsByTagName('head')[0]
8
- const style = document.createElement('style')
9
- style.type = 'text/css'
10
-
11
- if(head.firstChild) {
12
- head.insertBefore(style, head.firstChild)
13
- } else {
14
- head.appendChild(style)
15
- }
7
+ let head = document.head || document.getElementsByTagName('head')[0]
8
+ let style = document.createElement('style')
16
9
17
- if(style.styleSheet) {
18
- style.styleSheet.cssText = css
19
- } else {
20
- style.appendChild(document.createTextNode(css))
21
- }
10
+ head.appendChild(style)
11
+ style.appendChild(document.createTextNode(css))
22
12
}
23
13
` ;
24
14
You can’t perform that action at this time.
0 commit comments