Merge branch '648-2' into 'develop'

Fix wrong body css while toggling visibility

Closes #648

See merge request pleroma/pleroma-fe!930
This commit is contained in:
Shpuld Shpludson 2019-09-09 19:22:11 +00:00
commit a4a4c46fe7
2 changed files with 8 additions and 4 deletions

View file

@ -49,6 +49,10 @@ body {
overflow-x: hidden; overflow-x: hidden;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
&.hidden {
display: none;
}
} }
a { a {

View file

@ -22,7 +22,7 @@ const setStyle = (href, commit) => {
***/ ***/
const head = document.head const head = document.head
const body = document.body const body = document.body
body.style.display = 'none' body.classList.add('hidden')
const cssEl = document.createElement('link') const cssEl = document.createElement('link')
cssEl.setAttribute('rel', 'stylesheet') cssEl.setAttribute('rel', 'stylesheet')
cssEl.setAttribute('href', href) cssEl.setAttribute('href', href)
@ -46,7 +46,7 @@ const setStyle = (href, commit) => {
head.appendChild(styleEl) head.appendChild(styleEl)
// const styleSheet = styleEl.sheet // const styleSheet = styleEl.sheet
body.style.display = 'initial' body.classList.remove('hidden')
} }
cssEl.addEventListener('load', setDynamic) cssEl.addEventListener('load', setDynamic)
@ -75,7 +75,7 @@ const applyTheme = (input, commit) => {
const { rules, theme } = generatePreset(input) const { rules, theme } = generatePreset(input)
const head = document.head const head = document.head
const body = document.body const body = document.body
body.style.display = 'none' body.classList.add('hidden')
const styleEl = document.createElement('style') const styleEl = document.createElement('style')
head.appendChild(styleEl) head.appendChild(styleEl)
@ -86,7 +86,7 @@ const applyTheme = (input, commit) => {
styleSheet.insertRule(`body { ${rules.colors} }`, 'index-max') styleSheet.insertRule(`body { ${rules.colors} }`, 'index-max')
styleSheet.insertRule(`body { ${rules.shadows} }`, 'index-max') styleSheet.insertRule(`body { ${rules.shadows} }`, 'index-max')
styleSheet.insertRule(`body { ${rules.fonts} }`, 'index-max') styleSheet.insertRule(`body { ${rules.fonts} }`, 'index-max')
body.style.display = 'initial' body.classList.remove('hidden')
// commit('setOption', { name: 'colors', value: htmlColors }) // commit('setOption', { name: 'colors', value: htmlColors })
// commit('setOption', { name: 'radii', value: radii }) // commit('setOption', { name: 'radii', value: radii })