From b10bcd6830382bfc4e166fbc94e76c8465f3c43f Mon Sep 17 00:00:00 2001 From: bamboo Date: Wed, 7 Feb 2024 01:59:14 +0800 Subject: [PATCH] :lipstick: Feat: update all fonts --- hugo.yaml | 1 + themes/PaperMod/assets/css/common/archive.css | 14 +++++++ themes/PaperMod/assets/css/common/footer.css | 1 + themes/PaperMod/assets/css/common/header.css | 1 + .../PaperMod/assets/css/common/post-entry.css | 6 ++- .../assets/css/common/post-single.css | 33 +++++++++++++--- themes/PaperMod/assets/css/common/terms.css | 1 + themes/PaperMod/assets/css/core/fontface.css | 38 +++++++++++++++++++ themes/PaperMod/assets/css/core/reset.css | 4 +- .../PaperMod/assets/css/core/theme-vars.css | 4 +- themes/PaperMod/layouts/_default/list.html | 2 +- themes/PaperMod/layouts/partials/head.html | 3 +- 12 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 themes/PaperMod/assets/css/core/fontface.css diff --git a/hugo.yaml b/hugo.yaml index 46f03f8..8a05348 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -41,6 +41,7 @@ params: ShowReadingTime: true ShowShareButtons: false ShowPostNavLinks: true + ShowPageNums: true ShowBreadCrumbs: true ShowCodeCopyButtons: false ShowWordCount: false diff --git a/themes/PaperMod/assets/css/common/archive.css b/themes/PaperMod/assets/css/common/archive.css index 7e7e245..e68751f 100644 --- a/themes/PaperMod/assets/css/common/archive.css +++ b/themes/PaperMod/assets/css/common/archive.css @@ -42,3 +42,17 @@ color: var(--secondary); font-size: 14px; } + + +.archive-year-header, +.archive-month-header { + font-family: 'Roboto Slab', 'Open Sans', serif; +} + +.archive-entry-title { + font-family: 'Roboto Slab', 'Open Sans', 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', serif; +} + +.archive-meta { + font-family: 'Fira Sans', 'Open Sans', serif;; +} diff --git a/themes/PaperMod/assets/css/common/footer.css b/themes/PaperMod/assets/css/common/footer.css index de3322c..837d20e 100644 --- a/themes/PaperMod/assets/css/common/footer.css +++ b/themes/PaperMod/assets/css/common/footer.css @@ -13,6 +13,7 @@ display: flex; flex-direction: column; align-items: center; + font-family: 'Roboto Slab', 'Open Sans', serif; } .footer-inner { diff --git a/themes/PaperMod/assets/css/common/header.css b/themes/PaperMod/assets/css/common/header.css index db8fd67..67d4857 100644 --- a/themes/PaperMod/assets/css/common/header.css +++ b/themes/PaperMod/assets/css/common/header.css @@ -6,6 +6,7 @@ margin-inline-start: auto; margin-inline-end: auto; line-height: var(--header-height); + font-family: 'Roboto Slab', 'Open Sans', serif; } .nav a { diff --git a/themes/PaperMod/assets/css/common/post-entry.css b/themes/PaperMod/assets/css/common/post-entry.css index 45d03ee..881e2e1 100644 --- a/themes/PaperMod/assets/css/common/post-entry.css +++ b/themes/PaperMod/assets/css/common/post-entry.css @@ -64,6 +64,7 @@ .entry-header { max-width: 60%; + font-family: 'Roboto Slab', 'Open Sans', 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', serif; } .entry-header h2 { @@ -91,13 +92,14 @@ align-items: center; gap: 4px; transition: all 0.3s cubic-bezier(.4,0,.2,1); + font-family: 'Fira Sans', 'Open Sans', serif; } -.entry-footer svg { +.entry-footer > svg { transition: all 0.3s cubic-bezier(.4,0,.2,1); } -.post-entry:hover .entry-footer svg { +.post-entry:hover .entry-footer > svg { transform: translate(5px, 0); } diff --git a/themes/PaperMod/assets/css/common/post-single.css b/themes/PaperMod/assets/css/common/post-single.css index 62b664b..169d476 100644 --- a/themes/PaperMod/assets/css/common/post-single.css +++ b/themes/PaperMod/assets/css/common/post-single.css @@ -3,8 +3,14 @@ margin: 24px auto var(--content-gap) auto; } +.page-header, +.post-header, +.post-title { + font-family: 'Roboto Slab', 'Open Sans', 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', serif; +} + .post-title { - margin-bottom: 2px; + margin-bottom: 10px; font-size: 40px; } @@ -19,6 +25,7 @@ font-size: 14px; display: flex; flex-wrap: wrap; + font-family: 'Fira Sans', 'Open Sans', serif;; } .post-meta .i18n_list li { @@ -35,7 +42,7 @@ .post-content { color: var(--content); line-height: 1.75rem; - font-family: ui-serif,Georgia,Cambria,Times New Roman,Times,serif; + font-family: 'Fira Sans', 'Open Sans', 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', serif; } .post-content h1, @@ -45,11 +52,12 @@ .post-content h5, .post-content h6 { position: relative; + font-family: 'Roboto Slab', 'Open Sans', 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', serif; } .post-content .anchor { position: absolute; - left: -30px; + left: 0; } .post-content h3, @@ -85,6 +93,16 @@ font-size: 12px; } +.post-content h1, +.post-content h2, +.post-content h3, +.post-content h4, +.post-content h5, +.post-content h6 { + margin-left: -20px; + padding-left: 20px; +} + .post-content a:not(.anchor) { border-bottom: solid 2px var(--pink); @@ -110,7 +128,10 @@ .post-content a code { margin: auto 0; border-radius: 0; - box-shadow: 0 -1px 0 var(--primary) inset; +} + +.post-content a:hover code { + color: initial; } .post-content del { @@ -201,6 +222,7 @@ .post-content .highlight pre { margin: 0; + border-radius: var(--radius); } .post-content .highlighttable { @@ -223,10 +245,11 @@ .post-content code { margin: auto 4px; padding: 4px 6px; - font-size: 0.78em; + font-size: 0.93em; line-height: 1.5; background: var(--code-bg); border-radius: 2px; + font-family: 'Space Mono', Courier, Monaco, monospace; } .post-content pre code { diff --git a/themes/PaperMod/assets/css/common/terms.css b/themes/PaperMod/assets/css/common/terms.css index 244614b..96de697 100644 --- a/themes/PaperMod/assets/css/common/terms.css +++ b/themes/PaperMod/assets/css/common/terms.css @@ -10,6 +10,7 @@ background: var(--tertiary); border-radius: 6px; transition: transform 0.1s; + font-family: 'Fira Sans', 'Open Sans', serif; } .terms-tags a:active { diff --git a/themes/PaperMod/assets/css/core/fontface.css b/themes/PaperMod/assets/css/core/fontface.css new file mode 100644 index 0000000..2d5a586 --- /dev/null +++ b/themes/PaperMod/assets/css/core/fontface.css @@ -0,0 +1,38 @@ +@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Noto+Serif+JP&family=Noto+Serif+SC&family=Noto+Serif+TC&family=Roboto+Slab:wght@100..900&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap'); + +@font-face { + font-family: "PaperMod SC"; + src: local("Songti SC Regular"), local(STSongti-SC-Regular); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: "PaperMod SC"; + src: local("Songti SC Bold"), local(STSongti-SC-Bold); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: "PaperMod TC"; + src: local("Songti TC Regular"), local(STSongti-TC-Regular); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: "PaperMod TC"; + src: local("Songti TC Bold"), local(STSongti-TC-Bold); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: "PaperMod Emoji"; + src: local("Apple Color Emoji"), + local("Segoe UI Emoji"), + local("Segoe UI Symbol"), + local("Noto Color Emoji"), + local("Android Emoji"); +} diff --git a/themes/PaperMod/assets/css/core/reset.css b/themes/PaperMod/assets/css/core/reset.css index 6c39fe0..2e802ac 100644 --- a/themes/PaperMod/assets/css/core/reset.css +++ b/themes/PaperMod/assets/css/core/reset.css @@ -24,7 +24,9 @@ h6 { } body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Fira Sans', 'Open Sans', + 'Noto Serif SC', 'PaperMod SC', 'Noto Serif JP', 'Noto Serif TC', 'PaperMod TC', + 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 16px; line-height: 1.6; word-break: break-word; diff --git a/themes/PaperMod/assets/css/core/theme-vars.css b/themes/PaperMod/assets/css/core/theme-vars.css index 02e2ab7..8d4e44b 100644 --- a/themes/PaperMod/assets/css/core/theme-vars.css +++ b/themes/PaperMod/assets/css/core/theme-vars.css @@ -5,7 +5,7 @@ --main-width: 750px; --header-height: 60px; --footer-height: 108px; - --radius: 8px; + --radius: 4px; --theme: rgb(255, 255, 255); --entry: rgb(255, 255, 255); --primary: rgb(30, 30, 30); @@ -13,7 +13,7 @@ --tertiary: rgb(214, 214, 214); --hilite: rgb(21 21 21); --content: rgb(31, 31, 31); - --code-block-bg: rgb(28, 29, 33); + --code-block-bg: rgb(56, 56, 56); --code-bg: rgb(245, 245, 245); --border: rgb(221, 221, 221); --border-2: rgb(186, 186, 186); diff --git a/themes/PaperMod/layouts/_default/list.html b/themes/PaperMod/layouts/_default/list.html index d74b950..ee934f3 100644 --- a/themes/PaperMod/layouts/_default/list.html +++ b/themes/PaperMod/layouts/_default/list.html @@ -95,7 +95,7 @@

{{- end }} -{{- end }} +{{- end }} {{/* end range $paginator */}} {{- if gt $paginator.TotalPages 1 }}