mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
Compare commits
30 Commits
v1.24.2.25
...
v1.24.4.25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dcd7cf002 | ||
|
|
93e5fa8a7d | ||
|
|
8c5020fa09 | ||
|
|
35520fb3fc | ||
|
|
728673ffcd | ||
|
|
f7c1cf430f | ||
|
|
c6306a23d4 | ||
|
|
f813122573 | ||
|
|
603d22d877 | ||
|
|
4f4b99a600 | ||
|
|
a1cc1509ce | ||
|
|
305b2eca0b | ||
|
|
f635b30c9c | ||
|
|
1434c54ba3 | ||
|
|
b9b12e7ed2 | ||
|
|
f9755704ec | ||
|
|
120d24cb10 | ||
|
|
77e2227029 | ||
|
|
75fd35480b | ||
|
|
0516b19982 | ||
|
|
5ac3a3044e | ||
|
|
9ccc65ac1c | ||
|
|
7921a8872b | ||
|
|
596442d2ef | ||
|
|
7248f617c4 | ||
|
|
6def81fe26 | ||
|
|
fa08df8eea | ||
|
|
cc44560f96 | ||
|
|
4b2916a75b | ||
|
|
5116ca5cae |
4
.github/release-template.md
vendored
4
.github/release-template.md
vendored
@@ -1,3 +1,7 @@
|
||||
## ✨ Feature
|
||||
|
||||
#### CSS 变量
|
||||
|
||||
## 🌈 Style
|
||||
|
||||
#### 更符合 GitHub 风格
|
||||
|
||||
62
.github/release.md
vendored
62
.github/release.md
vendored
@@ -1,56 +1,20 @@
|
||||
## ✨ Feature
|
||||
|
||||
#### CSS 变量
|
||||
|
||||
- 支持自定义探索/组织/用户页面的仓库列表列数
|
||||
- 支持自定义探索/组织页面的用户/组织列表列数
|
||||
|
||||
## 🌈 Style
|
||||
|
||||
#### 更符合 GitHub 风格
|
||||
|
||||
- 1:1 还原克隆菜单样式
|
||||
- 代码差异对比折叠行文本颜色同步
|
||||
- 代码差异对比行号位置同步
|
||||
- 代码差异对比按钮和折叠行高度同步
|
||||
- Actions 日志页面标题颜色同步
|
||||
- Actions 日志页面设置菜单背景色同步
|
||||
- 菜单背景色同步当前最新颜色
|
||||
- Markdown 背景色同步
|
||||
- 补充 Markdown 代码块背景色
|
||||
- 弹窗阴影颜色同步
|
||||
- 仓库项目页面列背景色同步
|
||||
- Issue/PR 表情背景色同步
|
||||
- 普通按钮激活背景色同步
|
||||
- 主色调按钮边框色同步
|
||||
- 设置界面右上角小按钮样式同步
|
||||
- 弹窗背景色和叠加背景色同步
|
||||
- 全局圆角样式同步
|
||||
- 工单标签颜色同步
|
||||
- 提交列表样式和颜色同步
|
||||
- 提交 SHA 颜色和样式优化
|
||||
- 软件包标签颜色同步
|
||||
- Issue/PR 评论边框样式同步
|
||||
- Code/Runner/PR 提示框样式同步
|
||||
- 下拉菜单样式同步
|
||||
- 选择下拉菜单样式同步
|
||||
- 热力图颜色和样式同步
|
||||
- Issue/PR 菜单选项样式同步
|
||||
- 仓库标签页样式和颜色同步
|
||||
- 仓库发布页样式和颜色同步
|
||||
- 关注按钮样式同步
|
||||
- Issue 评论菜单删除按钮样式同步
|
||||
|
||||
## 🎈 Perf
|
||||
|
||||
- 为下拉菜单的激活选项和部分下拉菜单实现 Issue/PR 的菜单选项样式
|
||||
- Actions 日志页面标题间隔优化
|
||||
- 管理员后台按钮样式优化
|
||||
- 信息提示颜色优化
|
||||
- 修复意外点亮其他页面关闭图标的颜色
|
||||
- 统一全局标签圆角
|
||||
- 仪表板动态信息图标大小优化
|
||||
- Runner 列表标签颜色优化
|
||||
- 仓库动态活动标签样式统一
|
||||
- 合并请求分支样式统一
|
||||
- 全局下拉菜单样式统一
|
||||
- 弹窗按钮样式优化
|
||||
- 一些小型按钮的高度优化
|
||||
- 同步 Issue/PR 的评论样式
|
||||
- 同步表情菜单样式
|
||||
- 同步探索/组织/用户页面的仓库列表样式
|
||||
- 同步探索/组织页面的用户列表样式
|
||||
- 同步探索页面的组织列表样式
|
||||
|
||||
## 🐞 Fix
|
||||
|
||||
- 修复代码差异对比分列视图下颜色丢失
|
||||
- 修复 Runner 状态离线时标签
|
||||
- 修复探索页面下仓库的类型标签意外触发悬浮效果
|
||||
|
||||
3
.github/todo.md
vendored
3
.github/todo.md
vendored
@@ -1,3 +0,0 @@
|
||||
用户头像右上角管理员标识优化
|
||||
action 下的分支标签颜色
|
||||
动态关闭工单条颜色
|
||||
34
README.md
34
README.md
@@ -26,6 +26,40 @@ THEMES = gitea-dark, github-dark
|
||||
详细请查看 Gitea 文档
|
||||
[Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
|
||||
|
||||
## 自定义 CSS 变量
|
||||
|
||||
可以根据自己的偏好自定义主题的一部分样式
|
||||
|
||||
### 使用方法
|
||||
|
||||
在主题的 CSS 文件的头部或尾部添加以下代码
|
||||
|
||||
```css
|
||||
:root {
|
||||
--custom-clone-menu-width: 150px;
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 请确保在 `:root` 选择器中添加自定义变量,否则无法生效
|
||||
>
|
||||
> 变量之间用 `;` 分隔
|
||||
>
|
||||
> 建议自定义变量放在单独的文件中, 通过 shell 命令等方式追加到主题文件中
|
||||
|
||||
### CSS 变量
|
||||
|
||||
| 变量名 | 描述 | 默认值 | Github | 推荐 | 最小值 | 最大值 |
|
||||
| :-------------------------------- | :-------------------------- | :----- | :----- | :---- | :----- | :----- |
|
||||
| --custom-clone-menu-width | 克隆菜单宽度 | Gitea | 332px | 200px | 150px | 400px |
|
||||
| --custom-explore-repolist-columns | 探索页面的仓库列表列数 | 2 | 2 | 2 | | |
|
||||
| --custom-explore-userlist-columns | 探索页面的用户/组织列表列数 | 3 | 1 | 2/3 | | |
|
||||
| --custom-user-repolist-columns | 用户页面的仓库列表列数 | 2 | 2 | 2 | | |
|
||||
| --custom-org-repolist-columns | 组织页面的仓库列表列数 | 1 | 1 | 1 | | |
|
||||
| --custom-org-userlist-columns | 组织页面的用户列表列数 | 2 | 1 | 2 | | |
|
||||
|
||||
## 截图
|
||||
|
||||

|
||||
|
||||
14
TODO.md
Normal file
14
TODO.md
Normal file
@@ -0,0 +1,14 @@
|
||||
### 重大
|
||||
|
||||
- gitea issue 默认标签颜色匹配使用 github 样式
|
||||
- issue/PR 列表样式 github 布局
|
||||
- styles/themes 库组件导出整理
|
||||
- defineTheme 颜色生成代码重构
|
||||
- 亮色主题适配/测试
|
||||
- 自动颜色主题生成
|
||||
- github primer 官方库集成
|
||||
|
||||
### 其他
|
||||
|
||||
- README 更新/截图更新
|
||||
- CONTRIBUTING 更新
|
||||
11
eslint.config.js
vendored
11
eslint.config.js
vendored
@@ -1,6 +1,4 @@
|
||||
import js from "@eslint/js";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import reactRefresh from "eslint-plugin-react-refresh";
|
||||
import globals from "globals";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
@@ -8,17 +6,10 @@ export default tseslint.config(
|
||||
{ ignores: ["dist"] },
|
||||
{
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
files: ["**/*.{ts}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
"react-refresh": reactRefresh,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitea-github-theme",
|
||||
"version": "1.24.2",
|
||||
"version": "1.24.4",
|
||||
"description": "A theme to make Gitea look and feel like GitHub",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -12,35 +12,26 @@
|
||||
"version": "node scripts/version.cjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-react": "^7.27.1",
|
||||
"@babel/preset-typescript": "^7.27.1",
|
||||
"@eslint/js": "^9.29.0",
|
||||
"@linaria/core": "^6.3.0",
|
||||
"@linaria/react": "^6.3.0",
|
||||
"@types/node": "^24.0.3",
|
||||
"@types/react": "^19.1.8",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@vanilla-extract/css": "^1.17.4",
|
||||
"@vanilla-extract/vite-plugin": "^5.0.6",
|
||||
"@vitejs/plugin-react": "^4.5.2",
|
||||
"@vitejs/plugin-react-swc": "^3.10.2",
|
||||
"@wyw-in-js/babel-preset": "^0.7.0",
|
||||
"@wyw-in-js/vite": "^0.7.0",
|
||||
"dotenv": "^17.0.0",
|
||||
"eslint": "^9.29.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.20",
|
||||
"globals": "^16.2.0",
|
||||
"lightningcss": "^1.30.1",
|
||||
"polished": "^4.3.1",
|
||||
"prettier": "3.5.3",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"sass-embedded": "^1.89.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.34.1",
|
||||
"typescript-plugin-css-modules": "^5.1.0",
|
||||
"typescript-styled-plugin": "^0.18.3",
|
||||
"vite": "^6.3.5"
|
||||
},
|
||||
"prettier": {
|
||||
@@ -62,8 +53,5 @@
|
||||
"prettier-plugin-organize-imports"
|
||||
],
|
||||
"organizeImportsSkipDestructiveCodeActions": false
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript-styled-plugin": "^0.18.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,6 +350,9 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
|
||||
},
|
||||
},
|
||||
control: {
|
||||
bgColor: {
|
||||
rest: githubColor.control.bgColor.rest,
|
||||
},
|
||||
transparent: {
|
||||
bgColor: {
|
||||
hover: githubColor.control.transparent.bgColor.hover,
|
||||
|
||||
@@ -13,8 +13,10 @@ function stringToBoolean(str: string, name: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
export const overlayAppear = "overlay-appear";
|
||||
export const animation = `200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running ${overlayAppear}`;
|
||||
export const overlayAppearDown = "overlay-appear-down";
|
||||
export const animationDown = `200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running ${overlayAppearDown}`;
|
||||
export const overlayAppearUp = "overlay-appear-up";
|
||||
export const animationUp = `200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running ${overlayAppearUp}`;
|
||||
|
||||
const emoji = `
|
||||
.emoji[aria-label="check mark"],
|
||||
@@ -46,22 +48,28 @@ export function createTheme(theme: Theme): void {
|
||||
}
|
||||
createGlobalTheme(":root", themeVars, theme);
|
||||
createGlobalTheme(":root", otherThemeVars, {
|
||||
git: "#f05133",
|
||||
light: {
|
||||
mimicEnabled: isDarkTheme
|
||||
? "rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled)))"
|
||||
: "rgba(0, 0, 0, calc(6 / 255 * 222 / 255 / var(--opacity-disabled)))",
|
||||
},
|
||||
border: {
|
||||
radius: "6px",
|
||||
},
|
||||
color: {
|
||||
git: "#f05133",
|
||||
light: {
|
||||
mimicEnabled: isDarkTheme
|
||||
? "rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled)))"
|
||||
: "rgba(0, 0, 0, calc(6 / 255 * 222 / 255 / var(--opacity-disabled)))",
|
||||
},
|
||||
},
|
||||
});
|
||||
globalStyle(":root", {
|
||||
accentColor: themeVars.color.accent,
|
||||
colorScheme: isDarkTheme ? "dark" : "light",
|
||||
});
|
||||
globalKeyframes(overlayAppear, {
|
||||
"0%": { opacity: 0, transform: "translateY(-12px)" },
|
||||
globalKeyframes(overlayAppearDown, {
|
||||
"0%": { opacity: 0, transform: "translateY(-8px)" },
|
||||
"100%": { opacity: 1, transform: "translateY(0)" },
|
||||
});
|
||||
globalKeyframes(overlayAppearUp, {
|
||||
"0%": { opacity: 0, transform: "translateY(8px)" },
|
||||
"100%": { opacity: 1, transform: "translateY(0)" },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
type Primitive = string | boolean | number | null | undefined;
|
||||
type Tokens = { [key: string]: string | Tokens };
|
||||
|
||||
export type CSSVarFunction = `var(--${string})`;
|
||||
export type WithOptionalLayer<T extends Tokens> = T & { "@layer"?: string };
|
||||
|
||||
export type MapLeafNodes<Obj, LeafType> = {
|
||||
[Prop in keyof Obj]: Obj[Prop] extends Primitive
|
||||
? LeafType
|
||||
|
||||
@@ -4,7 +4,7 @@ import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { Plugin } from "vite";
|
||||
|
||||
const suffix = ".css.tsx";
|
||||
const suffix = ".css.ts";
|
||||
|
||||
/**
|
||||
* 生成主题输入
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { scaleColorLight } from "./scss";
|
||||
export { fallbackVar } from "./var";
|
||||
|
||||
7
src/functions/var.ts
Normal file
7
src/functions/var.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { CSSVarFunction } from "src/core/types";
|
||||
|
||||
type CSSFallbackVar = `var(--${string}, ${string})`;
|
||||
export function fallbackVar(cssvar: CSSVarFunction, fallback: string): CSSFallbackVar {
|
||||
const var_name = cssvar.replace("var(--", "").replace(")", "");
|
||||
return `var(--${var_name}, ${fallback})`;
|
||||
}
|
||||
@@ -5,6 +5,8 @@ export const github = {
|
||||
* @actions `actionViewRight` 右侧日志标题颜色
|
||||
* @issue `prBranch` 分支名称文本颜色
|
||||
* @repo `repoTopic` 仓库主题标签文本颜色
|
||||
* @actions `actions` 分支标签按钮文本颜色
|
||||
* @actions `actionViewHeader` 分支标签按钮文本颜色
|
||||
*/
|
||||
accent: null,
|
||||
/** 成功的文本颜色
|
||||
@@ -25,17 +27,22 @@ export const github = {
|
||||
* @diff 折叠/展开按钮的悬停颜色
|
||||
* @actions `actionViewLeft` 左侧子作业激活伪元素颜色
|
||||
* @release `releaseTagMenu` 顶部栏左侧按钮激活背景色
|
||||
* @navbar `navbarRight` 头像管理员标识背景颜色
|
||||
* @dropdown `dropdown` emoji 的悬停背景色
|
||||
*/
|
||||
emphasis: null,
|
||||
/** 暗淡的背景颜色
|
||||
* @issue `prBranch` 分支名称背景颜色
|
||||
* @repo `repoTopic` 仓库主题标签背景颜色
|
||||
* @actions `actions` 分支标签按钮背景颜色
|
||||
* @actions `actionViewHeader` 分支标签按钮背景颜色
|
||||
*/
|
||||
muted: null,
|
||||
},
|
||||
success: {
|
||||
/** 成功的背景颜色
|
||||
* @issue `babel` 重新开启图标背景颜色
|
||||
* @issue `prMerge` 合并提交的图标背景色
|
||||
*/
|
||||
emphasis: null,
|
||||
},
|
||||
@@ -53,6 +60,7 @@ export const github = {
|
||||
* @clone `clone` 克隆地址框被选中时的边框颜色
|
||||
* @issue `comment` 评论框被选中时的边框颜色
|
||||
* @menu `verticalMenu` 垂直菜单项激活时左侧的伪元素颜色
|
||||
* @dropdown `selectionDropdown` 选择输入框的内部边框颜色
|
||||
*/
|
||||
emphasis: null,
|
||||
},
|
||||
@@ -151,6 +159,12 @@ export const github = {
|
||||
},
|
||||
},
|
||||
control: {
|
||||
bgColor: {
|
||||
/** 背景色
|
||||
* @issue `timeline` 时间线标签背景色
|
||||
*/
|
||||
rest: null,
|
||||
},
|
||||
transparent: {
|
||||
bgColor: {
|
||||
/** 悬停色
|
||||
|
||||
@@ -30,10 +30,28 @@ const otherVars = {
|
||||
border: {
|
||||
radius: null,
|
||||
},
|
||||
...color.otherAuto,
|
||||
color: {
|
||||
...color.otherAuto,
|
||||
},
|
||||
};
|
||||
|
||||
const customVars = {
|
||||
custom: {
|
||||
cloneMenuWidth: "custom-clone-menu-width",
|
||||
explore: {
|
||||
repolistColumns: "custom-explore-repolist-columns",
|
||||
userlistColumns: "custom-explore-userlist-columns",
|
||||
},
|
||||
userRepolistColumns: "custom-user-repolist-columns",
|
||||
org: {
|
||||
repolistColumns: "custom-org-repolist-columns",
|
||||
userlistColumns: "custom-org-userlist-columns",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const themeVars = createGlobalThemeContract(vars, varMapper);
|
||||
export const otherThemeVars = createGlobalThemeContract(otherVars, varMapper);
|
||||
export const customThemeVars = createGlobalThemeContract(customVars, varMapper);
|
||||
|
||||
export { css } from "@linaria/core";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { animationDown } from "src/core/theme";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
// 仓库 Actions 页面
|
||||
@@ -35,10 +36,6 @@ export const actions = css`
|
||||
border-top-right-radius: ${otherThemeVars.border.radius};
|
||||
padding: 16px;
|
||||
margin-bottom: 0;
|
||||
|
||||
.item {
|
||||
padding: 6px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.ui.info.message {
|
||||
@@ -57,6 +54,23 @@ export const actions = css`
|
||||
border-bottom-left-radius: ${otherThemeVars.border.radius};
|
||||
border-bottom-right-radius: ${otherThemeVars.border.radius};
|
||||
|
||||
// 分支标签按钮
|
||||
.run-list-ref {
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||
font-weight: 400;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
text-decoration-line: underline !important;
|
||||
}
|
||||
}
|
||||
// 标签右侧任务信息
|
||||
.run-list-item-right {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
padding: 16px;
|
||||
|
||||
@@ -112,6 +126,24 @@ export const runWorkflow = css`
|
||||
}
|
||||
`;
|
||||
|
||||
// 工作流详情页标题
|
||||
export const actionViewHeader = css`
|
||||
.action-view-header {
|
||||
.action-commit-summary {
|
||||
// 分支标签按钮
|
||||
.ui.label {
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||
font-weight: 400;
|
||||
> a {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 工作流左侧作业列表
|
||||
export const actionViewLeft = css`
|
||||
.action-view-left {
|
||||
@@ -183,6 +215,7 @@ export const actionViewRight = css`
|
||||
}
|
||||
|
||||
.job-step-container {
|
||||
// 步骤标题
|
||||
.job-step-summary {
|
||||
color: ${themeVars.color.console.fg.subtle};
|
||||
padding: 8px 10px;
|
||||
@@ -209,12 +242,16 @@ export const actionViewRight = css`
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 日志字体颜色白色 */
|
||||
.job-log-line {
|
||||
color: ${themeVars.color.console.fg.self};
|
||||
/* 被 hover 时覆盖 ANSI 颜色 */
|
||||
.log-msg:hover * {
|
||||
color: ${themeVars.color.console.fg.self} !important;
|
||||
// 步骤日志
|
||||
.job-step-logs {
|
||||
animation: ${animationDown};
|
||||
/* 日志字体颜色白色 */
|
||||
.job-log-line {
|
||||
color: ${themeVars.color.console.fg.self};
|
||||
/* 被 hover 时覆盖 ANSI 颜色 */
|
||||
.log-msg:hover * {
|
||||
color: ${themeVars.color.console.fg.self} !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,24 @@
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
import { css, customThemeVars, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
// 克隆按钮的弹窗
|
||||
export const clone = css`
|
||||
.tippy-box {
|
||||
.clone-panel-popup {
|
||||
//标题
|
||||
.clone-panel-field:first-of-type {
|
||||
font-weight: bold;
|
||||
margin-top: 16px;
|
||||
//标题和克隆地址
|
||||
> .clone-panel-field {
|
||||
margin-left: 16px;
|
||||
margin-right: 16px;
|
||||
//标题
|
||||
&:first-of-type {
|
||||
font-weight: 600;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
// 按钮组
|
||||
.clone-panel-tab {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-left: 12px;
|
||||
margin-left: 16px;
|
||||
// 按钮
|
||||
.item {
|
||||
color: ${themeVars.color.text.self};
|
||||
@@ -44,25 +48,38 @@ export const clone = css`
|
||||
}
|
||||
// 克隆地址
|
||||
.ui.input.action {
|
||||
> input,
|
||||
> input:hover {
|
||||
> input {
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
}
|
||||
> input:focus,
|
||||
> input:focus-visible {
|
||||
border-color: ${themeVars.github.borderColor.accent.emphasis};
|
||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||
min-width: 150px;
|
||||
max-width: 400px;
|
||||
width: ${customThemeVars.custom.cloneMenuWidth};
|
||||
&:hover {
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
}
|
||||
&:focus,
|
||||
&:focus-visible {
|
||||
border-color: ${themeVars.github.borderColor.accent.emphasis};
|
||||
}
|
||||
}
|
||||
.ui.ui.ui.button {
|
||||
background-color: unset;
|
||||
border: unset;
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
padding: 5px 10px;
|
||||
padding: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 5px;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover};
|
||||
}
|
||||
svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 面板操作列表之间的分割线
|
||||
@@ -57,8 +57,8 @@ export const commit = css`
|
||||
export const commitStatus = css`
|
||||
.flex-text-inline[data-global-init="initCommitStatuses"] {
|
||||
padding: 6px;
|
||||
margin-top: 2px;
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
margin-right: 6px;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover};
|
||||
}
|
||||
161
styles/components/explore.ts
Normal file
161
styles/components/explore.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import { fallbackVar } from "src/functions";
|
||||
import { css, customThemeVars, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
const userRepoVar = fallbackVar(customThemeVars.custom.userRepolistColumns, "2");
|
||||
const exploreRepoVar = fallbackVar(customThemeVars.custom.explore.repolistColumns, "2");
|
||||
const orgRepoVar = fallbackVar(customThemeVars.custom.org.repolistColumns, "1");
|
||||
|
||||
// 仓库列表
|
||||
export const repoList = css`
|
||||
// 组织
|
||||
.page-content.organization.profile > .ui.container > .ui.stackable > .ui.eleven,
|
||||
// 用户
|
||||
.page-content.user.profile > .ui.container > .ui.stackable > .ui.twelve,
|
||||
// 探索
|
||||
.page-content.explore.repositories > .ui.container {
|
||||
> .flex-list {
|
||||
display: grid;
|
||||
> .flex-item {
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 16px;
|
||||
// 仓库头像
|
||||
> .flex-item-leading {
|
||||
img,
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
}
|
||||
// 仓库信息
|
||||
> .flex-item-main {
|
||||
// 仓库标题
|
||||
> .flex-item-header {
|
||||
// 仓库名称
|
||||
> .flex-item-title {
|
||||
gap: 8px;
|
||||
// 仓库中间的间隔线
|
||||
&:not(a) {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 仓库类型和状态标签
|
||||
> .label-list .label {
|
||||
padding: 3px 6px;
|
||||
}
|
||||
}
|
||||
// 仓库语言, 星标
|
||||
> .flex-item-trailing {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
gap: 16px;
|
||||
font-size: 12px;
|
||||
> .flex-text-inline .color-icon {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 描述和更新时间
|
||||
> .flex-item-body {
|
||||
margin-top: 8px;
|
||||
// 更新时间
|
||||
&:last-child {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
// 主题标签
|
||||
> .label-list {
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 仓库列表列数
|
||||
// 组织
|
||||
.page-content.organization.profile > .ui.container > .ui.stackable > .ui.eleven > .flex-list {
|
||||
grid-template-columns: repeat(${orgRepoVar}, 1fr);
|
||||
gap: min(${orgRepoVar} * 8px, 16px);
|
||||
}
|
||||
// 用户
|
||||
.page-content.user.profile > .ui.container > .ui.stackable > .ui.twelve > .flex-list {
|
||||
grid-template-columns: repeat(${userRepoVar}, 1fr);
|
||||
gap: min(${userRepoVar} * 8px, 16px);
|
||||
}
|
||||
// 探索
|
||||
.page-content.explore.repositories > .ui.container > .flex-list {
|
||||
grid-template-columns: repeat(${exploreRepoVar}, 1fr);
|
||||
gap: min(${exploreRepoVar} * 8px, 16px);
|
||||
}
|
||||
`;
|
||||
|
||||
const exploreUserVar = fallbackVar(customThemeVars.custom.explore.userlistColumns, "3");
|
||||
const orgUserVar = fallbackVar(customThemeVars.custom.org.userlistColumns, "2");
|
||||
|
||||
// 用户列表
|
||||
export const userList = css`
|
||||
// 组织
|
||||
.page-content.organization.members > .ui.container,
|
||||
// 探索的用户和组织
|
||||
.page-content.explore.users > .ui.container {
|
||||
> .flex-list {
|
||||
display: grid;
|
||||
> .flex-item {
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 16px;
|
||||
> .flex-item-main {
|
||||
// 用户名称
|
||||
> .flex-item-title {
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
// 用户标签
|
||||
> .label {
|
||||
font-size: 12px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
}
|
||||
// 用户描述
|
||||
> .flex-item-body {
|
||||
font-size: 12px;
|
||||
svg {
|
||||
width: 12px;
|
||||
min-width: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 用户列表列数
|
||||
// 组织
|
||||
.page-content.organization.members > .ui.container > .flex-list {
|
||||
grid-template-columns: repeat(${orgUserVar}, 1fr);
|
||||
gap: min(${orgUserVar} * 8px, 16px);
|
||||
}
|
||||
// 探索的用户和组织
|
||||
.page-content.explore.users > .ui.container > .flex-list {
|
||||
grid-template-columns: repeat(${exploreUserVar}, 1fr);
|
||||
gap: min(${exploreUserVar} * 8px, 16px);
|
||||
}
|
||||
`;
|
||||
|
||||
// 手机下的仓库和用户列表
|
||||
export const mobileList = css`
|
||||
@media (max-width: 767.98px) {
|
||||
// 组织的仓库列表
|
||||
.page-content.organization.profile > .ui.container > .ui.stackable > .ui.eleven,
|
||||
// 用户的仓库列表
|
||||
.page-content.user.profile > .ui.container > .ui.stackable > .ui.twelve,
|
||||
// 探索的仓库列表
|
||||
.page-content.explore.repositories > .ui.container,
|
||||
// 组织的成员列表
|
||||
.page-content.organization.members >.ui.container,
|
||||
// 探索的用户和组织列表
|
||||
.page-content.explore.users >.ui.container {
|
||||
> .flex-list {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -16,32 +16,19 @@ export const branchButton = css`
|
||||
}
|
||||
`;
|
||||
|
||||
// 顶部提交, 标签, 分支
|
||||
export const repoMenu = css`
|
||||
// 仓库同步派生
|
||||
export const syncFork = css`
|
||||
.page-content.repository.file.list {
|
||||
.repository-summary .repository-menu {
|
||||
background-color: ${themeVars.color.box.header};
|
||||
.item {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
b {
|
||||
color: ${themeVars.color.text.self};
|
||||
margin: 0 2px;
|
||||
}
|
||||
.repo-home-filelist > .ui.message {
|
||||
background: ${themeVars.color.box.header};
|
||||
padding: 8px 8px 8px 16px;
|
||||
.ui.button {
|
||||
min-width: 96px;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 仓库按钮
|
||||
export const repoButton = css`
|
||||
.page-content.repository.file.list {
|
||||
// clone 按钮调整
|
||||
.repo-button-row .repo-button-row-right .ui.primary.button span {
|
||||
margin: 0px 3px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 仓库文件列表
|
||||
export const repoFiles = css`
|
||||
.repository.file.list {
|
||||
@@ -61,17 +48,16 @@ export const repoFiles = css`
|
||||
&.repo-file-last-commit {
|
||||
min-height: 3.725rem;
|
||||
.latest-commit {
|
||||
gap: 8px;
|
||||
.commit-summary {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
img.tw-align-middle {
|
||||
margin-top: -1px;
|
||||
margin-left: 1px;
|
||||
margin-right: 8px !important;
|
||||
}
|
||||
// 作者
|
||||
.author-wrapper {
|
||||
margin-right: 6px;
|
||||
&:hover {
|
||||
color: ${themeVars.color.text.self};
|
||||
}
|
||||
@@ -124,6 +110,29 @@ export const repoFilesMobile = css`
|
||||
}
|
||||
`;
|
||||
|
||||
// 仓库打开文件时的视图
|
||||
export const repoFileView = css`
|
||||
.page-content.repository.file.list {
|
||||
.repo-view-container {
|
||||
// 右侧文件视图内容
|
||||
.repo-view-content {
|
||||
// 头部提交信息
|
||||
#repo-file-commit-box {
|
||||
padding: 8px 12px;
|
||||
> .latest-commit {
|
||||
gap: 8px;
|
||||
}
|
||||
// 右侧提交时间
|
||||
> .age {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 仓库代码布局调整, 侧边栏宽度调整
|
||||
export const repoGrid = css`
|
||||
.repo-grid-filelist-sidebar {
|
||||
@@ -215,7 +224,7 @@ export const repoSidebarBottom = css`
|
||||
.color-icon {
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
margin-right: 6px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.tw-font-semibold {
|
||||
color: ${themeVars.color.text.self};
|
||||
@@ -11,8 +11,8 @@ export const heatmap = css`
|
||||
// hover 时的圆角
|
||||
border-radius: 0.75px;
|
||||
// 宽度和高度可以用来控制间隔
|
||||
width: 9.5px;
|
||||
height: 9.5px;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
// 边框
|
||||
outline: 0.5px solid ${themeVars.github.contribution.default.borderColor.num0};
|
||||
// 边框向内偏移
|
||||
@@ -3,9 +3,11 @@ import "./clone";
|
||||
import "./commit";
|
||||
import "./dashboard";
|
||||
import "./diff";
|
||||
import "./explore";
|
||||
import "./filelist";
|
||||
import "./heatmap";
|
||||
import "./issue";
|
||||
import "./newrepo";
|
||||
import "./release";
|
||||
import "./repo";
|
||||
import "./setting";
|
||||
332
styles/components/issue.ts
Normal file
332
styles/components/issue.ts
Normal file
@@ -0,0 +1,332 @@
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
import { activeItemAfterStyle } from "styles/public/menu";
|
||||
|
||||
export const button = css`
|
||||
.issue-content-left .field.footer {
|
||||
// 关闭工单按钮
|
||||
.ui.red.basic.button#status-button {
|
||||
color: ${themeVars.github.fgColor.done};
|
||||
background-color: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.hover.self};
|
||||
}
|
||||
}
|
||||
|
||||
// 重新开启按钮
|
||||
.ui.basic.primary.button#status-button {
|
||||
color: ${themeVars.github.fgColor.success};
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const babel = css`
|
||||
.issue-content-left {
|
||||
.badge {
|
||||
// 时间线打开状态标签
|
||||
&.tw-bg-green {
|
||||
background-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
}
|
||||
// 时间线关闭状态标签
|
||||
&.tw-bg-red {
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
// 时间线合并状态标签
|
||||
&.tw-bg-purple {
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 工单&PR状态标签
|
||||
.ui.label.issue-state-label {
|
||||
border-radius: 25px !important;
|
||||
|
||||
&.green {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
}
|
||||
|
||||
&.red {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
|
||||
&.purple {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// PR 分支标签
|
||||
export const prBranch = css`
|
||||
.repository.view.issue .pull-desc code,
|
||||
#issue-list .flex-item-body .branches .branch {
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||
font-size: 12px;
|
||||
padding: 0 5px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.repository.view.issue .pull-desc code {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
a:hover {
|
||||
text-decoration-line: none;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 评论
|
||||
export const comment = css`
|
||||
.comment .comment-container {
|
||||
// 去除评论标题左侧指向头像的小箭头
|
||||
.comment-header,
|
||||
&:target .comment-header {
|
||||
&:before,
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
// 评论焦点样式
|
||||
&:target {
|
||||
.comment-container {
|
||||
border-color: ${themeVars.github.borderColor.accent.emphasis} !important;
|
||||
box-shadow: 0 0 0 1px ${themeVars.color.primary.self} !important;
|
||||
}
|
||||
}
|
||||
.comment-header {
|
||||
padding: 4px 4px 4px 16px;
|
||||
}
|
||||
.comment-header-right {
|
||||
> .item,
|
||||
> .label {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
> .ui.label {
|
||||
background-color: initial;
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
// 隐藏顶部菜单的表情按钮
|
||||
// 无法使用此样式, 评论无表情时底部的表情按钮元素不会渲染, 这是一个先有鸡还是先有蛋的问题
|
||||
// 很蛋疼, 希望 Gitea 早日使用 Github 的样式, 因为 Github 的更合理, 无论是操作的方便程度还是按钮的冗余度
|
||||
// .ui.dropdown.action.select-reaction {
|
||||
// display: none;
|
||||
// }
|
||||
.context-dropdown {
|
||||
a.context-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
// 评论菜单的删除按钮
|
||||
.menu .item.delete-comment {
|
||||
color: ${themeVars.color.red.self};
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.red.badge.bg} !important;
|
||||
color: ${themeVars.color.red.light};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 表情菜单按钮头部+底部
|
||||
.ui.dropdown.action.select-reaction > a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: ${themeVars.color.button};
|
||||
border-radius: 25px;
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
padding: 0px 8px !important;
|
||||
height: 28px;
|
||||
width: 28px;
|
||||
}
|
||||
// 底部表情栏
|
||||
.bottom-reactions {
|
||||
.ui.ui.ui.label {
|
||||
background-color: unset !important;
|
||||
border-radius: 25px;
|
||||
border-color: ${themeVars.color.light.border};
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.reaction.hoverBg} !important;
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
.reaction {
|
||||
font-size: 12px;
|
||||
}
|
||||
.reaction-count {
|
||||
color: ${themeVars.color.text.light.self};
|
||||
font-weight: 500;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
// 显示表情菜单按钮
|
||||
.select-reaction {
|
||||
padding: 0;
|
||||
// 两个表情按钮看着怪怪的, 很难受
|
||||
// visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const dropdown = css`
|
||||
.repository {
|
||||
// Issue/PR 列表下的所有筛选菜单
|
||||
&.issue-list .ui.dropdown .menu, .ui.menu .ui.dropdown .menu,
|
||||
// Issue/PR 详情下的右侧的上半部分选项菜单
|
||||
&.issue.view .issue-content-right .ui.dropdown .scrolling.menu {
|
||||
.item:hover:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// PR 界面的 PR 操作评论
|
||||
export const prMerge = css`
|
||||
.repository.view.issue .comment-list .timeline-item.pull-merge-box {
|
||||
// 头像
|
||||
.timeline-avatar {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
// 可以合并
|
||||
&.green {
|
||||
background-color: ${themeVars.github.bgColor.success.emphasis};
|
||||
// 操作评论边框色
|
||||
+ .content > .ui.attached.segment {
|
||||
border-left-color: ${themeVars.github.bgColor.success.emphasis};
|
||||
border-right-color: ${themeVars.github.bgColor.success.emphasis};
|
||||
&:first-child {
|
||||
border-top-color: ${themeVars.github.bgColor.success.emphasis};
|
||||
}
|
||||
&:last-child {
|
||||
border-bottom-color: ${themeVars.github.bgColor.success.emphasis};
|
||||
}
|
||||
}
|
||||
}
|
||||
// 已合并
|
||||
&.purple {
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis};
|
||||
+ .content > .ui.attached.segment {
|
||||
border-left-color: ${themeVars.github.bgColor.done.emphasis};
|
||||
border-right-color: ${themeVars.github.bgColor.done.emphasis};
|
||||
&:first-child {
|
||||
border-top-color: ${themeVars.github.bgColor.done.emphasis};
|
||||
}
|
||||
&:last-child {
|
||||
border-bottom-color: ${themeVars.github.bgColor.done.emphasis};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 检查状态
|
||||
.commit-status-panel {
|
||||
.commit-status-header {
|
||||
background: ${themeVars.color.body};
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
.ui.right {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
// 检查状态列表
|
||||
.commit-status-list {
|
||||
background: ${themeVars.color.menu};
|
||||
.commit-status-item {
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 2px 8px;
|
||||
margin: 0px 8px;
|
||||
height: 37px;
|
||||
&:first-child {
|
||||
margin-top: 8px;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.hover.opaque};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 合并信息和操作
|
||||
.merge-section {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
padding: 16px;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 时间线
|
||||
export const timeline = css`
|
||||
.repository.view.issue {
|
||||
.comment-list {
|
||||
.timeline-item,
|
||||
.timeline-item-group {
|
||||
padding: 16px 0;
|
||||
// 事件
|
||||
&.event {
|
||||
// 修复覆盖后的位置问题
|
||||
padding-left: 15px;
|
||||
.avatar {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.badge {
|
||||
border: 2px solid ${themeVars.color.body};
|
||||
}
|
||||
// 仅匹配只有 badge
|
||||
.badge:not([class*=" "]) {
|
||||
background-color: ${themeVars.github.control.bgColor.rest};
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
}
|
||||
}
|
||||
// 提交
|
||||
&.commits-list {
|
||||
// 每个提交之间的间隔
|
||||
.flex-text-block {
|
||||
padding-top: 4px;
|
||||
}
|
||||
.badge svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 仅覆盖左侧 commit 不覆盖右侧 SHA
|
||||
a.muted {
|
||||
font-size: 12px;
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
text-decoration-line: underline;
|
||||
&:hover {
|
||||
color: ${themeVars.color.primary.self};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,123 +0,0 @@
|
||||
import { css, themeVars } from "src/types/vars";
|
||||
import { activeItemAfterStyle } from "styles/public/menu";
|
||||
|
||||
export const button = css`
|
||||
.issue-content-left .field.footer {
|
||||
// 关闭工单按钮
|
||||
.ui.red.basic.button#status-button {
|
||||
color: ${themeVars.github.fgColor.done};
|
||||
background-color: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.hover.self};
|
||||
}
|
||||
}
|
||||
|
||||
// 重新开启按钮
|
||||
.ui.basic.primary.button#status-button {
|
||||
color: ${themeVars.github.fgColor.success};
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const babel = css`
|
||||
.issue-content-left {
|
||||
.badge {
|
||||
// 时间线打开状态标签
|
||||
&.tw-bg-green {
|
||||
background-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
}
|
||||
// 时间线关闭状态标签
|
||||
&.tw-bg-red {
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
// 时间线合并状态标签
|
||||
&.tw-bg-purple {
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 工单&PR状态标签
|
||||
.ui.label.issue-state-label {
|
||||
border-radius: 25px !important;
|
||||
|
||||
&.green {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.success.emphasis} !important;
|
||||
}
|
||||
|
||||
&.red {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
|
||||
&.purple {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// PR 分支标签
|
||||
export const prBranch = css`
|
||||
.repository.view.issue .pull-desc code,
|
||||
#issue-list .flex-item-body .branches .branch {
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
font-size: 12px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
`;
|
||||
|
||||
// 评论
|
||||
export const comment = css`
|
||||
.comment {
|
||||
// 去除评论标题左侧指向头像的小箭头
|
||||
.comment-header,
|
||||
&:target .comment-header {
|
||||
&:before,
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
// 评论焦点样式
|
||||
&:target {
|
||||
.comment-container {
|
||||
border-color: ${themeVars.github.borderColor.accent.emphasis} !important;
|
||||
box-shadow: 0 0 0 1px ${themeVars.color.primary.self} !important;
|
||||
}
|
||||
}
|
||||
.comment-header-right {
|
||||
.context-dropdown {
|
||||
// 评论菜单的删除按钮
|
||||
.menu .item.delete-comment {
|
||||
color: ${themeVars.color.red.self};
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.red.badge.bg} !important;
|
||||
color: ${themeVars.color.red.light};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const dropdown = css`
|
||||
.repository {
|
||||
// Issue/PR 列表下的所有筛选菜单
|
||||
&.issue-list .ui.dropdown .menu, .ui.menu .ui.dropdown .menu,
|
||||
// Issue/PR 详情下的右侧的上半部分选项菜单
|
||||
&.issue.view .issue-content-right .ui.dropdown .scrolling.menu {
|
||||
.item:hover:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
14
styles/components/newrepo.ts
Normal file
14
styles/components/newrepo.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { css } from "src/types/vars";
|
||||
import { activeItemAfterStyle } from "styles/public/menu";
|
||||
|
||||
// 新建仓库页面下拉菜单
|
||||
export const newRepo = css`
|
||||
.page-content.repository.new-repo {
|
||||
.ui.dropdown .menu {
|
||||
.item:hover:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -62,8 +62,12 @@ export const releases = css`
|
||||
margin-top: 1px;
|
||||
}
|
||||
}
|
||||
.js-branch-tag-selector {
|
||||
margin-top: 8px;
|
||||
// 分支选择按钮
|
||||
.ui.button.branch-dropdown-button {
|
||||
min-height: 20px;
|
||||
line-height: 20px;
|
||||
padding: 3px 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
// 右侧发布详细信息
|
||||
@@ -87,14 +91,22 @@ export const releases = css`
|
||||
}
|
||||
}
|
||||
}
|
||||
// 顶部右侧按钮组
|
||||
.ui.small.button {
|
||||
background-color: ${themeVars.color.button};
|
||||
padding: 5px 16px;
|
||||
min-height: auto;
|
||||
line-height: 20px;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.hover.self};
|
||||
}
|
||||
`;
|
||||
|
||||
// 顶部右侧按钮组
|
||||
export const rightButton = css`
|
||||
.page-content.repository {
|
||||
&.releases,
|
||||
&.tags {
|
||||
.ui.small.button {
|
||||
background-color: ${themeVars.color.button};
|
||||
padding: 5px 16px;
|
||||
min-height: auto;
|
||||
line-height: 20px;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.hover.self};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,6 @@ export const repoHeader = css`
|
||||
// 点星/关注/克隆/RSS 按钮
|
||||
.ui.compact.button {
|
||||
padding: 3px 12px;
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 文本跟图标间隔, 文本在手机下不显示
|
||||
span {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
// 仓库图标
|
||||
img.ui.avatar {
|
||||
@@ -54,19 +47,52 @@ export const repoHeader = css`
|
||||
}
|
||||
`;
|
||||
|
||||
export const repoTopic = css`
|
||||
#repo-topics {
|
||||
.ui.label.repo-topic {
|
||||
border-radius: 25px;
|
||||
font-size: 12px;
|
||||
padding: 5px 10px;
|
||||
margin: 0px 1.5px 3.5px 0px;
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.bgColor.accent.emphasis};
|
||||
color: ${themeVars.color.text.self};
|
||||
// 顶部提交, 标签, 分支统计
|
||||
export const repoMenu = css`
|
||||
.page-content.repository {
|
||||
.repository-summary .repository-menu {
|
||||
background-color: ${themeVars.color.box.header};
|
||||
.item {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
height: 31px; // 文件列表下与右侧输入框对齐
|
||||
b {
|
||||
color: ${themeVars.color.text.self};
|
||||
margin: 0 2px;
|
||||
}
|
||||
&.active {
|
||||
background-color: ${themeVars.color.active};
|
||||
color: ${themeVars.color.text.self};
|
||||
font-weight: 500;
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const repoTopic = css`
|
||||
// 理应只能覆盖探索/组织/用户下仓库的 topic 标签
|
||||
// 避免渲染到仓库的类型标签
|
||||
.flex-item-main > .label-list .ui.label,
|
||||
// 仓库文件列表下的 topic 标签
|
||||
#repo-topics .ui.label.repo-topic {
|
||||
border-radius: 25px;
|
||||
font-size: 12px;
|
||||
padding: 5px 10px;
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.bgColor.accent.emphasis};
|
||||
color: ${themeVars.color.text.self};
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 仓库动态页面关闭工单状态条颜色
|
||||
export const closedIssueTableCell = css`
|
||||
.stats-table .table-cell.tw-bg-red[href="#closed-issues"] {
|
||||
background-color: ${themeVars.color.purple.self} !important;
|
||||
}
|
||||
`;
|
||||
@@ -18,12 +18,25 @@ export const baseButton = css`
|
||||
min-height: 30px;
|
||||
font-weight: 500;
|
||||
padding: 9px 16px;
|
||||
&.ui {
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.ui.primary.button {
|
||||
${primaryStyle}
|
||||
&:hover {
|
||||
${primaryHoverStyle}
|
||||
.ui.button:not(.primary):not(.red) svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 主色调按钮保持白色
|
||||
.ui.primary.buttons .button svg {
|
||||
color: ${themeVars.color.text.self};
|
||||
}
|
||||
.ui.primary {
|
||||
&.button,
|
||||
// 按钮组, PR 里的压缩合并按钮
|
||||
&.buttons .button {
|
||||
${primaryStyle}
|
||||
&:hover {
|
||||
${primaryHoverStyle}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 主色调基本按钮和普通按钮一样
|
||||
@@ -76,14 +89,6 @@ export const redButton = css`
|
||||
}
|
||||
`;
|
||||
|
||||
// 分支菜单按钮
|
||||
export const branchDropdownButton = css`
|
||||
.ui.button.branch-dropdown-button {
|
||||
padding: 3px 12px;
|
||||
min-height: 30px;
|
||||
}
|
||||
`;
|
||||
|
||||
// 修复按钮高度
|
||||
export const fixButtonHeight = css`
|
||||
.ui.small.buttons .button,
|
||||
204
styles/public/dropdown.ts
Normal file
204
styles/public/dropdown.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import { animationDown, animationUp } from "src/core/theme";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
import { activeItemAfterStyle } from "styles/public/menu";
|
||||
|
||||
export const dropdown = css`
|
||||
.ui.dropdown,
|
||||
.ui.menu .ui.dropdown {
|
||||
.menu {
|
||||
animation: ${animationDown};
|
||||
// 统一所有下拉菜单的样式
|
||||
background-color: ${themeVars.color.menu} !important;
|
||||
border: unset !important;
|
||||
border-radius: 12px !important;
|
||||
box-shadow: ${themeVars.github.shadow.floating.small} !important;
|
||||
// 忽略隐藏
|
||||
> .item:not(.tw-hidden) {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 8px 10px !important;
|
||||
border-radius: ${otherThemeVars.border.radius} !important;
|
||||
&:not(.emoji) {
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
&:not(.emoji):first-of-type {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
// 不知道为什么提交差异对比页面操作中的 cherrypick 按钮无法被选中
|
||||
&.cherry-pick-button,
|
||||
&:not(.emoji):last-of-type {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover} !important;
|
||||
}
|
||||
&.selected {
|
||||
background-color: ${themeVars.color.active} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover} !important;
|
||||
}
|
||||
}
|
||||
&.active,
|
||||
&.selected {
|
||||
&:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle};
|
||||
}
|
||||
}
|
||||
}
|
||||
> .divider {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
&:after {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 向下弹出的下拉菜单向下偏移
|
||||
.ui.dropdown:not(.upward),
|
||||
.ui.menu .ui.dropdown:not(.upward) {
|
||||
.menu {
|
||||
margin-top: 0.35em !important;
|
||||
}
|
||||
}
|
||||
// 向上弹出的下拉菜单向上偏移
|
||||
.ui.dropdown.upward,
|
||||
.ui.menu .ui.dropdown.upward {
|
||||
.menu {
|
||||
animation: ${animationUp};
|
||||
margin-bottom: 0.35em !important;
|
||||
}
|
||||
}
|
||||
// 修复下拉菜单元素溢出问题
|
||||
// 用户菜单
|
||||
.user-menu>.item,
|
||||
// Issue/PR 菜单
|
||||
.ui.menu .ui.dropdown.item .menu .item {
|
||||
width: auto;
|
||||
}
|
||||
// 去掉下拉菜单的边框线
|
||||
// 设置里的下拉菜单
|
||||
.ui.selection.dropdown .menu > .item {
|
||||
border: unset;
|
||||
}
|
||||
// 修复一些菜单下的菜单元素溢出问题
|
||||
// 目前主要为分支菜单
|
||||
.ui.dropdown .menu .menu {
|
||||
border-radius: 12px !important;
|
||||
}
|
||||
// 修复按钮阴影被覆盖缺少边框线的问题
|
||||
// 仓库动态页面的右侧按钮, 比如时间周期
|
||||
.ui.floating.dropdown .menu,
|
||||
// 仪表板切换控制用户按钮
|
||||
.ui.dropdown .menu.context-user-switch .scrolling.menu {
|
||||
box-shadow: ${themeVars.github.shadow.floating.small} !important;
|
||||
}
|
||||
`;
|
||||
|
||||
// 选择框的下拉菜单看起来像普通按钮
|
||||
export const selectionDropdown = css`
|
||||
// 排除可以选择的输入搜索框和创建仓库的拥有者
|
||||
.ui.selection.dropdown:not(.search):not(.ellipsis-text-items),
|
||||
.ui.selection.dropdown.active:not(.search):not(.ellipsis-text-items) {
|
||||
background-color: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 8px 16px;
|
||||
min-height: 32px;
|
||||
&:focus {
|
||||
background: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
&:hover {
|
||||
background: ${themeVars.color.hover.self};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
// 悬停提供伪元素
|
||||
.item:hover:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle};
|
||||
}
|
||||
}
|
||||
// 这个按钮项目前只在创建仓库的拥有者
|
||||
// 不实现伪元素, 因为 .item 设置溢出的元素会被截断
|
||||
.ui.selection.dropdown.ellipsis-text-items,
|
||||
.ui.selection.dropdown.activeellipsis-text-items {
|
||||
&:focus {
|
||||
background: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
&:hover {
|
||||
background: ${themeVars.color.hover.self};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
}
|
||||
// 选择输入框效果和输入框 focus 效果一样
|
||||
.ui.selection.dropdown.active.search {
|
||||
background: ${themeVars.color.body};
|
||||
// 向内部添加一个 1px 的边框
|
||||
box-shadow: inset 0 0 0 1px ${themeVars.github.borderColor.accent.emphasis};
|
||||
outline: none;
|
||||
}
|
||||
// 覆盖选择输入框向上弹出时的 hover 效果, 原阴影会覆盖加厚的边框线
|
||||
.ui.selection.dropdown.active.search.upward:hover {
|
||||
box-shadow: inset 0 0 0 1px ${themeVars.github.borderColor.accent.emphasis};
|
||||
}
|
||||
// 由于之前的排除导致样式优先级变高, 小按钮去除圆角
|
||||
.ui.action.input > .dropdown.small:not(:first-child) {
|
||||
border-radius: 0;
|
||||
}
|
||||
// 排除一些小按钮, 例如软件包类型, 通常相邻有元素
|
||||
.ui.selection.dropdown.active:not(.small) {
|
||||
border-bottom-left-radius: ${otherThemeVars.border.radius} !important;
|
||||
border-bottom-right-radius: ${otherThemeVars.border.radius} !important;
|
||||
}
|
||||
// 修复因为上面的排除导致的圆角问题
|
||||
// 具体工单页面下依赖菜单选择框
|
||||
#new-dependency-drop-list.ui.selection.dropdown.active,
|
||||
// 提交图分支选择框
|
||||
#git-graph-container #flow-select-refs-dropdown {
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
// 修复选择框的下拉菜单向上显示时的样式问题
|
||||
.ui.upward.selection.dropdown.visible:not(.small),
|
||||
.ui.active.upward.selection.dropdown:not(.small) {
|
||||
border-top-left-radius: ${otherThemeVars.border.radius} !important;
|
||||
border-top-right-radius: ${otherThemeVars.border.radius} !important;
|
||||
}
|
||||
`;
|
||||
|
||||
export const fixSelectionDropdown = css`
|
||||
// 具体工单页面下依赖菜单选择框
|
||||
#new-dependency-drop-list.ui.selection.dropdown {
|
||||
// 高度对齐问题, 应该与 input 框高度一致
|
||||
min-height: 32px;
|
||||
}
|
||||
`;
|
||||
|
||||
// 分支菜单
|
||||
export const branchDropdown = css`
|
||||
.ui.dropdown.branch-selector-dropdown .menu > .item {
|
||||
animation: ${animationDown};
|
||||
}
|
||||
`;
|
||||
|
||||
// 包含表情的下拉菜单
|
||||
export const emojiDropdown = css`
|
||||
.ui.dropdown.action.select-reaction.active .menu:has(.emoji) {
|
||||
display: flex !important;
|
||||
flex-direction: row;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
min-width: auto;
|
||||
> .item.emoji {
|
||||
font-size: 14px;
|
||||
min-height: 32px;
|
||||
height: 32px;
|
||||
margin: 0px;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.bgColor.accent.emphasis} !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,112 +0,0 @@
|
||||
import { animation } from "src/core/theme";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
import { activeItemAfterStyle } from "styles/public/menu";
|
||||
|
||||
export const dropdown = css`
|
||||
.ui.dropdown,
|
||||
.ui.menu .ui.dropdown {
|
||||
.menu {
|
||||
animation: ${animation};
|
||||
// 统一所有下拉菜单的样式
|
||||
margin-top: 0.35em !important;
|
||||
background-color: ${themeVars.color.menu} !important;
|
||||
border: unset !important;
|
||||
border-radius: 12px !important;
|
||||
box-shadow: ${themeVars.github.shadow.floating.small} !important;
|
||||
// 忽略隐藏
|
||||
> .item:not(.tw-hidden) {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 8px 10px !important;
|
||||
border-radius: ${otherThemeVars.border.radius} !important;
|
||||
margin: 0 0.5rem;
|
||||
&:first-of-type {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
// 不知道为什么提交差异对比页面操作中的 cherrypick 按钮无法被选中
|
||||
&.cherry-pick-button,
|
||||
&:last-of-type {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover} !important;
|
||||
}
|
||||
&.selected {
|
||||
background-color: ${themeVars.color.active} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover} !important;
|
||||
}
|
||||
}
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
&.active,
|
||||
&.selected {
|
||||
&:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle};
|
||||
}
|
||||
}
|
||||
}
|
||||
> .divider {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
&:after {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 修复下拉菜单元素溢出问题
|
||||
// 用户菜单
|
||||
.user-menu>.item,
|
||||
// Issue/PR 菜单
|
||||
.ui.menu .ui.dropdown.item .menu .item {
|
||||
width: auto;
|
||||
}
|
||||
// 去掉下拉菜单的边框线
|
||||
// 设置里的下拉菜单
|
||||
.ui.selection.dropdown .menu > .item {
|
||||
border: unset;
|
||||
}
|
||||
// 修复一些菜单下的菜单元素溢出问题
|
||||
// 目前主要为分支菜单
|
||||
.ui.dropdown .menu .menu {
|
||||
border-radius: 12px !important;
|
||||
}
|
||||
// 修复仪表板切换控制用户按钮阴影被覆盖缺少边框线的问题
|
||||
.ui.dropdown .menu.context-user-switch .scrolling.menu {
|
||||
box-shadow: ${themeVars.github.shadow.floating.small} !important;
|
||||
}
|
||||
`;
|
||||
|
||||
// 选择框的下拉菜单看起来像普通按钮
|
||||
export const selectionDropdown = css`
|
||||
.ui.selection.dropdown,
|
||||
.ui.selection.dropdown.active {
|
||||
background-color: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 8px 16px;
|
||||
min-height: 32px;
|
||||
&:focus {
|
||||
background: ${themeVars.color.button};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
&:hover {
|
||||
background: ${themeVars.color.hover.self};
|
||||
border-color: ${themeVars.color.light.border};
|
||||
}
|
||||
// 悬停提供伪元素
|
||||
.item:hover:after {
|
||||
content: "";
|
||||
${activeItemAfterStyle};
|
||||
}
|
||||
}
|
||||
// 排除一些小按钮, 例如软件包类型, 通常相邻有元素
|
||||
.ui.selection.dropdown.active:not(.small) {
|
||||
border-bottom-left-radius: ${otherThemeVars.border.radius} !important;
|
||||
border-bottom-right-radius: ${otherThemeVars.border.radius} !important;
|
||||
}
|
||||
`;
|
||||
@@ -2,6 +2,7 @@
|
||||
// tslint:disable:ordered-imports
|
||||
// 组件导入有顺序, 禁止插件优化
|
||||
import "./radius"; // 圆角, 此样式为基础样式, 确保在其他样式之前导入
|
||||
import "./transition"; // 过渡效果
|
||||
import "./text"; // 文本或 SVG 的基本颜色
|
||||
import "./button"; // 按钮
|
||||
import "./chroma"; // 代码高亮
|
||||
@@ -11,3 +12,4 @@ import "./label"; // 标签
|
||||
import "./menu"; // 菜单
|
||||
import "./modal"; // 弹窗
|
||||
import "./tippy"; // 提示框
|
||||
import "./navbar"; // 导航栏
|
||||
@@ -4,7 +4,8 @@ export const input = css`
|
||||
input,
|
||||
textarea,
|
||||
.ui.input input,
|
||||
.ui.form input:not([type]),
|
||||
// 排除可以选择的输入搜索框
|
||||
.ui.form input:not([type]):not(.search),
|
||||
.ui.form select,
|
||||
.ui.form textarea,
|
||||
.ui.form input[type="date"],
|
||||
@@ -29,4 +30,12 @@ export const input = css`
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ui.input {
|
||||
height: 32px;
|
||||
}
|
||||
// 由于输入框高度, 需要输入框在表单中垂直居中
|
||||
.ui.form {
|
||||
align-items: center;
|
||||
}
|
||||
`;
|
||||
@@ -8,6 +8,20 @@ export const label = css`
|
||||
&.ui.ui.ui {
|
||||
&.label {
|
||||
border-radius: 25px;
|
||||
// 多个标签的组合标签的圆角修复
|
||||
&.scope-parent {
|
||||
.scope-left {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.scope-middle {
|
||||
border-radius: 0;
|
||||
}
|
||||
.scope-right {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
/* 主色调标签 */
|
||||
&.primary {
|
||||
background-color: unset;
|
||||
@@ -87,28 +101,40 @@ export const shaLabel = css`
|
||||
&.sign-trusted {
|
||||
border: 1.5px solid ${themeVars.color.green.badge.self} !important;
|
||||
color: ${themeVars.color.green.badge.self} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.green.badge.hover.bg} !important;
|
||||
}
|
||||
}
|
||||
// 验证未信任
|
||||
&.sign-untrusted {
|
||||
border: 1.5px solid ${themeVars.color.yellow.badge.self} !important;
|
||||
color: ${themeVars.color.yellow.badge.self} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.yellow.badge.hover.bg} !important;
|
||||
}
|
||||
}
|
||||
// 验证未匹配
|
||||
&.sign-unmatched {
|
||||
border: 1.5px solid ${themeVars.color.orange.badge.self} !important;
|
||||
color: ${themeVars.color.orange.badge.self} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.orange.badge.hover.bg} !important;
|
||||
}
|
||||
}
|
||||
// 验证警告
|
||||
&.sign-warning {
|
||||
border: 1.5px solid ${themeVars.color.red.badge.self} !important;
|
||||
color: ${themeVars.color.red.badge.self} !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.red.badge.hover.bg} !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 任务状态标签, 目前仅在管理员页面 Runner 状态中看到
|
||||
export const taskStatusLabel = css`
|
||||
.ui.label.task-status- {
|
||||
.runner-container .ui.label.task-status- {
|
||||
&success {
|
||||
color: ${themeVars.color.success.text};
|
||||
border: 1px solid ${themeVars.color.success.border};
|
||||
@@ -110,6 +110,9 @@ export const verticalMenu = css`
|
||||
`;
|
||||
|
||||
export const menu = css`
|
||||
.menu .item svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 菜单默认悬浮色更改
|
||||
.ui.menu a.item,
|
||||
.ui.secondary.pointing.menu a.item,
|
||||
@@ -138,8 +141,16 @@ export const menu = css`
|
||||
}
|
||||
`;
|
||||
|
||||
// 二级导航栏
|
||||
export const secondaryMenu = css`
|
||||
// 二级菜单, 比如 Issue/PR/Actions 的筛选菜单
|
||||
.ui.secondary.menu {
|
||||
.item {
|
||||
padding: 0px 12px;
|
||||
height: 32px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
// 二级导航栏, 比如仓库的导航栏, 仓库列表的导航栏, 探索的类型导航栏
|
||||
.ui.secondary.pointing.menu {
|
||||
.overflow-menu-items {
|
||||
gap: 0.5rem;
|
||||
@@ -150,6 +161,9 @@ export const secondaryMenu = css`
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
}
|
||||
.item {
|
||||
font-weight: 400; // 二级导航栏不需要加粗
|
||||
}
|
||||
.active.item,
|
||||
.dropdown.item,
|
||||
.link.item,
|
||||
@@ -157,7 +171,6 @@ export const secondaryMenu = css`
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
color: ${themeVars.color.text.self};
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
import { animationDown } from "src/core/theme";
|
||||
import { css, themeVars } from "src/types/vars";
|
||||
|
||||
export const modal = css`
|
||||
.ui.modal {
|
||||
animation: ${animationDown};
|
||||
border: 1.5px solid ${themeVars.color.light.border};
|
||||
|
||||
> .header {
|
||||
90
styles/public/navbar.ts
Normal file
90
styles/public/navbar.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
export const navbarRight = css`
|
||||
#navbar {
|
||||
.navbar-right {
|
||||
gap: 8px;
|
||||
// 右侧按钮, 但不包括头像
|
||||
> .item:not(:last-child) {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
grid-auto-columns: max-content;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
border: 1px solid ${themeVars.color.light.border};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: unset;
|
||||
height: 32px;
|
||||
min-width: 32px;
|
||||
min-height: 32px;
|
||||
// 纠正内容保证居中
|
||||
.tw-relative {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
.svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
// 带下拉菜单的按钮
|
||||
&.ui.dropdown {
|
||||
padding: 0 8px;
|
||||
.text {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
align-items: center;
|
||||
> svg {
|
||||
margin-right: 8px;
|
||||
}
|
||||
// 三角号纠正高度保持居中
|
||||
.not-mobile {
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
background-color: ${themeVars.color.nav.hoverBg};
|
||||
}
|
||||
}
|
||||
}
|
||||
.item.ui.dropdown {
|
||||
// 头像菜单
|
||||
&:last-child {
|
||||
padding-left: 2px; // 调整此选项需同步增减相同的标识的 left
|
||||
padding-right: 16px;
|
||||
.text {
|
||||
// 不显示小箭头标识
|
||||
> .not-mobile {
|
||||
display: none;
|
||||
}
|
||||
// 头像
|
||||
img {
|
||||
border-radius: 25px;
|
||||
height: 32px;
|
||||
max-height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 用户头像的管理员标识
|
||||
.navbar-profile-admin {
|
||||
background-color: ${themeVars.github.bgColor.accent.emphasis};
|
||||
border-radius: 25px;
|
||||
color: ${themeVars.color.text.self};
|
||||
font-size: 8px;
|
||||
font-weight: 600;
|
||||
padding: 2px 5px;
|
||||
top: -3px;
|
||||
left: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 手机下的创建菜单按钮
|
||||
@media (max-width: 767.98px) {
|
||||
#navbar .navbar-right > .item:not(:last-child) {
|
||||
display: none;
|
||||
}
|
||||
#navbar.navbar-menu-open .navbar-right > .item:not(:last-child) {
|
||||
display: grid;
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -38,7 +38,8 @@ export const radius = css`
|
||||
&.table,
|
||||
&.segment,
|
||||
&.segments,
|
||||
&.grid.segment &.selection.dropdown,
|
||||
&.grid.segment,
|
||||
&.selection.dropdown,
|
||||
&.horizontal.segments,
|
||||
&.active.empty.selection.dropdown {
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
@@ -77,8 +78,10 @@ export const radiusImportant = css`
|
||||
border-radius: ${otherThemeVars.border.radius} !important;
|
||||
}
|
||||
// 目前为仓库列表/探索的二级菜单, 改版需要替换为全圆角
|
||||
.ui.tabular.menu .active.item {
|
||||
.ui.secondary.tabular.menu .item {
|
||||
border-radius: ${otherThemeVars.border.radius} !important;
|
||||
&.active,
|
||||
&.active:hover,
|
||||
&:hover {
|
||||
border-radius: ${otherThemeVars.border.radius} !important;
|
||||
}
|
||||
@@ -112,10 +115,10 @@ export const radiusTop = css`
|
||||
|
||||
// 上半部分圆角替换(原CSS带!important)
|
||||
export const radiusTopImportant = css`
|
||||
.ui.tabular.menu .item,
|
||||
.ui.simple.upward.dropdown {
|
||||
&.active {
|
||||
border-radius: ${otherThemeVars.border.radius} ${otherThemeVars.border.radius} 0 0 !important;
|
||||
}
|
||||
&.active,
|
||||
&.active:hover,
|
||||
&:hover {
|
||||
border-radius: ${otherThemeVars.border.radius} ${otherThemeVars.border.radius} 0 0 !important;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { animation } from "src/core/theme";
|
||||
import { animationDown } from "src/core/theme";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
// 一些界面内的提示框, 比如克隆按钮, PR信息, Runner信息 等
|
||||
@@ -7,7 +7,7 @@ export const tippyBox = css`
|
||||
margin-top: -3px;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
animation: ${animation};
|
||||
animation: ${animationDown};
|
||||
// 边框线同步 github 样式
|
||||
&[data-theme="default"],
|
||||
&[data-theme="box-with-header"] {
|
||||
@@ -1,45 +0,0 @@
|
||||
// Made by Luting ^-^
|
||||
@keyframes overlay-appear {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-12px);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
#navbar .item,
|
||||
.header-wrapper .ui.tabular.menu .item,
|
||||
.job-step-summary,
|
||||
.job-step-logs,
|
||||
.job-brief-item,
|
||||
.tippy-box .flex-items-block .item,
|
||||
.clone-panel-tab .item,
|
||||
.ui.form select,
|
||||
.ui.label,
|
||||
.ui.modal,
|
||||
.ui.selection.dropdown,
|
||||
.ui.checkbox label:before,
|
||||
.ui.checkbox input:checked ~ label:before,
|
||||
.ui.checkbox input:not([type="radio"]):indeterminate ~ label:before,
|
||||
.ui.selection.active.dropdown,
|
||||
.ui.selection.active.dropdown:hover,
|
||||
.ui.selection.active.dropdown .menu,
|
||||
.ui.selection.active.dropdown:hover .menu,
|
||||
.ui.vertical.menu .header.item,
|
||||
.ui.secondary.menu .item {
|
||||
transition: 0.12s ease-out;
|
||||
}
|
||||
|
||||
textarea,
|
||||
.ui.form input,
|
||||
.menu .item,
|
||||
.ui.modal,
|
||||
.job-step-summary,
|
||||
.job-step-logs,
|
||||
.job-brief-item {
|
||||
animation: 200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running overlay-appear;
|
||||
}
|
||||
49
styles/public/transition.ts
Normal file
49
styles/public/transition.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { css } from "src/types/vars";
|
||||
|
||||
// 简单的渐变过渡
|
||||
export const transition = css`
|
||||
// 迁移的元素
|
||||
#navbar .item,
|
||||
.header-wrapper .ui.tabular.menu .item,
|
||||
.job-step-summary,
|
||||
.job-step-logs,
|
||||
.job-brief-item,
|
||||
.repo-file-cell,
|
||||
.tippy-box .flex-items-block .item,
|
||||
.clone-panel-tab .item,
|
||||
.ui.form select,
|
||||
.ui.label,
|
||||
.ui.modal,
|
||||
.ui.checkbox label:before,
|
||||
.ui.checkbox input:checked ~ label:before,
|
||||
.ui.checkbox input:not([type="radio"]):indeterminate ~ label:before,
|
||||
.ui.selection.dropdown,
|
||||
.ui.selection.active.dropdown,
|
||||
.ui.selection.active.dropdown:hover,
|
||||
.ui.selection.active.dropdown .menu,
|
||||
.ui.selection.active.dropdown:hover .menu,
|
||||
.ui.vertical.menu .header.item,
|
||||
.ui.secondary.menu .item {
|
||||
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
||||
}
|
||||
// Gitea 表单元素原始过渡覆盖
|
||||
input,
|
||||
textarea,
|
||||
tr,
|
||||
.ui.input textarea,
|
||||
.ui.form textarea,
|
||||
.ui.form input:not([type]),
|
||||
.ui.form input[type="date"],
|
||||
.ui.form input[type="datetime-local"],
|
||||
.ui.form input[type="email"],
|
||||
.ui.form input[type="number"],
|
||||
.ui.form input[type="password"],
|
||||
.ui.form input[type="search"],
|
||||
.ui.form input[type="tel"],
|
||||
.ui.form input[type="time"],
|
||||
.ui.form input[type="text"],
|
||||
.ui.form input[type="file"],
|
||||
.ui.form input[type="url"] {
|
||||
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
||||
}
|
||||
`;
|
||||
@@ -23,7 +23,6 @@
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import linaria from "@wyw-in-js/vite";
|
||||
import * as dotenv from "dotenv";
|
||||
import { Features } from "lightningcss";
|
||||
@@ -24,7 +23,7 @@ export default defineConfig(({ mode }) => {
|
||||
styles: path.resolve(__dirname, "styles"),
|
||||
themes: path.resolve(__dirname, "themes"),
|
||||
},
|
||||
extensions: [".js", ".jsx", ".ts", ".tsx", ".css.tsx"],
|
||||
extensions: [".js", ".ts", ".css.ts"],
|
||||
},
|
||||
css: {
|
||||
transformer: "lightningcss",
|
||||
@@ -37,14 +36,13 @@ export default defineConfig(({ mode }) => {
|
||||
linaria({
|
||||
include: ["**/*.{ts,tsx}"],
|
||||
babelOptions: {
|
||||
presets: ["@babel/preset-typescript", "@babel/preset-react"],
|
||||
presets: ["@babel/preset-typescript"],
|
||||
},
|
||||
preprocessor: (_selector, cssText) => sass.compileString(cssText).css, // 默认为全局样式并使用 sass-embedded 预处理 css
|
||||
tagResolver: (source, tag) =>
|
||||
// 识别从 src 导出的 css 标签,使用 @linaria/core/processors/css 处理
|
||||
source === "src/types/vars" && tag === "css" ? require.resolve("@linaria/core/processors/css") : null,
|
||||
}),
|
||||
react(),
|
||||
vanillaExtractPlugin(),
|
||||
themePlugin(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user