mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2026-04-13 23:11:37 +08:00
Compare commits
23 Commits
7f51f4b2eb
...
v1.25.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55cbf235d5 | ||
|
|
976949aa2e | ||
|
|
0a7d5970c9 | ||
|
|
98630773fb | ||
|
|
f71dccb0c1 | ||
|
|
925068c962 | ||
|
|
2901ef5fef | ||
|
|
4ac74837b3 | ||
|
|
b8c6eced7f | ||
|
|
a8a3cd5546 | ||
|
|
41e209c257 | ||
|
|
d22c46e96f | ||
|
|
97f602435c | ||
|
|
fede39c6eb | ||
|
|
493657bcb5 | ||
|
|
e537b75bad | ||
|
|
07c6f0a78e | ||
|
|
b057060b05 | ||
|
|
394a53d963 | ||
|
|
0f7a1d85c9 | ||
|
|
baa59d60a7 | ||
|
|
a62f65700c | ||
|
|
f2580e6c77 |
23
CHANGELOG.md
23
CHANGELOG.md
@@ -2,17 +2,32 @@
|
||||
|
||||
##### 更符合 GitHub 风格
|
||||
|
||||
- 优化差异对比代码块的样式
|
||||
- 优化用户头像样式
|
||||
- 优化 Issue/PR 的评论菜单按钮样式
|
||||
- 优化 Issue/PR/Diff/Actions 的三点菜单按钮样式
|
||||
- 优化用户动态样式
|
||||
- 优化仓库发布页面样式
|
||||
- 优化字符提示的提示框动画
|
||||
|
||||
### 🐞 Fix
|
||||
|
||||
- 修复 Issue/PR 侧边栏的时间追踪样式
|
||||
- 修复 Issue/PR 详细页面中的部分文字颜色
|
||||
- 修复 Issue/PR 详细页面中的部分文字颜色, 时间线上的标签样式和侧边栏的时间追踪样式
|
||||
- 修复一些选择输入框的排列问题
|
||||
|
||||
## 📃 English
|
||||
|
||||
### 🌈 Style
|
||||
|
||||
##### More aligned with GitHub style
|
||||
##### More aligned with GitHub style
|
||||
|
||||
- Optimized diff comparison code block styles
|
||||
- Optimized user avatar styles
|
||||
- Optimized three-dot menu button styles for Issue/PR/Diff/Actions
|
||||
- Optimized user activity feed styles
|
||||
- Optimized repository release page styles
|
||||
- Optimized tooltip animation for character hints
|
||||
|
||||
### 🐞 Fix
|
||||
|
||||
- Fixed text color issues in Issue/PR detail pages, timeline label styles, and sidebar time tracking styles
|
||||
- Fixed alignment issues with some select input fields
|
||||
BIN
screenshots/dashboard.png
vendored
BIN
screenshots/dashboard.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 269 KiB After Width: | Height: | Size: 593 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 602 KiB |
@@ -6,6 +6,13 @@ import type { MapLeafNodes, WithOptionalLayer } from "./types";
|
||||
|
||||
export type Theme = WithOptionalLayer<MapLeafNodes<typeof themeVars, string>>;
|
||||
|
||||
export const overlayAppear = "overlay-appear";
|
||||
export const animation = {
|
||||
animation: overlayAppear,
|
||||
animationDuration: "80ms",
|
||||
animationFillMode: "forwards",
|
||||
animationTimingFunction: "ease-in",
|
||||
};
|
||||
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";
|
||||
|
||||
@@ -194,6 +194,7 @@ export const github = {
|
||||
* @issue `issueList` 头部菜单左侧开启关闭菜单的悬停背景颜色
|
||||
* @dashboard `dashboard` 仓库列表项目的悬停背景颜色
|
||||
* @notification `notification` 通知列表的按钮悬停背景颜色
|
||||
* @actions `actions` 列表页运行信息的三点操作按钮悬停背景颜色
|
||||
*/
|
||||
hover: null,
|
||||
},
|
||||
|
||||
@@ -88,9 +88,10 @@ export const actions = css`
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
}
|
||||
> .ui.dropdown.jump {
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
&:hover {
|
||||
color: ${themeVars.color.primary.self};
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover};
|
||||
}
|
||||
.menu > .item:hover {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
|
||||
@@ -101,10 +101,5 @@ export const commitGraph = css`
|
||||
}
|
||||
}
|
||||
}
|
||||
// 提交图的分支选择菜单框
|
||||
.ui.search.selection.dropdown > .menu > .item {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,15 +1,49 @@
|
||||
import { css, themeVars } from "src/types/vars";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
export const diff = css`
|
||||
/* 折叠行多余的颜色 */
|
||||
// 这里的折叠行和代码行高度与 GitHub 的 release 和 review 的差异对比时的高度一致, 不需要像 commit 中的差异对比那样行高过高
|
||||
// release 和 review 行高为 20px, commit 行高为 24px
|
||||
// 折叠行
|
||||
.tag-code {
|
||||
// 多余的颜色
|
||||
background-color: unset;
|
||||
/* 折叠行文本 */
|
||||
height: 28px;
|
||||
// 展开按钮高度与折叠行一致
|
||||
.code-expander-buttons {
|
||||
.code-expander-button {
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
// 双向展开的按钮
|
||||
&:has(.code-expander-buttons[data-expand-direction="3"]) {
|
||||
height: 40px;
|
||||
.code-expander-button {
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
// 展开按钮
|
||||
.code-expander-button {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
&:hover {
|
||||
background: ${themeVars.github.bgColor.accent.emphasis};
|
||||
color: ${themeVars.color.white};
|
||||
}
|
||||
}
|
||||
// 折叠行文本
|
||||
.code-inner {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
}
|
||||
/* 增加/删除行多余的颜色 */
|
||||
// 代码行
|
||||
.lines-num,
|
||||
.lines-code {
|
||||
line-height: 20px;
|
||||
}
|
||||
// 行号居中
|
||||
.lines-num {
|
||||
text-align: center !important;
|
||||
}
|
||||
// 增加/删除行多余的颜色
|
||||
.code-diff-unified {
|
||||
.del-code,
|
||||
.add-code {
|
||||
@@ -17,29 +51,16 @@ export const diff = css`
|
||||
border-color: unset;
|
||||
}
|
||||
}
|
||||
/* 增加/删除相关代码背景色圆角 */
|
||||
// 增加/删除相关代码背景色圆角
|
||||
.added-code,
|
||||
.removed-code {
|
||||
border-radius: 0.1875rem;
|
||||
border-radius: 3px;
|
||||
color: ${themeVars.color.text.self};
|
||||
/* 覆盖掉 chroma 的颜色 */
|
||||
// 覆盖掉 chroma 的颜色
|
||||
* {
|
||||
color: ${themeVars.color.text.self} !important;
|
||||
}
|
||||
}
|
||||
/* 展开/收缩按钮 */
|
||||
.code-expander-button {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
height: 28px !important;
|
||||
&:hover {
|
||||
background: ${themeVars.github.bgColor.accent.emphasis};
|
||||
color: ${themeVars.color.white};
|
||||
}
|
||||
}
|
||||
/* 行号居中 */
|
||||
.lines-num {
|
||||
text-align: center !important;
|
||||
}
|
||||
// 差异对比文件盒子
|
||||
.diff-file-box {
|
||||
// 差异对比文件头
|
||||
@@ -66,7 +87,55 @@ export const diff = css`
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
.diff-header-popup-btn {
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
padding: 5px !important;
|
||||
&:hover {
|
||||
background-color: ${themeVars.github.control.transparent.bgColor.hover};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 差异对比文件盒子
|
||||
.repository .diff-file-box {
|
||||
.code-diff {
|
||||
// 隐藏多余的空白
|
||||
// 合并视图的第三列
|
||||
&.code-diff-unified colgroup col:nth-child(3),
|
||||
// 拆分视图的第二列和第六列
|
||||
&.code-diff-split colgroup col:nth-child(2),
|
||||
&.code-diff-split colgroup col:nth-child(6),
|
||||
td.lines-escape {
|
||||
width: 0; // 不要使用 display: none; 否则会影响布局
|
||||
visibility: hidden;
|
||||
}
|
||||
// Gitea 分列视图下默认 100% 宽度的目的是如果单文件只增加或只删除的情况下, 保持无内容的列的宽度一致, 始终保持左右两边的列宽度一致
|
||||
// 保持 Gitea 的默认设置, 不对行号宽度做处理
|
||||
/* &.code-diff-split table {
|
||||
width: auto;
|
||||
} */
|
||||
// 行号宽度
|
||||
// 40px: 长度 = 9999 行
|
||||
// 45px: 长度 = 99999 行
|
||||
// 50px: 长度 = 999999 行
|
||||
// GitHub 在 commit 中的行宽最小为 40px, 但会动态调整, 在 release 和 review 的差异对比中为 50px
|
||||
// 这里折中为 45px 会根据代码行数动态调整, 45px 既不会在行数少时显得太宽, 也可以在大多数情况下保持宽度一致
|
||||
.lines-num {
|
||||
min-width: 45px;
|
||||
}
|
||||
// 合并视图的第四列
|
||||
&.code-diff-unified colgroup col:nth-child(4),
|
||||
// 拆分视图的第三列和第七列, -/+ 保持居中的宽度
|
||||
&.code-diff-split colgroup col:nth-child(3),
|
||||
&.code-diff-split colgroup col:nth-child(7) {
|
||||
width: 20;
|
||||
}
|
||||
}
|
||||
// 修复对比视图内容中的圆角和背景溢出
|
||||
.file-body.file-code {
|
||||
border-radius: 0 0 ${otherThemeVars.border.radius} ${otherThemeVars.border.radius};
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -441,7 +441,7 @@ export const repoSidebarBottom = css`
|
||||
padding: 16px 0;
|
||||
.flex-item {
|
||||
padding: 16px 0 0 0;
|
||||
.flex-item-icon {
|
||||
.flex-item-leading {
|
||||
svg.svg.octicon-tag {
|
||||
color: ${themeVars.color.green.self};
|
||||
margin-top: 2px;
|
||||
|
||||
@@ -93,14 +93,12 @@ export const activity = css`
|
||||
flex-wrap: wrap;
|
||||
> a {
|
||||
color: ${themeVars.color.text.self};
|
||||
text-decoration: none;
|
||||
text-underline-offset: 0.2rem;
|
||||
// 不匹配作者
|
||||
&:not([title]) {
|
||||
text-decoration: underline;
|
||||
// 尽量只选中仓库名, 不匹配标签和分支
|
||||
&:not([href*="tag"]):not([href*="branch"]) {
|
||||
color: ${themeVars.color.primary.self};
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ export const packagesList = css`
|
||||
font-size: 12px;
|
||||
a {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export const releases = css`
|
||||
// 标题
|
||||
.release-list-title {
|
||||
font-size: 32px;
|
||||
gap: 16px;
|
||||
gap: 8px;
|
||||
}
|
||||
// 提交信息
|
||||
p.text.grey {
|
||||
@@ -140,13 +140,13 @@ export const releases = css`
|
||||
position: relative;
|
||||
left: -16px;
|
||||
width: calc(100% + 32px);
|
||||
border-top-width: 1.5px;
|
||||
border-top-width: 1px;
|
||||
margin: 24px 0 16px 0;
|
||||
}
|
||||
// 下载列表
|
||||
.download {
|
||||
summary {
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-top: 16px;
|
||||
&::marker {
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import { overlayAppearDown, overlayAppearUp } from "src/core/theme";
|
||||
import { overlayAppear, overlayAppearDown, overlayAppearUp } from "src/core/theme";
|
||||
import { css } from "src/types/vars";
|
||||
|
||||
export const keyframe = css`
|
||||
// 出现动画
|
||||
@keyframes ${overlayAppear} {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
// 向下出现动画
|
||||
@keyframes ${overlayAppearDown} {
|
||||
0% {
|
||||
|
||||
@@ -4,4 +4,7 @@ export const body = css`
|
||||
body {
|
||||
line-height: 18px;
|
||||
}
|
||||
a {
|
||||
text-underline-offset: 0.2rem; // 0.2rem 可以始终保持下划线不受 overflow: hidden 的影响
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -230,7 +230,7 @@ export const selectionDropdown = css`
|
||||
// 标签页面的标签选择框
|
||||
.page-content.repository.labels .ui.selection.dropdown.active,
|
||||
// 创建仓库页面的标签选择框
|
||||
.ui.search.selection.dropdown {
|
||||
.page-content.repository.new-repo .ui.search.selection.dropdown {
|
||||
> .menu > .item {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -3,68 +3,73 @@ import { css, themeVars } from "src/types/vars";
|
||||
export const label = css`
|
||||
/* 所有标签, 但不包括 a 标签 */
|
||||
/* a 标签比如仓库点星等按钮旁边的数字标签按钮,提交图中的 tag 标签 */
|
||||
div.label,
|
||||
span.label,
|
||||
// 包含多个标签的元素, 比如 Issue/PR 详情页中的时间线上的标签
|
||||
span.labels-list a.label {
|
||||
&.ui.ui.ui {
|
||||
border-radius: 9999px;
|
||||
padding: 1.5px 6px;
|
||||
// 多个标签的组合标签的圆角修复
|
||||
&.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
div,
|
||||
span {
|
||||
&.ui.ui.ui {
|
||||
&.label {
|
||||
border-radius: 9999px;
|
||||
padding: 1.5px 6px;
|
||||
// 多个标签的组合标签的圆角修复
|
||||
&.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;
|
||||
border: 1px solid ${themeVars.color.primary.self};
|
||||
color: ${themeVars.color.primary.self};
|
||||
}
|
||||
/* 红色标签 */
|
||||
&.red {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.done.emphasis};
|
||||
color: ${themeVars.color.purple.self};
|
||||
}
|
||||
/* 橙色标签 */
|
||||
&.orange {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.attention.emphasis};
|
||||
color: ${themeVars.color.yellow.self};
|
||||
}
|
||||
/* 黄色标签 */
|
||||
&.yellow {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.attention.emphasis};
|
||||
color: ${themeVars.color.orange.self};
|
||||
}
|
||||
/* 黄绿色标签 */
|
||||
&.olive {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.color.olive.self};
|
||||
color: ${themeVars.color.olive.self};
|
||||
}
|
||||
/* 绿色标签 */
|
||||
&.green {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.success.emphasis};
|
||||
color: ${themeVars.color.green.self};
|
||||
}
|
||||
/* 紫色标签 */
|
||||
&.purple {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.done.emphasis};
|
||||
color: ${themeVars.color.purple.self};
|
||||
}
|
||||
&.ui.ui.ui.label {
|
||||
/* 主色调标签 */
|
||||
&.primary {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.color.primary.self};
|
||||
color: ${themeVars.color.primary.self};
|
||||
}
|
||||
/* 红色标签 */
|
||||
&.red {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.done.emphasis};
|
||||
color: ${themeVars.color.purple.self};
|
||||
}
|
||||
/* 橙色标签 */
|
||||
&.orange {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.attention.emphasis};
|
||||
color: ${themeVars.color.yellow.self};
|
||||
}
|
||||
/* 黄色标签 */
|
||||
&.yellow {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.attention.emphasis};
|
||||
color: ${themeVars.color.orange.self};
|
||||
}
|
||||
/* 黄绿色标签 */
|
||||
&.olive {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.color.olive.self};
|
||||
color: ${themeVars.color.olive.self};
|
||||
}
|
||||
/* 绿色标签 */
|
||||
&.green {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.success.emphasis};
|
||||
color: ${themeVars.color.green.self};
|
||||
}
|
||||
/* 紫色标签 */
|
||||
&.purple {
|
||||
background-color: unset;
|
||||
border: 1px solid ${themeVars.github.borderColor.done.emphasis};
|
||||
color: ${themeVars.color.purple.self};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { animationDown } from "src/core/theme";
|
||||
import { animation, animationDown } from "src/core/theme";
|
||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||
|
||||
// 一些界面内的提示框, 比如克隆按钮, PR信息, Runner信息 等
|
||||
@@ -43,6 +43,7 @@ export const tippyBox = css`
|
||||
}
|
||||
// 专门用于提示信息的提示框, 比如提交的具体时间, 任务状态等
|
||||
&[data-theme="tooltip"] {
|
||||
${animation};
|
||||
.tippy-content {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
|
||||
Reference in New Issue
Block a user