diff --git a/source/css/_common/header.styl b/source/css/_common/header.styl index 291ba9c379c6da0ea1e66ba4899d86d24d0e117f..2fccb4864e57170172f409cd5bc9720633da30be 100644 --- a/source/css/_common/header.styl +++ b/source/css/_common/header.styl @@ -1,6 +1,7 @@ +$header-height = convert(hexo-config('header.height') || '80vh') if (hexo-config('header.height')) - $header-height = unit( - convert(hexo-config('header.height') || '80%'), 'vh') + if (match('%', hexo-config('header.height'))) + $header-height = unit(convert(hexo-config('header.height')), 'vh') #header display: flex @@ -27,8 +28,10 @@ $header-nav-color &::after color: $header-nav-link-hover-color -$header-nav-height = convert( - hexo-config('header.nav_height') || '50px') +$header-nav-height = convert(hexo-config('header.nav_height') || '50px') +if (hexo-config('header.nav_height')) + if (match('%', hexo-config('header.nav_height'))) + $header-nav-height = unit(convert(hexo-config('header.nav_height')), 'vh') .header-nav position: fixed