revert Fix theme apply button so it updates instantly

I tried to do this while keeping the CSP changes but it seems like it is impossible, however, the themes do with with these enabled still and the CSP changes still working, so I am not sure why they were even implemented.
This commit is contained in:
fox 2023-03-13 09:20:41 +00:00
parent 6b180d30b3
commit 8c9c6e0f34
5 changed files with 6 additions and 9 deletions

3
.gitignore vendored
View file

@ -9,5 +9,4 @@ selenium-debug.log
config/local.json
config/local.*.json
docs/site/
.vscode/
*.log
.vscode/

View file

@ -10,6 +10,7 @@
<link rel="stylesheet" href="/static/font/css/lato.css">
<link rel="stylesheet" href="/static/mfm.css">
<link rel="stylesheet" href="/static/custom.css">
<link rel="stylesheet" href="/static/theme-holder.css" id="theme-holder">
<!--server-generated-meta-->
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="manifest" href="/manifest.json">

View file

@ -115,8 +115,7 @@ export default {
avatarRadiusLocal: '',
avatarAltRadiusLocal: '',
attachmentRadiusLocal: '',
tooltipRadiusLocal: '',
chatMessageRadiusLocal: ''
tooltipRadiusLocal: ''
}
},
created () {
@ -231,8 +230,7 @@ export default {
avatar: this.avatarRadiusLocal,
avatarAlt: this.avatarAltRadiusLocal,
tooltip: this.tooltipRadiusLocal,
attachment: this.attachmentRadiusLocal,
chatMessage: this.chatMessageRadiusLocal
attachment: this.attachmentRadiusLocal
}
},
preview () {

View file

@ -4,12 +4,10 @@ import { getColors, computeDynamicColor, getOpacitySlot } from '../theme_data/th
export const applyTheme = (input) => {
const { rules } = generatePreset(input)
const head = document.head
const body = document.body
body.classList.add('hidden')
const styleEl = document.createElement('style')
head.appendChild(styleEl)
const styleEl = document.getElementById('theme-holder')
const styleSheet = styleEl.sheet
styleSheet.toString()

1
static/theme-holder.css Normal file
View file

@ -0,0 +1 @@
// This file intentionally left blank