Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
pleroma-fe
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Your New SJW Waifu
pleroma-fe
Commits
ea5b36a5
Commit
ea5b36a5
authored
Aug 27, 2019
by
Tae Hoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor toggling body visibility using class
parent
e75ac9dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
src/App.scss
src/App.scss
+4
-0
src/services/style_setter/style_setter.js
src/services/style_setter/style_setter.js
+4
-4
No files found.
src/App.scss
View file @
ea5b36a5
...
...
@@ -49,6 +49,10 @@ body {
overflow-x
:
hidden
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
&
.hidden
{
display
:
none
;
}
}
a
{
...
...
src/services/style_setter/style_setter.js
View file @
ea5b36a5
...
...
@@ -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 })
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment