(fontCSS: string)
| 837 | } |
| 838 | |
| 839 | function injectFontCSS(fontCSS: string): void { |
| 840 | const pipDoc = getPipDoc(); |
| 841 | if (!pipDoc || pipDoc.querySelector('.darkreader--font-fix')) { |
| 842 | return; |
| 843 | } |
| 844 | const style = pipDoc.createElement('style'); |
| 845 | style.classList.add('darkreader'); |
| 846 | style.classList.add('darkreader--font-fix'); |
| 847 | style.textContent = fontCSS; |
| 848 | (pipDoc.head || pipDoc.documentElement).appendChild(style); |
| 849 | } |
| 850 | |
| 851 | function removeFontCSS(): void { |
| 852 | getPipDoc()?.querySelector('.darkreader--font-fix')?.remove(); |
no test coverage detected