Compare commits
7 Commits
a4ae937291
...
1d8dfdb82b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d8dfdb82b | ||
|
|
11422f3b05 | ||
|
|
cca5e4e435 | ||
|
|
780c72919d | ||
|
|
dc4eff2bd7 | ||
|
|
3b5a596b2f | ||
|
|
41deab68c9 |
@@ -1,4 +1,8 @@
|
|||||||
|
# 开发模式下编译的主题 (开发模式仅编译单个主题)
|
||||||
DEV_THEME=dark
|
DEV_THEME=dark
|
||||||
|
# 把编译后的主题上传到服务器的服务器名称, 通过 SCP 上传
|
||||||
SSH_SERVER=localhost
|
SSH_SERVER=localhost
|
||||||
|
# 上传到服务器的用户名称, 不支持密码, 请确保有 SSH 免密登录权限
|
||||||
SSH_USER=root
|
SSH_USER=root
|
||||||
|
# 上传到服务器的主题路径, 请使用绝对路径
|
||||||
GITEA_THEME_PATH=/data/gitea/public/assets/css/
|
GITEA_THEME_PATH=/data/gitea/public/assets/css/
|
||||||
1
.github/release.md
vendored
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- 支持自动颜色主题 (跟随系统)
|
- 支持自动颜色主题 (跟随系统)
|
||||||
- 支持亮色主题
|
- 支持亮色主题
|
||||||
|
- 支持柔和的暗色主题 (dark-dimmed)
|
||||||
|
|
||||||
## 🌈 Style
|
## 🌈 Style
|
||||||
|
|
||||||
|
|||||||
5
.github/workflows/release.yml
vendored
@@ -19,8 +19,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export TZ=Asia/Shanghai
|
export TZ=Asia/Shanghai
|
||||||
TAG="v$(npm run -s version).$(date +%y%m%d%H%M)"
|
TAG="v$(npm run -s version).$(date +%y%m%d%H%M)"
|
||||||
cd dist
|
tar -zcf dist/theme-github.tar.gz --remove-files dist/theme-github-auto.css dist/theme-github-light.css dist/theme-github-dark.css dist/theme-github-soft-dark.css
|
||||||
tar -zcf theme-github.tar.gz --remove-files theme-github-auto.css theme-github-light.css theme-github-dark.css
|
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
|
||||||
gh release create "$TAG" * --notes-file .github/release.md --draft -t $TAG
|
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
158
CONTRIBUTING.md
@@ -1,7 +1,157 @@
|
|||||||
|
# 贡献指南
|
||||||
|
|
||||||
|
## 目录结构
|
||||||
|
|
||||||
| 目录 | 说明 |
|
| 目录 | 说明 |
|
||||||
| ----------------- | ---------------------------- |
|
| ----------------- | ---------------------------- |
|
||||||
| styles | 元素 GitHub 风格 |
|
| src | 主题生成框架与辅助工具的包 |
|
||||||
| styles/components | 具体页面的元素单独风格 |
|
| src/core | 主题生成框架 |
|
||||||
| styles/public | 适用大部分页面的元素默认风格 |
|
| src/functions | 主题辅助工具 |
|
||||||
|
| src/types | 主题的颜色变量定义 |
|
||||||
|
| styles | 主题样式 |
|
||||||
|
| styles/components | 具体页面的元素的样式 |
|
||||||
|
| styles/public | 基础元素或跨页面的元素的样式 |
|
||||||
| themes | 颜色主题 |
|
| themes | 颜色主题 |
|
||||||
| themes/\<theme> | 具体颜色主题自己的颜色或风格 |
|
|
||||||
|
## 贡献说明
|
||||||
|
|
||||||
|
本主题不推荐样式贡献, 因为 Gitea 主题最终是由单个 CSS 文件提供, 所以会有先后顺序覆盖, 样式影响广泛等问题.
|
||||||
|
|
||||||
|
开发者每个人的思路不一样, 审核很难看出这些问题, 会极大增加维护难度.
|
||||||
|
|
||||||
|
如果确定理解了 Gitea 的样式布局和我的思路, 请先提交 Issue 确认工作量和预期效果, 然后再开发提交 PR.
|
||||||
|
|
||||||
|
如果认为有更好的思路, 欢迎提交 Issue.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> 提交 PR 时, 请执行 `npm run commit`
|
||||||
|
|
||||||
|
## 开发环境
|
||||||
|
|
||||||
|
本主题仅依赖于 Node.js 环境, 请确保你的环境中已经安装了 Node.js, 推荐使用 Node.js 20 或以上版本.
|
||||||
|
|
||||||
|
请使用 VSCode 开发, 并安装仓库中推荐的插件.
|
||||||
|
|
||||||
|
如果不喜欢多余的插件, 请务必安装 `vscode-styled-components` 插件, 此插件用于渲染和检查 TypeScript 中的 CSS 模板字符串.
|
||||||
|
|
||||||
|
推荐使用 VSCode 1.102.0 版本以上开发, 此版本以上提供 TypeScript 代码中 16 进制颜色的支持.
|
||||||
|
|
||||||
|
## 开发流程
|
||||||
|
|
||||||
|
### 安装依赖
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 设置环境变量
|
||||||
|
|
||||||
|
在项目根目录下创建 `.env` 文件, 变量参考 `.env.example` 文件.
|
||||||
|
|
||||||
|
环境变量用于发送编译后的主题到服务器上, 快速预览主题.
|
||||||
|
|
||||||
|
### 编译主题
|
||||||
|
|
||||||
|
编译开发中的主题
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
编译所有主题
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
格式化项目中的代码
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run format
|
||||||
|
```
|
||||||
|
|
||||||
|
用于 PR, 检查并编译项目中的所有代码并进行格式化
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run commit
|
||||||
|
```
|
||||||
|
|
||||||
|
## 开发规范
|
||||||
|
|
||||||
|
`src`, `styles`, `themes` 为项目的主目录, 主目录下的第一个目录为模块.
|
||||||
|
|
||||||
|
主目录或主目录下模块互相引用时, 请使用绝对路径, 例如 `import { defineTheme } from "src"`
|
||||||
|
|
||||||
|
模块下的文件互相引用时, 请使用相对路径, 例如 `import { defineTheme } from "./theme"`
|
||||||
|
|
||||||
|
## 颜色主题贡献
|
||||||
|
|
||||||
|
颜色主题名称格式: `主题名称-dark.css.ts` 或 `主题名称-light.css.ts`, 分别表示深色和亮色主题.
|
||||||
|
|
||||||
|
如果主题有深色和亮色模式, 会自动生成自动颜色主题, 不需要手动添加.
|
||||||
|
|
||||||
|
项目接受自定义主题并会附加到发布的版本中, 但项目所有者不参与维护和审核.
|
||||||
|
|
||||||
|
请在颜色主题文件头部附加自己的作者信息, 方便 Issue 提问者找到你 `@`.
|
||||||
|
|
||||||
|
推荐使用 `import { defineTheme } from "src"` 导入主题生成框架, 然后使用 `defineTheme` 函数生成主题,
|
||||||
|
defineTheme 中设置了一些经过计算得到的 Gitea 变量可以减少工作量, 具体请查看函数说明.
|
||||||
|
|
||||||
|
例: `themes/主题名称-dark.css.ts`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
/**
|
||||||
|
* @author 你的名字
|
||||||
|
* @description 主题描述
|
||||||
|
*/
|
||||||
|
import { defineTheme } from "src";
|
||||||
|
export default defineTheme({
|
||||||
|
...
|
||||||
|
});
|
||||||
|
// 使用其他主题颜色作为基础
|
||||||
|
import dark from "themes/dark";
|
||||||
|
export default defineTheme({
|
||||||
|
...dark,
|
||||||
|
...
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
如果不需要自定义代码高亮色, 则不传递 chroma 参数, 框架会自动根据主题的暗色或亮色生成代码高亮色.
|
||||||
|
|
||||||
|
如果需要完全自定义每个 Gitea 变量, 请导入 `import { Theme } from "src/theme"`
|
||||||
|
|
||||||
|
例: `themes/主题名称-dark.css.ts`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
/**
|
||||||
|
* @author 你的名字
|
||||||
|
* @description 主题描述
|
||||||
|
*/
|
||||||
|
import { Theme } from "src";
|
||||||
|
export default theme: Theme = {
|
||||||
|
...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
完成主题颜色开发后, 请在某个仓库的代码文件列表页, 打开 Code 菜单选择 Tea Cli 进行截图, 并放入 `screenshots`
|
||||||
|
目录下, 截图名与主题名相同. (推荐克隆 Github 的 actions/checkout 仓库, 该仓库信息较全, 避免泄露个人隐私)
|
||||||
|
|
||||||
|
然后将截图信息添加到 `README.md` 文件中, 可以在折叠部分中添加自己的说明.
|
||||||
|
|
||||||
|
## 主题样式贡献
|
||||||
|
|
||||||
|
主题样式使用 TypeScript 的 css 模板字符串开发, 该模板字符串会经过过 sass 预处理器处理, 支持 SCSS 语法并且本主题只接受 SCSS 嵌套语法, 请不要使用 CSS 语法, 如果一定要用请说明原因.
|
||||||
|
|
||||||
|
请尽量不要使用 SCSS 的函数, `vscode-styled-components` 插件会报错, 请使用 TypeScript 相关库处理, 比如本主题自带的
|
||||||
|
`polished` 库.
|
||||||
|
|
||||||
|
推荐需要使用复杂处理时, 提取逻辑到 `src/functions` 目录下的函数中, 然后在 `src/styles` 目录下的样式文件中使用.
|
||||||
|
|
||||||
|
主题样式中使用到的所有颜色必须使用颜色变量, 颜色变量导入 `import { themeVars } from "src/types"`
|
||||||
|
|
||||||
|
涉及到本主题的颜色变量 `${themeVars.github.xxx}`, 在使用时请将使用的文件和变量添加到对应变量的注释中
|
||||||
|
`src/types/color/github`
|
||||||
|
|
||||||
|
小型圆角(6px)请使用全局圆角变量, 圆角变量导入 `import { otherThemeVars } from "src/types/vars"`
|
||||||
|
`${otherThemeVars.border.radius}`
|
||||||
|
|||||||
60
README.md
@@ -1,13 +1,23 @@
|
|||||||
# gitea-github-theme
|
# gitea-github-theme
|
||||||
|
|
||||||
尽量保持与 GitHub 相同样式的 Gitea 主题
|
一个精致模仿 Github 风格的 Gitea 主题
|
||||||
|
|
||||||
### 主题说明
|
> [!TIP]
|
||||||
|
>
|
||||||
|
> 推荐搭配文件图标浏览器插件一起使用更佳
|
||||||
|
> [web-file-explorer-icons](https://github.com/catppuccin/web-file-explorer-icons)
|
||||||
|
|
||||||
添加了短暂的过渡动画优化体验(与 GitHub Code 克隆列表动画一致)
|
## 版本号说明
|
||||||
|
|
||||||
推荐搭配文件图标浏览器插件一起使用更佳
|
本主题版本号格式: `Gitea 版本号.时间戳`
|
||||||
[github-file-explorer-icons](https://github.com/catppuccin/github-file-explorer-icons)
|
|
||||||
|
Gitea 版本号格式: `1.大版本号.小版本号`
|
||||||
|
|
||||||
|
Gitea 理论上小版本号变更不会修改前端布局, 所以本主题的小版本号适用于所有 Gitea 大版本号相同的 Gitea 版本.
|
||||||
|
|
||||||
|
比如: 本主题版本 `1.24.4` 适用于 Gitea 版本 `>=1.24.0` ~ `<1.25.0`
|
||||||
|
|
||||||
|
本主题仅维护本主题发布中的最新的 Gitea 版本, 其他旧版本主题不接受 Issue 和 PR.
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
@@ -15,7 +25,10 @@
|
|||||||
2. 修改 `gitea/conf/app.ini`,并将 CSS 文件名去掉 `theme-` 的名称附加到 `[ui]` 下的 `THEMES` 末尾
|
2. 修改 `gitea/conf/app.ini`,并将 CSS 文件名去掉 `theme-` 的名称附加到 `[ui]` 下的 `THEMES` 末尾
|
||||||
3. 重启 Gitea
|
3. 重启 Gitea
|
||||||
4. 在设置中查看主题
|
4. 在设置中查看主题
|
||||||
5. 自动颜色主题需要亮色和暗色的主题文件
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> 自动颜色主题需要亮色和暗色的主题文件
|
||||||
|
|
||||||
例: 主题文件名为 `theme-github-dark.css`,则添加 `github-dark` 到 `THEMES` 末尾
|
例: 主题文件名为 `theme-github-dark.css`,则添加 `github-dark` 到 `THEMES` 末尾
|
||||||
|
|
||||||
@@ -23,7 +36,7 @@
|
|||||||
|
|
||||||
```ini
|
```ini
|
||||||
[ui]
|
[ui]
|
||||||
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark
|
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
||||||
```
|
```
|
||||||
|
|
||||||
详细请查看 Gitea 文档
|
详细请查看 Gitea 文档
|
||||||
@@ -65,20 +78,37 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
|
|||||||
|
|
||||||
## 截图
|
## 截图
|
||||||
|
|
||||||

|
<details open>
|
||||||
|
<summary>GitHub</summary>
|
||||||
|
<h4>theme-github-light.css</h4>
|
||||||
|
<img src="screenshots/light.png"/>
|
||||||
|
<h4>theme-github-dark.css</h4>
|
||||||
|
<img src="screenshots/dark.png"/>
|
||||||
|
<h4>theme-github-soft-dark.css</h4>
|
||||||
|
<img src="screenshots/soft-dark.png"/>
|
||||||
|
</details>
|
||||||
|
|
||||||

|
<details>
|
||||||
|
<summary>其他主题</summary>
|
||||||
|
等待贡献者ing...
|
||||||
|
</details>
|
||||||
|
|
||||||

|
## 使用开发中的主题
|
||||||
|
|
||||||

|
也许你会想使用开发中的主题, 而不是发布的主题
|
||||||
|
|
||||||

|
请确保你已经安装了 Node.js 环境, 推荐使用 Node.js 20 或以上版本
|
||||||
|
|
||||||

|
```bash
|
||||||
|
git clone https://github.com/lutinglt/gitea-github-theme.git
|
||||||
|
cd gitea-github-theme
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||

|
编译完成后, 会在 `dist` 目录下生成主题文件, 你可以将主题文件放入 `gitea/public/assets/css` 目录下, 然后在
|
||||||
|
`gitea/conf/app.ini` 中添加主题名称到 `THEMES` 末尾
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
|
|
||||||
欢迎提交 Issue 或 Pull Request
|
请查看 [CONTRIBUTING](CONTRIBUTING.md)
|
||||||
|
|||||||
8
TODO.md
@@ -2,11 +2,3 @@
|
|||||||
|
|
||||||
- gitea issue 默认标签颜色匹配使用 github 样式
|
- gitea issue 默认标签颜色匹配使用 github 样式
|
||||||
- issue/PR 列表样式 github 布局
|
- issue/PR 列表样式 github 布局
|
||||||
- styles/themes 库组件导出整理
|
|
||||||
- defineTheme 颜色生成代码重构
|
|
||||||
- 自动颜色主题生成
|
|
||||||
|
|
||||||
### 其他
|
|
||||||
|
|
||||||
- README 更新/截图更新
|
|
||||||
- CONTRIBUTING 更新
|
|
||||||
|
|||||||
BIN
screenshots/action.png
vendored
|
Before Width: | Height: | Size: 109 KiB |
BIN
screenshots/actions.png
vendored
|
Before Width: | Height: | Size: 176 KiB |
BIN
screenshots/commit.png
vendored
|
Before Width: | Height: | Size: 394 KiB |
BIN
screenshots/dark.png
vendored
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
screenshots/dispatch.png
vendored
|
Before Width: | Height: | Size: 111 KiB |
BIN
screenshots/file_list.png
vendored
|
Before Width: | Height: | Size: 343 KiB |
BIN
screenshots/light.png
vendored
Normal file
|
After Width: | Height: | Size: 201 KiB |
BIN
screenshots/release.png
vendored
|
Before Width: | Height: | Size: 187 KiB |
BIN
screenshots/repo.png
vendored
|
Before Width: | Height: | Size: 211 KiB |
BIN
screenshots/soft-dark.png
vendored
Normal file
|
After Width: | Height: | Size: 202 KiB |
61
src/core/chroma.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { prettylights2Chroma } from "./prettylights";
|
||||||
|
|
||||||
|
export const defaultDarkChroma = prettylights2Chroma({
|
||||||
|
syntax: {
|
||||||
|
brackethighlighter: { angle: "#9198a1", unmatched: "#f85149" },
|
||||||
|
carriage: { return: { bg: "#b62324", text: "#f0f6fc" } },
|
||||||
|
comment: "#9198a1",
|
||||||
|
constant: "#79c0ff",
|
||||||
|
constantOtherReferenceLink: "#a5d6ff",
|
||||||
|
entity: "#d2a8ff",
|
||||||
|
entityTag: "#7ee787",
|
||||||
|
invalid: { illegal: { bg: "#8e1519", text: "#f0f6fc" } },
|
||||||
|
keyword: "#ff7b72",
|
||||||
|
markup: {
|
||||||
|
bold: "#f0f6fc",
|
||||||
|
changed: { bg: "#5a1e02", text: "#ffdfb6" },
|
||||||
|
deleted: { bg: "#67060c", text: "#ffdcd7" },
|
||||||
|
heading: "#1f6feb",
|
||||||
|
ignored: { bg: "#1158c7", text: "#f0f6fc" },
|
||||||
|
inserted: { bg: "#033a16", text: "#aff5b4" },
|
||||||
|
italic: "#f0f6fc",
|
||||||
|
list: "#f2cc60",
|
||||||
|
},
|
||||||
|
metaDiffRange: "#d2a8ff",
|
||||||
|
storageModifierImport: "#f0f6fc",
|
||||||
|
string: "#a5d6ff",
|
||||||
|
stringRegexp: "#7ee787",
|
||||||
|
sublimelinterGutterMark: "#3d444d",
|
||||||
|
variable: "#ffa657",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const defaultLightChroma = prettylights2Chroma({
|
||||||
|
syntax: {
|
||||||
|
brackethighlighter: { angle: "#59636e", unmatched: "#82071e" },
|
||||||
|
carriage: { return: { bg: "#cf222e", text: "#f6f8fa" } },
|
||||||
|
comment: "#59636e",
|
||||||
|
constant: "#0550ae",
|
||||||
|
constantOtherReferenceLink: "#0a3069",
|
||||||
|
entity: "#6639ba",
|
||||||
|
entityTag: "#0550ae",
|
||||||
|
invalid: { illegal: { bg: "#82071e", text: "#f6f8fa" } },
|
||||||
|
keyword: "#cf222e",
|
||||||
|
markup: {
|
||||||
|
bold: "#1f2328",
|
||||||
|
changed: { bg: "#ffd8b5", text: "#953800" },
|
||||||
|
deleted: { bg: "#ffebe9", text: "#82071e" },
|
||||||
|
heading: "#0550ae",
|
||||||
|
ignored: { bg: "#0550ae", text: "#d1d9e0" },
|
||||||
|
inserted: { bg: "#dafbe1", text: "#116329" },
|
||||||
|
italic: "#1f2328",
|
||||||
|
list: "#3b2300",
|
||||||
|
},
|
||||||
|
metaDiffRange: "#8250df",
|
||||||
|
storageModifierImport: "#1f2328",
|
||||||
|
string: "#0a3069",
|
||||||
|
stringRegexp: "#116329",
|
||||||
|
sublimelinterGutterMark: "#818b98",
|
||||||
|
variable: "#953800",
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -2,7 +2,7 @@ import { rgba, saturate } from "polished";
|
|||||||
import { scaleColorLight } from "src/functions";
|
import { scaleColorLight } from "src/functions";
|
||||||
import type { Ansi, Chroma, Console, Diff, Github, Message, Named, Other, Primary, Secondary } from "src/types";
|
import type { Ansi, Chroma, Console, Diff, Github, Message, Named, Other, Primary, Secondary } from "src/types";
|
||||||
import { themeVars } from "src/types/vars";
|
import { themeVars } from "src/types/vars";
|
||||||
import { prettylightsDark, prettylightsLight } from "./prettylights";
|
import { defaultDarkChroma, defaultLightChroma } from "./chroma";
|
||||||
import type { Theme } from "./theme";
|
import type { Theme } from "./theme";
|
||||||
|
|
||||||
type ThemeColor = {
|
type ThemeColor = {
|
||||||
@@ -341,7 +341,7 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
isDarkTheme: themeColor.isDarkTheme.toString(),
|
isDarkTheme: themeColor.isDarkTheme.toString(),
|
||||||
chroma: chroma || (themeColor.isDarkTheme ? prettylightsDark : prettylightsLight),
|
chroma: chroma || (themeColor.isDarkTheme ? defaultDarkChroma : defaultLightChroma),
|
||||||
color: {
|
color: {
|
||||||
primary,
|
primary,
|
||||||
secondary,
|
secondary,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { saturate } from "polished";
|
import { saturate } from "polished";
|
||||||
import type { Console, Diff, Other } from "src";
|
import type { Console, Diff, Other } from "src";
|
||||||
import { scaleColorLight } from "src/functions";
|
import { scaleColorLight } from "src/functions";
|
||||||
import type { Github } from "src/types";
|
import type { Chroma, Github } from "src/types";
|
||||||
import { themeVars } from "src/types/vars";
|
import { themeVars } from "src/types/vars";
|
||||||
import { defineTheme } from "./color";
|
import { defineTheme } from "./color";
|
||||||
import type { Theme } from "./theme";
|
import type { Theme } from "./theme";
|
||||||
@@ -144,7 +144,7 @@ export type GithubColor = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export function defineGithubTheme(githubColor: GithubColor): Theme {
|
export function defineGithubTheme(githubColor: GithubColor, chroma: Chroma | null = null): Theme {
|
||||||
const console: Console = {
|
const console: Console = {
|
||||||
fg: {
|
fg: {
|
||||||
self: githubColor.fgColor.default,
|
self: githubColor.fgColor.default,
|
||||||
@@ -394,7 +394,8 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return defineTheme({
|
return defineTheme(
|
||||||
|
{
|
||||||
isDarkTheme: githubColor.isDarkTheme,
|
isDarkTheme: githubColor.isDarkTheme,
|
||||||
primary: githubColor.fgColor.accent,
|
primary: githubColor.fgColor.accent,
|
||||||
primaryContrast: githubColor.fgColor.default,
|
primaryContrast: githubColor.fgColor.default,
|
||||||
@@ -419,5 +420,7 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
|
|||||||
diff,
|
diff,
|
||||||
other,
|
other,
|
||||||
github,
|
github,
|
||||||
});
|
},
|
||||||
|
chroma
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,113 +150,3 @@ export function prettylights2Chroma(prettylights: prettylightsColor): Chroma {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const prettylightsDark = prettylights2Chroma({
|
|
||||||
syntax: {
|
|
||||||
brackethighlighter: {
|
|
||||||
angle: "#9198a1",
|
|
||||||
unmatched: "#f85149",
|
|
||||||
},
|
|
||||||
carriage: {
|
|
||||||
return: {
|
|
||||||
bg: "#b62324",
|
|
||||||
text: "#f0f6fc",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
comment: "#9198a1",
|
|
||||||
constant: "#79c0ff",
|
|
||||||
constantOtherReferenceLink: "#a5d6ff",
|
|
||||||
entity: "#d2a8ff",
|
|
||||||
entityTag: "#7ee787",
|
|
||||||
invalid: {
|
|
||||||
illegal: {
|
|
||||||
bg: "#8e1519",
|
|
||||||
text: "#f0f6fc",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keyword: "#ff7b72",
|
|
||||||
markup: {
|
|
||||||
bold: "#f0f6fc",
|
|
||||||
changed: {
|
|
||||||
bg: "#5a1e02",
|
|
||||||
text: "#ffdfb6",
|
|
||||||
},
|
|
||||||
deleted: {
|
|
||||||
bg: "#67060c",
|
|
||||||
text: "#ffdcd7",
|
|
||||||
},
|
|
||||||
heading: "#1f6feb",
|
|
||||||
ignored: {
|
|
||||||
bg: "#1158c7",
|
|
||||||
text: "#f0f6fc",
|
|
||||||
},
|
|
||||||
inserted: {
|
|
||||||
bg: "#033a16",
|
|
||||||
text: "#aff5b4",
|
|
||||||
},
|
|
||||||
italic: "#f0f6fc",
|
|
||||||
list: "#f2cc60",
|
|
||||||
},
|
|
||||||
metaDiffRange: "#d2a8ff",
|
|
||||||
storageModifierImport: "#f0f6fc",
|
|
||||||
string: "#a5d6ff",
|
|
||||||
stringRegexp: "#7ee787",
|
|
||||||
sublimelinterGutterMark: "#3d444d",
|
|
||||||
variable: "#ffa657",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export const prettylightsLight = prettylights2Chroma({
|
|
||||||
syntax: {
|
|
||||||
brackethighlighter: {
|
|
||||||
angle: "#59636e",
|
|
||||||
unmatched: "#82071e",
|
|
||||||
},
|
|
||||||
carriage: {
|
|
||||||
return: {
|
|
||||||
bg: "#cf222e",
|
|
||||||
text: "#f6f8fa",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
comment: "#59636e",
|
|
||||||
constant: "#0550ae",
|
|
||||||
constantOtherReferenceLink: "#0a3069",
|
|
||||||
entity: "#6639ba",
|
|
||||||
entityTag: "#0550ae",
|
|
||||||
invalid: {
|
|
||||||
illegal: {
|
|
||||||
bg: "#82071e",
|
|
||||||
text: "#f6f8fa",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keyword: "#cf222e",
|
|
||||||
markup: {
|
|
||||||
bold: "#1f2328",
|
|
||||||
changed: {
|
|
||||||
bg: "#ffd8b5",
|
|
||||||
text: "#953800",
|
|
||||||
},
|
|
||||||
deleted: {
|
|
||||||
bg: "#ffebe9",
|
|
||||||
text: "#82071e",
|
|
||||||
},
|
|
||||||
heading: "#0550ae",
|
|
||||||
ignored: {
|
|
||||||
bg: "#0550ae",
|
|
||||||
text: "#d1d9e0",
|
|
||||||
},
|
|
||||||
inserted: {
|
|
||||||
bg: "#dafbe1",
|
|
||||||
text: "#116329",
|
|
||||||
},
|
|
||||||
italic: "#1f2328",
|
|
||||||
list: "#3b2300",
|
|
||||||
},
|
|
||||||
metaDiffRange: "#8250df",
|
|
||||||
storageModifierImport: "#1f2328",
|
|
||||||
string: "#0a3069",
|
|
||||||
stringRegexp: "#116329",
|
|
||||||
sublimelinterGutterMark: "#818b98",
|
|
||||||
variable: "#953800",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
export { defineTheme } from "./core/color";
|
export { defineTheme } from "./core/color";
|
||||||
export type { Console, Diff, Other } from "./types";
|
export type { Chroma, Console, Diff, Other } from "./types";
|
||||||
export { themeVars } from "./types/vars";
|
export { themeVars } from "./types/vars";
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const diff = css`
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: ${themeVars.github.bgColor.accent.emphasis};
|
background: ${themeVars.github.bgColor.accent.emphasis};
|
||||||
color: ${themeVars.color.white}
|
color: ${themeVars.color.white};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* 行号居中 */
|
/* 行号居中 */
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ export default defineGithubTheme({
|
|||||||
default: "#f0f6fc",
|
default: "#f0f6fc",
|
||||||
disabled: "#656c7699",
|
disabled: "#656c7699",
|
||||||
done: "#ab7df8",
|
done: "#ab7df8",
|
||||||
|
muted: "#9198a1",
|
||||||
neutral: "#9198a1",
|
neutral: "#9198a1",
|
||||||
severe: "#db6d28",
|
severe: "#db6d28",
|
||||||
sponsors: "#db61a2",
|
sponsors: "#db61a2",
|
||||||
success: "#3fb950",
|
success: "#3fb950",
|
||||||
black: "#010409",
|
black: "#010409",
|
||||||
white: "#ffffff",
|
white: "#ffffff",
|
||||||
muted: "#9198a1",
|
|
||||||
},
|
},
|
||||||
bgColor: {
|
bgColor: {
|
||||||
accent: { emphasis: "#1f6feb", muted: "#388bfd1a" },
|
accent: { emphasis: "#1f6feb", muted: "#388bfd1a" },
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ export default defineGithubTheme({
|
|||||||
default: "#1f2328",
|
default: "#1f2328",
|
||||||
disabled: "#818b98",
|
disabled: "#818b98",
|
||||||
done: "#8250df",
|
done: "#8250df",
|
||||||
|
muted: "#59636e",
|
||||||
neutral: "#59636e",
|
neutral: "#59636e",
|
||||||
severe: "#bc4c00",
|
severe: "#bc4c00",
|
||||||
sponsors: "#bf3989",
|
sponsors: "#bf3989",
|
||||||
success: "#1a7f37",
|
success: "#1a7f37",
|
||||||
black: "#1f2328",
|
black: "#1f2328",
|
||||||
white: "#ffffff",
|
white: "#ffffff",
|
||||||
muted: "#59636e",
|
|
||||||
},
|
},
|
||||||
bgColor: {
|
bgColor: {
|
||||||
accent: { emphasis: "#0969da", muted: "#ddf4ff" },
|
accent: { emphasis: "#0969da", muted: "#ddf4ff" },
|
||||||
|
|||||||
104
themes/soft-dark.css.ts
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import { defineGithubTheme } from "src/core/github";
|
||||||
|
import { prettylights2Chroma } from "src/core/prettylights";
|
||||||
|
|
||||||
|
export default defineGithubTheme(
|
||||||
|
{
|
||||||
|
isDarkTheme: true,
|
||||||
|
display: {
|
||||||
|
brown: { fgColor: "#b69a6d" },
|
||||||
|
cyan: { fgColor: "#07ace4" },
|
||||||
|
indigo: { fgColor: "#9899ec" },
|
||||||
|
lemon: { fgColor: "#ba9b12" },
|
||||||
|
olive: { fgColor: "#a2a626" },
|
||||||
|
teal: { fgColor: "#1cb0ab" },
|
||||||
|
},
|
||||||
|
diffBlob: {
|
||||||
|
addtionNum: { bgColor: "#57ab5a4d" },
|
||||||
|
addtionWord: { bgColor: "#46954a66" },
|
||||||
|
deletionNum: { bgColor: "#e5534b4d" },
|
||||||
|
deletionWord: { bgColor: "#e5534b66" },
|
||||||
|
hunkNum: { bgColor: { rest: "#143d79" } },
|
||||||
|
},
|
||||||
|
fgColor: {
|
||||||
|
accent: "#478be6",
|
||||||
|
attention: "#c69026",
|
||||||
|
danger: "#e5534b",
|
||||||
|
default: "#d1d7e0",
|
||||||
|
disabled: "#656c76",
|
||||||
|
done: "#986ee2",
|
||||||
|
muted: "#9198a1",
|
||||||
|
neutral: "#9198a1",
|
||||||
|
severe: "#cc6b2c",
|
||||||
|
sponsors: "#c96198",
|
||||||
|
success: "#57ab5a",
|
||||||
|
black: "#010409",
|
||||||
|
white: "#cdd9e5",
|
||||||
|
},
|
||||||
|
bgColor: {
|
||||||
|
accent: { emphasis: "#316dca", muted: "#4184e41a" },
|
||||||
|
attention: { muted: "#ae7c1426" },
|
||||||
|
success: { emphasis: "#347d39", muted: "#46954a26" },
|
||||||
|
danger: { muted: "#e5534b1a" },
|
||||||
|
done: { emphasis: "#8256d0" },
|
||||||
|
default: "#212830",
|
||||||
|
inset: "#151b23",
|
||||||
|
muted: "#262c36",
|
||||||
|
neutral: { muted: "#656c7633" },
|
||||||
|
},
|
||||||
|
borderColor: {
|
||||||
|
accent: { emphasis: "#316dca" },
|
||||||
|
default: "#3d444d",
|
||||||
|
attention: { emphasis: "#966600" },
|
||||||
|
success: { emphasis: "#347d39" },
|
||||||
|
done: { emphasis: "#8256d0" },
|
||||||
|
muted: "#3d444db3",
|
||||||
|
translucent: "#cdd9e526",
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
primary: { fgColor: { rest: "#ffffff" }, bgColor: { hover: "#3b8640" } },
|
||||||
|
danger: { fgColor: { rest: "#ea5c53", hover: "#ffffff" }, bgColor: { hover: "#ad2e2c" } },
|
||||||
|
},
|
||||||
|
control: {
|
||||||
|
bgColor: { active: "#3d444d", hover: "#2f3742", rest: "#2a313c" },
|
||||||
|
transparent: { bgColor: { active: "#656c7633", hover: "#656c7626", selected: "#656c761a" } },
|
||||||
|
},
|
||||||
|
shadow: { floating: { small: "#01040966" } },
|
||||||
|
overlay: { backdrop: { bgColor: "#262c3666" } },
|
||||||
|
underlineNav: { borderColor: { active: "#ec775c" } },
|
||||||
|
contribution: {
|
||||||
|
default: {
|
||||||
|
bgColor: { num0: "#2a313c", num1: "#1b4721", num2: "#2b6a30", num3: "#46954a", num4: "#6bc46d" },
|
||||||
|
borderColor: { num0: "#0104090d" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
prettylights2Chroma({
|
||||||
|
syntax: {
|
||||||
|
brackethighlighter: { angle: "#9198a1", unmatched: "#e5534b" },
|
||||||
|
carriage: { return: { bg: "#ad2e2c", text: "#f0f6fc" } },
|
||||||
|
comment: "#9198a1",
|
||||||
|
constant: "#6cb6ff",
|
||||||
|
constantOtherReferenceLink: "#96d0ff",
|
||||||
|
entity: "#dcbdfb",
|
||||||
|
entityTag: "#8ddb8c",
|
||||||
|
invalid: { illegal: { bg: "#922323", text: "#f0f6fc" } },
|
||||||
|
keyword: "#f47067",
|
||||||
|
markup: {
|
||||||
|
bold: "#f0f6fc",
|
||||||
|
changed: { bg: "#682d0f", text: "#ffddb0" },
|
||||||
|
deleted: { bg: "#78191b", text: "#ffd8d3" },
|
||||||
|
heading: "#316dca",
|
||||||
|
ignored: { bg: "#255ab2", text: "#f0f6fc" },
|
||||||
|
inserted: { bg: "#1b4721", text: "#b4f1b4" },
|
||||||
|
italic: "#f0f6fc",
|
||||||
|
list: "#eac55f",
|
||||||
|
},
|
||||||
|
metaDiffRange: "#dcbdfb",
|
||||||
|
storageModifierImport: "#f0f6fc",
|
||||||
|
string: "#96d0ff",
|
||||||
|
stringRegexp: "#8ddb8c",
|
||||||
|
sublimelinterGutterMark: "#3d444d",
|
||||||
|
variable: "#f69d50",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||