diff --git a/_config.yml b/_config.yml index 16e8bb55169823e73a50bd4a3eb0b41286a31048..75b6fe1fbb43424c95d4a4f75da5a0bd0609171e 100644 --- a/_config.yml +++ b/_config.yml @@ -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. diff --git a/source/css/_common/outline/macro.styl b/source/css/_common/outline/macro.styl index 9485dad73ce0ab2e2caf86a4688ae84f4fecbc7b..a7db78b034a8d3d5a9906f2422e6ec06ed273235 100644 --- a/source/css/_common/outline/macro.styl +++ b/source/css/_common/outline/macro.styl @@ -1,30 +1,22 @@ +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')); } } }