(style: HTMLStyleElement, prevNode: Node | null, watchAlias: string, callback?: () => void)
| 90 | } |
| 91 | |
| 92 | function injectStaticStyle(style: HTMLStyleElement, prevNode: Node | null, watchAlias: string, callback?: () => void) { |
| 93 | const mode = getStyleInjectionMode(); |
| 94 | if (mode === 'next') { |
| 95 | document.head.insertBefore(style, prevNode ? prevNode.nextSibling : document.head.firstChild); |
| 96 | setupNodePositionWatcher(style, watchAlias, callback); |
| 97 | } else if (mode === 'away') { |
| 98 | injectStyleAway(style); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | const scheduleInversionStyleUpdate = throttle(() => { |
| 103 | const invertStyle = document.head?.querySelector<HTMLStyleElement>('.darkreader--invert'); |
no test coverage detected