diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-09-09 19:22:11 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-09-09 19:22:11 +0000 |
| commit | a4a4c46fe7baf4da3188b549fecec4ceb071fca3 (patch) | |
| tree | 9d4302f556eff15f2d8dafcb8709cb8de44c96ec /src | |
| parent | e75ac9ddbc66a7e3cd40ef130b26b06b8cec9f1d (diff) | |
| parent | ea5b36a597dad2488b2204f6396c2f3d530cdf25 (diff) | |
Merge branch '648-2' into 'develop'
Fix wrong body css while toggling visibility
Closes #648
See merge request pleroma/pleroma-fe!930
Diffstat (limited to 'src')
| -rw-r--r-- | src/App.scss | 4 | ||||
| -rw-r--r-- | src/services/style_setter/style_setter.js | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/App.scss b/src/App.scss index fac800bc..2e20fb57 100644 --- a/src/App.scss +++ b/src/App.scss @@ -49,6 +49,10 @@ body { overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + + &.hidden { + display: none; + } } a { diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index f186d202..1cf7edc3 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -22,7 +22,7 @@ const setStyle = (href, commit) => { ***/ const head = document.head const body = document.body - body.style.display = 'none' + body.classList.add('hidden') const cssEl = document.createElement('link') cssEl.setAttribute('rel', 'stylesheet') cssEl.setAttribute('href', href) @@ -46,7 +46,7 @@ const setStyle = (href, commit) => { head.appendChild(styleEl) // const styleSheet = styleEl.sheet - body.style.display = 'initial' + body.classList.remove('hidden') } cssEl.addEventListener('load', setDynamic) @@ -75,7 +75,7 @@ const applyTheme = (input, commit) => { const { rules, theme } = generatePreset(input) const head = document.head const body = document.body - body.style.display = 'none' + body.classList.add('hidden') const styleEl = document.createElement('style') head.appendChild(styleEl) @@ -86,7 +86,7 @@ const applyTheme = (input, commit) => { styleSheet.insertRule(`body { ${rules.colors} }`, 'index-max') styleSheet.insertRule(`body { ${rules.shadows} }`, '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: 'radii', value: radii }) |
