fixed a "leak" that made too many <style> elements

This commit is contained in:
Henry Jameson 2024-06-21 22:45:10 +03:00
parent 1306c46a53
commit eca8da6593

View file

@ -188,7 +188,9 @@ export const applyConfig = (input) => {
.filter(([k, v]) => v)
.map(([k, v]) => `--${k}: ${v}`).join(';')
document.getElementById('style-config')?.remove()
const styleEl = document.createElement('style')
styleEl.id = 'style-config'
head.appendChild(styleEl)
const styleSheet = styleEl.sheet