akkoma stricter csp compat

This commit is contained in:
Henry Jameson 2025-06-28 14:54:59 +03:00
commit 40a17862a5
5 changed files with 130 additions and 133 deletions

View file

@ -234,20 +234,14 @@ export const applyConfig = (input) => {
return
}
const head = document.head
const rules = Object
.entries(config)
.filter(([, v]) => v)
.map(([k, v]) => `--${k}: ${v}`).join(';')
document.getElementById('style-config')?.remove()
const styleEl = document.getElementById('theme-holder')
styleEl.id = 'style-config'
head.appendChild(styleEl)
const styleSheet = styleEl.sheet
styleSheet.toString()
styleSheet.insertRule(`:root { ${rules} }`, 'index-max')
// TODO find a way to make this not apply to theme previews