feat: 添加 Noto Sans SC 字体支持

* 在 `package.json` 中添加 `@fontsource/noto-sans-sc` 依赖,以支持 Noto Sans SC 字体。
* 更新 `src/main.ts` 引入 Noto Sans SC 字体的不同粗细样式。
* 修改 `src/styles/base.css` 中的字体栈,优先使用 Noto Sans SC 字体,提升中文显示效果。
This commit is contained in:
AdingApkgg
2025-12-15 10:57:09 +08:00
parent 23409c7ba0
commit 051f03b566
4 changed files with 33 additions and 5 deletions

View File

@@ -28,6 +28,7 @@
},
"dependencies": {
"@fancyapps/ui": "^6.1.7",
"@fontsource/noto-sans-sc": "^5.2.8",
"artalk": "^2.9.1",
"lozad": "^1.16.0",
"lucide-vue-next": "^0.561.0",

8
pnpm-lock.yaml generated
View File

@@ -11,6 +11,9 @@ importers:
'@fancyapps/ui':
specifier: ^6.1.7
version: 6.1.7
'@fontsource/noto-sans-sc':
specifier: ^5.2.8
version: 5.2.8
artalk:
specifier: ^2.9.1
version: 2.9.1(marked@14.1.4)
@@ -295,6 +298,9 @@ packages:
'@fancyapps/ui@6.1.7':
resolution: {integrity: sha512-KHOvuy90JBFDgbNa2V1N9Jg7PE/lSQMXN9VbhR+WQSIxIEi4PV7kndeao7ezir5WeJ8OZRyDelNKJVLicXfBIg==}
'@fontsource/noto-sans-sc@5.2.8':
resolution: {integrity: sha512-8T8HxIS3uAMCfaQawKRH/6yYZ1oRnJZB/CrGwfxGgJa+zAOBgx2lqZMiTY/WbQpLGlPRqX4zHXJYI09CI2q6tA==}
'@humanfs/core@0.19.1':
resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}
engines: {node: '>=18.18.0'}
@@ -1537,6 +1543,8 @@ snapshots:
'@fancyapps/ui@6.1.7': {}
'@fontsource/noto-sans-sc@5.2.8': {}
'@humanfs/core@0.19.1': {}
'@humanfs/node@0.16.7':

View File

@@ -3,6 +3,12 @@ import { createPinia } from 'pinia'
import App from './App.vue'
import { piniaLogger, piniaPerformance, piniaErrorHandler } from './stores/plugins'
// Noto Sans SC 字体(本地安装)
import '@fontsource/noto-sans-sc/300.css'
import '@fontsource/noto-sans-sc/400.css'
import '@fontsource/noto-sans-sc/500.css'
import '@fontsource/noto-sans-sc/700.css'
// 全局基础样式Tailwind CSS @layer base
import './styles/base.css'

View File

@@ -6,11 +6,14 @@
@layer base {
/* body 基础样式 */
body {
/* 字体栈 - 优先使用系统字体,支持中文 */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
"Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB",
"Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei",
"Roboto", Helvetica, Arial, sans-serif;
/* 字体栈 - Google Noto Sans SC + Apple System 备用 */
font-family:
"Noto Sans SC",
-apple-system, BlinkMacSystemFont,
"PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑",
"Segoe UI", Roboto, Helvetica, Arial,
sans-serif;
/* 行高 */
line-height: 1.6;
@@ -44,6 +47,16 @@
color: rgb(226, 232, 240);
}
/* 代码字体 */
code, kbd, pre, samp, .font-mono {
font-family:
Consolas,
"SF Mono", "Monaco",
"Andale Mono", "Ubuntu Mono",
"Noto Sans Mono",
monospace;
}
/* 图片懒加载过渡动画 */
img[loading="lazy"] {
transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);