提交 1d132ce4 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

refactor: Body mask always takes effect when enable

上级 68f48b25
...@@ -175,7 +175,7 @@ body: ...@@ -175,7 +175,7 @@ body:
repeat: false repeat: false
# Mask effect of the background image. # Mask effect of the background image.
mask: mask:
enable: true enable: false
# Opacity of mask (value: 0 ~ 1) # Opacity of mask (value: 0 ~ 1)
opacity: opacity:
# Opacity of the mask by default. # Opacity of the mask by default.
......
bodyBgSet() {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
if (hexo-config('body.bg_image.fixed')) {
position: fixed;
height: 100vh;
}
}
if (hexo-config('body.bg_image.enable')) { if (hexo-config('body.bg_image.enable')) {
body { body {
position: relative; position: relative;
bodyBgSet() {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
if (hexo-config('body.bg_image.fixed')) {
position: fixed;
height: 100vh;
}
}
if (hexo-config('body.mask.enable')) {
&::before {
bodyBgSet();
z-index: $z-index-1;
background-color: alpha(#000, hexo-config('body.mask.opacity.default'));
}
}
&::after { &::after {
bodyBgSet(); bodyBgSet();
z-index: $z-index-2; z-index: $z-index-2;
...@@ -36,13 +28,23 @@ if (hexo-config('body.bg_image.enable')) { ...@@ -36,13 +28,23 @@ if (hexo-config('body.bg_image.enable')) {
} }
} }
} }
}
body {
if (hexo-config('body.mask.enable')) { if (hexo-config('body.mask.enable')) {
.nightmode { &::before {
body { bodyBgSet();
&::before { z-index: $z-index-1;
background-color: alpha(#000, hexo-config('body.mask.opacity.night_mode')); background-color: alpha(#000, hexo-config('body.mask.opacity.default'));
} }
}
}
if (hexo-config('body.mask.enable')) {
.nightmode {
body {
&::before {
background-color: alpha(#000, hexo-config('body.mask.opacity.night_mode'));
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册