mirror of
				https://github.com/lutinglt/gitea-github-theme.git
				synced 2025-10-27 22:40:30 +00:00 
			
		
		
		
	Compare commits
	
		
			16 Commits
		
	
	
		
			v1.24.2.25
			...
			v1.24.2.25
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | f635b30c9c | ||
|   | 1434c54ba3 | ||
|   | b9b12e7ed2 | ||
|   | f9755704ec | ||
|   | 120d24cb10 | ||
|   | 77e2227029 | ||
|   | 75fd35480b | ||
|   | 0516b19982 | ||
|   | 5ac3a3044e | ||
|   | 9ccc65ac1c | ||
|   | 7921a8872b | ||
|   | 596442d2ef | ||
|   | 7248f617c4 | ||
|   | 6def81fe26 | ||
|   | fa08df8eea | ||
|   | cc44560f96 | 
							
								
								
									
										15
									
								
								.github/release.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								.github/release.md
									
									
									
									
										vendored
									
									
								
							| @@ -2,18 +2,11 @@ | ||||
|  | ||||
| #### 更符合 GitHub 风格 | ||||
|  | ||||
| - 导航栏右侧按钮和头像颜色和样式同步 | ||||
|  | ||||
| ## 🎈 Perf | ||||
|  | ||||
| - 优化输入框高度 | ||||
| - 优化二级菜单按钮高度 | ||||
| - 优化提交/分支/标签统计栏的激活颜色 | ||||
| - 优化提交中 Action 状态标签的位置 | ||||
| - 优化按钮和菜单下的图标颜色 | ||||
| - 优化仓库发布中的分支选择按钮样式 | ||||
| - 优化向上弹窗的菜单动画 | ||||
|  | ||||
| ## 🐞 Fix | ||||
|  | ||||
| - 修复多个标签组合的范围标签圆角 #4 | ||||
| - 修复探索/组织/用户页下的仓库主题标签样式 | ||||
| - 修复仓库标签页右侧按钮大小 | ||||
| - 修复管理员页面 Runner 任务状态标签的边框色 | ||||
| - 修复 Actions 页面下的分支标签按钮颜色 | ||||
							
								
								
									
										1
									
								
								.github/todo.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/todo.md
									
									
									
									
										vendored
									
									
								
							| @@ -1 +0,0 @@ | ||||
| action 下的分支标签颜色 | ||||
							
								
								
									
										19
									
								
								TODO.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								TODO.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| ### 轻量 | ||||
|  | ||||
| - hover 动画迁移 | ||||
| - 列表部分 item 展开动画迁移 | ||||
|  | ||||
| ### 重大 | ||||
|  | ||||
| - gitea issue 默认标签颜色匹配使用 github 样式 | ||||
| - 探索/组织/用户仓库样式 github 布局 | ||||
| - issue/PR 列表样式 github 布局 | ||||
| - styles/themes 库组件导出整理 | ||||
| - defineTheme 颜色生成代码重构 | ||||
| - 亮色主题适配/测试 | ||||
| - 自动颜色主题生成 | ||||
|  | ||||
| ### 其他 | ||||
|  | ||||
| - README 更新/截图更新 | ||||
| - CONTRIBUTING 更新 | ||||
| @@ -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"], | ||||
| @@ -60,8 +62,12 @@ export function createTheme(theme: Theme): void { | ||||
|     accentColor: themeVars.color.accent, | ||||
|     colorScheme: isDarkTheme ? "dark" : "light", | ||||
|   }); | ||||
|   globalKeyframes(overlayAppear, { | ||||
|   globalKeyframes(overlayAppearDown, { | ||||
|     "0%": { opacity: 0, transform: "translateY(-12px)" }, | ||||
|     "100%": { opacity: 1, transform: "translateY(0)" }, | ||||
|   }); | ||||
|   globalKeyframes(overlayAppearUp, { | ||||
|     "0%": { opacity: 0, transform: "translateY(12px)" }, | ||||
|     "100%": { opacity: 1, transform: "translateY(0)" }, | ||||
|   }); | ||||
| } | ||||
|   | ||||
| @@ -58,6 +58,7 @@ export const github = { | ||||
|        * @clone `clone` 克隆地址框被选中时的边框颜色 | ||||
|        * @issue `comment` 评论框被选中时的边框颜色 | ||||
|        * @menu `verticalMenu` 垂直菜单项激活时左侧的伪元素颜色 | ||||
|        * @dropdown `selectionDropdown` 选择输入框的内部边框颜色 | ||||
|        */ | ||||
|       emphasis: null, | ||||
|     }, | ||||
|   | ||||
| @@ -4,17 +4,21 @@ import { css, 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,36 @@ 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); | ||||
|           width: 332px; | ||||
|           &: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}; | ||||
|     } | ||||
|   | ||||
| @@ -45,17 +45,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}; | ||||
|               } | ||||
|   | ||||
| @@ -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}; | ||||
|       // 边框向内偏移 | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import "./diff"; | ||||
| import "./filelist"; | ||||
| import "./heatmap"; | ||||
| import "./issue"; | ||||
| import "./newrepo"; | ||||
| import "./release"; | ||||
| import "./repo"; | ||||
| import "./setting"; | ||||
|   | ||||
							
								
								
									
										14
									
								
								styles/components/newrepo.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								styles/components/newrepo.tsx
									
									
									
									
									
										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; | ||||
