akkoma stricter csp compat
This commit is contained in:
parent
0a8d7ea659
commit
40a17862a5
5 changed files with 130 additions and 133 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue