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

refactor: Body mask always takes effect when enable

上级 68f48b25
......@@ -175,7 +175,7 @@ body:
repeat: false
# Mask effect of the background image.
mask:
enable: true
enable: false
# Opacity of mask (value: 0 ~ 1)
opacity:
# 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')) {
body {
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 {
bodyBgSet();
z-index: $z-index-2;
......@@ -36,13 +28,23 @@ if (hexo-config('body.bg_image.enable')) {
}
}
}
}
body {
if (hexo-config('body.mask.enable')) {
.nightmode {
body {
&::before {
background-color: alpha(#000, hexo-config('body.mask.opacity.night_mode'));
}
&::before {
bodyBgSet();
z-index: $z-index-1;
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.
先完成此消息的编辑!
想要评论请 注册