mirror of
https://git.youjo.love/youjo/youjo-fe.git
synced 2024-11-20 05:49:54 +01:00
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:
parent
9e98ace04f
commit
6b180d30b3
5 changed files with 9 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -9,4 +9,5 @@ selenium-debug.log
|
|||
config/local.json
|
||||
config/local.*.json
|
||||
docs/site/
|
||||
.vscode/
|
||||
.vscode/
|
||||
*.log
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<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">
|
||||
|
|
|
@ -115,7 +115,8 @@ export default {
|
|||
avatarRadiusLocal: '',
|
||||
avatarAltRadiusLocal: '',
|
||||
attachmentRadiusLocal: '',
|
||||
tooltipRadiusLocal: ''
|
||||
tooltipRadiusLocal: '',
|
||||
chatMessageRadiusLocal: ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
@ -230,7 +231,8 @@ export default {
|
|||
avatar: this.avatarRadiusLocal,
|
||||
avatarAlt: this.avatarAltRadiusLocal,
|
||||
tooltip: this.tooltipRadiusLocal,
|
||||
attachment: this.attachmentRadiusLocal
|
||||
attachment: this.attachmentRadiusLocal,
|
||||
chatMessage: this.chatMessageRadiusLocal
|
||||
}
|
||||
},
|
||||
preview () {
|
||||
|
|
|
@ -4,10 +4,12 @@ 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.getElementById('theme-holder')
|
||||
const styleEl = document.createElement('style')
|
||||
head.appendChild(styleEl)
|
||||
const styleSheet = styleEl.sheet
|
||||
|
||||
styleSheet.toString()
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
// This file intentionally left blank
|
Loading…
Reference in a new issue