Skip to content

Commit

Permalink
perf: use css variable setting blog title
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Nov 9, 2023
1 parent 1fc591d commit d485b30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion source/css/common/css-variables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
--header-height 70px
--header-shrink-height calc(var(--header-height) * 0.72)
--header-backdrop-filter-blur 4px
--header-scroll-progress-bar-height 2PX
--header-scroll-progress-bar-height 2px
--header-title-font-family var(--base-font-family)
--header-title-font-size 1.8rem


// ==============================================================================================
Expand Down
8 changes: 4 additions & 4 deletions source/css/layout/_partial/header.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$site-name-font-size = 1.8rem
$pc-search-icon-font-size = 1.5rem
$menu-bar-line-height = 2.5px
$logo-image-box-width = 2.68rem
Expand Down Expand Up @@ -96,16 +95,17 @@ $logo-image-box-width = 2.68rem
.site-name {
color var(--text-color-1)
font-weight 600
font-size $site-name-font-size
font-size var(--header-title-font-size)
font-family var(--header-title-font-family)
line-height 1
letter-spacing 1px

+keep-tablet() {
font-size $site-name-font-size * 0.9
font-size calc(var(--header-title-font-size) * 0.9)
}

+keep-mobile() {
font-size $site-name-font-size * 0.8
font-size calc(var(--header-title-font-size) * 0.8)
}
}
}
Expand Down

0 comments on commit d485b30

Please sign in to comment.