|         } | ||||
|       } | ||||
|       // 右侧发布详细信息 | ||||
|   | ||||
| @@ -6,9 +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; | ||||
|   | ||||
| @@ -19,7 +19,9 @@ export const baseButton = css` | ||||
|     font-weight: 500; | ||||
|     padding: 9px 16px; | ||||
|   } | ||||
|  | ||||
|   .ui.button:not(.primary):not(.red) svg { | ||||
|     color: ${themeVars.color.text.light.num1}; | ||||
|   } | ||||
|   .ui.primary.button { | ||||
|     ${primaryStyle} | ||||
|     &:hover { | ||||
| @@ -76,14 +78,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, | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { animation } from "src/core/theme"; | ||||
| import { animationDown, animationUp } from "src/core/theme"; | ||||
| import { css, otherThemeVars, themeVars } from "src/types/vars"; | ||||
| import { activeItemAfterStyle } from "styles/public/menu"; | ||||
|  | ||||
| @@ -6,9 +6,8 @@ export const dropdown = css` | ||||
|   .ui.dropdown, | ||||
|   .ui.menu .ui.dropdown { | ||||
|     .menu { | ||||
|       animation: ${animation}; | ||||
|       animation: ${animationDown}; | ||||
|       // 统一所有下拉菜单的样式 | ||||
|       margin-top: 0.35em !important; | ||||
|       background-color: ${themeVars.color.menu} !important; | ||||
|       border: unset !important; | ||||
|       border-radius: 12px !important; | ||||
| @@ -39,7 +38,6 @@ export const dropdown = css` | ||||
|           } | ||||
|         } | ||||
|         svg { | ||||
|           color: ${themeVars.color.text.light.num1}; | ||||
|           margin-right: 0.5rem; | ||||
|         } | ||||
|         &.active, | ||||
| @@ -58,6 +56,21 @@ export const dropdown = css` | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   // 向下弹出的下拉菜单向下偏移 | ||||
|   .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, | ||||
| @@ -75,7 +88,10 @@ export const dropdown = css` | ||||
|   .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; | ||||
|   } | ||||
| @@ -83,8 +99,9 @@ export const dropdown = css` | ||||
|  | ||||
| // 选择框的下拉菜单看起来像普通按钮 | ||||
| export const selectionDropdown = css` | ||||
|   .ui.selection.dropdown, | ||||
|   .ui.selection.dropdown.active { | ||||
|   // 排除可以选择的输入搜索框和创建仓库的拥有者 | ||||
|   .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}; | ||||
| @@ -104,9 +121,43 @@ export const selectionDropdown = css` | ||||
|       ${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; | ||||
|   } | ||||
|   // 修复选择框的下拉菜单向上显示时的样式问题 | ||||
|   .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; | ||||
|   } | ||||
| `; | ||||
|   | ||||
| @@ -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"], | ||||
| @@ -33,4 +34,8 @@ export const input = css` | ||||
|   .ui.input { | ||||
|     height: 32px; | ||||
|   } | ||||
|   // 由于输入框高度, 需要输入框在表单中垂直居中 | ||||
|   .ui.form { | ||||
|     align-items: center; | ||||
|   } | ||||
| `; | ||||
|   | ||||
| @@ -101,21 +101,33 @@ 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; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| `; | ||||
|   | ||||
| @@ -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, | ||||
| @@ -168,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; | ||||
|       } | ||||
|     } | ||||
|   | ||||
| @@ -40,6 +40,9 @@ export const navbarRight = css` | ||||
|               height: 16px; | ||||
|             } | ||||
|           } | ||||
|           &:hover { | ||||
|             background-color: ${themeVars.color.nav.hoverBg}; | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|       .item.ui.dropdown { | ||||
|   | ||||
| @@ -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}; | ||||
|   | ||||
| @@ -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"] { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user