From 4ee4054f8e29c477136e4ffb7748dd29ab340ed2 Mon Sep 17 00:00:00 2001 From: Kuizuo Date: Fri, 29 Dec 2023 06:21:55 +0800 Subject: [PATCH] feat: change font --- docusaurus.config.ts | 21 +++++++++++---------- src/components/UserCard/index.tsx | 2 +- src/css/custom.scss | 19 ++++--------------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 7b49340f..b7ac9ec5 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -40,15 +40,7 @@ const config: Config = { hideable: true, }, }, - headTags: [ - { - tagName: 'meta', - attributes: { - name: 'description', - content: '愧怍的个人博客', - }, - }, - ], + navbar: { logo: { alt: '愧怍', @@ -256,7 +248,16 @@ const config: Config = { }, ], ], - stylesheets: [], + headTags: [ + { + tagName: 'meta', + attributes: { + name: 'description', + content: '愧怍的个人博客', + }, + }, + ], + stylesheets: ['https://cdn.jsdelivr.net/npm/misans@4.0.0/lib/Normal/MiSans-Normal.min.css'], i18n: { defaultLocale: 'zh-CN', locales: ['en', 'zh-CN'], diff --git a/src/components/UserCard/index.tsx b/src/components/UserCard/index.tsx index 0ef83b0f..ff9a4fde 100644 --- a/src/components/UserCard/index.tsx +++ b/src/components/UserCard/index.tsx @@ -1,7 +1,7 @@ import React from 'react' import clsx from 'clsx' import { usePluginData } from '@docusaurus/useGlobalData' -import type { BlogTags, BlogPost } from '@docusaurus/plugin-content-blog' +import type { BlogPost } from '@docusaurus/plugin-content-blog' import Link from '@docusaurus/Link' import { Icon } from '@iconify/react' import SocialLinks from '@site/src/components/SocialLinks' diff --git a/src/css/custom.scss b/src/css/custom.scss index 08e1de86..55c1f0ee 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -7,12 +7,9 @@ --ifm-color-primary-lighter: #b0e6ff; --ifm-color-primary-lightest: #d5f1fd; --ifm-code-font-size: 95%; - --ifm-font-family-base: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', - 'Helvetica Neue', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', - 'Segoe UI Symbol', 'Noto Color Emoji', consolas, sfmono-regular, menlo, monaco, - 'Liberation Mono', monospace; + --ifm-font-family-base: misans, ui-sans-serif, system-ui, -apple-system; - --ifm-heading-font-family: var(--ifm-font-family-base); + --ifm-heading-font-family: ui-sans-serif, system-ui, -apple-system; --ifm-navbar-shadow: 0 4px 28px rgb(0 0 0 / 10%); --text-color: #2b333e; @@ -76,19 +73,11 @@ html[data-theme='dark'] { body { font-family: + misans, system-ui, -apple-system, 'PingFang SC', - 'Microsoft YaHei', - 'Segoe UI', - Roboto, - Helvetica, - 'noto sans sc', - 'hiragino sans gb', - sans-serif, - 'Apple Color Emoji', - 'Segoe UI Emoji', - 'Not Color Emoji'; + 'Microsoft YaHei'; } html,