From 7248f617c4dbf0a7923871a38d0ebc34922e18e6 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Mon, 7 Jul 2025 20:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=89=E6=8B=A9=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E7=9A=84=E6=A0=B7=E5=BC=8F=E5=92=8C=E6=8B=A5?= =?UTF-8?q?=E6=9C=89=E8=80=85=E6=8C=89=E9=92=AE=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 4 +++- src/types/color/github.ts | 1 + styles/public/dropdown.tsx | 24 ++++++++++++++++++++++-- styles/public/input.tsx | 3 ++- styles/public/radius.tsx | 3 ++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/release.md b/.github/release.md index d3de4d4..c7eb47e 100644 --- a/.github/release.md +++ b/.github/release.md @@ -6,4 +6,6 @@ ## 🐞 Fix -- 修复顶部导航栏的菜单按钮悬浮颜色 \ No newline at end of file +- 修复顶部导航栏的菜单按钮悬浮颜色 +- 修复选择输入框的样式和选中时的背景色 +- 修复创建仓库时拥有者按钮的高度 \ No newline at end of file diff --git a/src/types/color/github.ts b/src/types/color/github.ts index 24b1adb..904dc2c 100644 --- a/src/types/color/github.ts +++ b/src/types/color/github.ts @@ -58,6 +58,7 @@ export const github = { * @clone `clone` 克隆地址框被选中时的边框颜色 * @issue `comment` 评论框被选中时的边框颜色 * @menu `verticalMenu` 垂直菜单项激活时左侧的伪元素颜色 + * @dropdown `selectionDropdown` 选择输入框的内部边框颜色 */ emphasis: null, }, diff --git a/styles/public/dropdown.tsx b/styles/public/dropdown.tsx index 33d20a6..3b54d21 100644 --- a/styles/public/dropdown.tsx +++ b/styles/public/dropdown.tsx @@ -83,8 +83,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,6 +105,25 @@ 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}; + } + } + // 选择输入框效果和输入框效果一样, 但不修改背景色 + .ui.selection.dropdown.active.search { + // 向内部添加一个 1px 的边框 + box-shadow: inset 0 0 0 1px ${themeVars.github.borderColor.accent.emphasis}; + outline: none; + } // 排除一些小按钮, 例如软件包类型, 通常相邻有元素 .ui.selection.dropdown.active:not(.small) { border-bottom-left-radius: ${otherThemeVars.border.radius} !important; diff --git a/styles/public/input.tsx b/styles/public/input.tsx index 85d1453..cdca046 100644 --- a/styles/public/input.tsx +++ b/styles/public/input.tsx @@ -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"], diff --git a/styles/public/radius.tsx b/styles/public/radius.tsx index f5141de..06e90fe 100644 --- a/styles/public/radius.tsx +++ b/styles/public/radius.tsx @@ -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};