Skip to content

Commit

Permalink
refactor: Change the support unit of header & nav height
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Jun 18, 2019
1 parent d834e1a commit 6f9f3a5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/css/_common/header.styl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6f9f3a5

Please sign in to comment.