移除字体

This commit is contained in:
lutinglt
2025-02-09 22:58:24 +08:00
parent cd9a2a504b
commit 1b2207a13b
15 changed files with 6 additions and 108 deletions

2
.github/release.md vendored
View File

@@ -1,5 +1,7 @@
## 🌈 Style
- **移除字体 (不再集成个性化字体)**
#### 更符合 GitHub 风格
- 仓库代码页侧边栏宽度优化

View File

@@ -21,10 +21,7 @@ jobs:
- name: Build theme
run: |
npm install
npm run build:theme-fonts
mv dist css
npm run build:theme
tar -czf dist/theme-github-fonts.tar.gz css fonts
npm run build
- uses: actions/upload-artifact@v4
with:
name: theme-github

View File

@@ -7,8 +7,6 @@
添加了短暂的过渡动画优化体验(与 GitHub Code 克隆列表动画一致)
UI 默认字体 [Maple Hand](https://github.com/subframe7536/maple-font/tree/other-resources/cn-resource/maple-hand) & [VictorMono Nerd Font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/VictorMono.zip) (优先匹配 `Maple Hand`, 需要系统包含相应字体, 否则使用默认字体)
## 安装
1. 在发布页下载最新的 `theme-github.css` 放入 `gitea/public/assets/css` 目录下
@@ -24,23 +22,6 @@ THEMES = gitea-dark, github
详细请查看 Gitea 文档 [Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
### 集成字体
如果不想手动在系统安装字体, 可以将字体放入 Gitea 中, 在访问时拉取字体文件
>[!CAUTION]
>
> 不推荐此行为, 字体文件较大, 且一些字体粗细样式可能会有缺失
>
> 页面会在加载完字体后切换字体
1. 在发布页下载最新的 `theme-github-fonts.tar.gz` 解压后放入 `gitea/public/assets` 目录下
2. 清除浏览器缓存, 强制刷新浏览器查看效果
文件位置如下:
![安装](screenshots/themetree.png)
## 截图
![仓库](screenshots/repo.png)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,11 +3,9 @@
"version": "1.0.0",
"description": "尽量保持与 GitHub Dark 相同样式的 Gitea 主题",
"scripts": {
"build": "sass src/theme-github.scss:dist/theme-github.css --no-source-map",
"build:theme": "npm run build -- --style=compressed",
"build:theme-fonts": "sass src/theme-github-fonts.scss:dist/theme-github.css --no-source-map --style=compressed",
"build:theme-my": "sass src/theme-github-my.scss:dist/theme-github.css --no-source-map --style=compressed",
"watch": "npm run build -- --watch"
"export": "sass src/theme-github.scss:dist/theme-github.css --no-source-map",
"build": "npm run export -- --style=compressed",
"watch": "npm run export -- --watch"
},
"repository": {
"type": "git",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -1,48 +0,0 @@
// Made by Luting ^-^
@font-face {
font-family: 'Maple Hand';
src: url('/assets/fonts/MapleHand-Regular.ttf') format('truetype');
font-display: swap;
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Maple Hand';
src: url('/assets/fonts/MapleHand-Bold.ttf') format('truetype');
font-display: swap;
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'VictorMono NF';
src: url('/assets/fonts/VictorMonoNerdFont-Regular.ttf') format('truetype');
font-display: swap;
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'VictorMono NF';
src: url('/assets/fonts/VictorMonoNerdFont-Italic.ttf') format('truetype');
font-display: swap;
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'VictorMono NF';
src: url('/assets/fonts/VictorMonoNerdFont-Bold.ttf') format('truetype');
font-display: swap;
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'VictorMono NF';
src: url('/assets/fonts/VictorMonoNerdFont-BoldItalic.ttf') format('truetype');
font-display: swap;
font-weight: bold;
font-style: italic;
}

View File

@@ -1,21 +1,4 @@
// Made by Luting ^-^
:root :lang(zh-CN) {
--fonts-override: 'Maple Hand', 'VictorMono NF', 'VictorMono Nerd Font';
}
.job-step-logs {
font-family: 'ui-monospace', 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'monospace', 'Maple Hand' !important;
}
.repository {
#commits-table .text.right,
#repo-files-table .repo-file-cell.age,
#repo-files-table relative-time {
font-family: 'VictorMono NF', 'VictorMono Nerd Font', 'Maple Hand';
font-weight: bold !important;
}
}
:root {
--is-dark-theme: true;
--border-radius: 6px;

View File

@@ -1,3 +0,0 @@
/* Made by Luting ^-^ */
@use 'fontface';
@use 'theme-github';

View File

@@ -1,12 +0,0 @@
/* Made by Luting ^-^ */
// 独家秘制小主题
@use 'theme-github';
.repository {
#commits-table .text.right,
#repo-files-table .repo-file-cell.age,
#repo-files-table relative-time {
font-family: 'Maple Mono NF', 'Maple Hand';
font-weight: normal !important;
}
}