From f08c7a0c8c31e7651220433d6f544727d7285d73 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Sun, 7 Sep 2025 23:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=A5=97=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=8F=8C?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=88=87=E6=8D=A2=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 1 + styles/components/dashboard.ts | 5 ++-- styles/components/notification.ts | 42 -------------------------- styles/public/dropdown.ts | 8 +++++ styles/public/menu.ts | 50 +++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 44 deletions(-) diff --git a/.github/release.md b/.github/release.md index 177902b..dfe2137 100644 --- a/.github/release.md +++ b/.github/release.md @@ -38,6 +38,7 @@ - 取消修改编辑器字体大小, 避免光标错位 - 修复文件预览时文件树右边框过粗 - 修复提交列表尾行圆角 +- 修复 wiki 页面和组织页面的用户下拉菜单的圆角问题 ## 📃 English (From AI) diff --git a/styles/components/dashboard.ts b/styles/components/dashboard.ts index 2454fde..15d7691 100644 --- a/styles/components/dashboard.ts +++ b/styles/components/dashboard.ts @@ -22,8 +22,9 @@ export const dashboard = css` display: none; } &:not(.active) { - margin: 4px !important; - width: calc(50% - 8px); + border-radius: ${otherThemeVars.border.radius}; + margin: 6px !important; + width: calc(50% - 12px); &:hover { background: ${themeVars.github.control.transparent.bgColor.hover}; } diff --git a/styles/components/notification.ts b/styles/components/notification.ts index 5bc6096..70abdbf 100644 --- a/styles/components/notification.ts +++ b/styles/components/notification.ts @@ -4,48 +4,6 @@ import { css, otherThemeVars, themeVars } from "src/types/vars"; export const notification = css` .page-content.user.notification { > .ui.container { - // 应只选中订阅/关注页面, 不能选中通知页面 - &:has(.flex-list) { - // 订阅/关注切换菜单 - .ui.compact.small.menu.small-menu-items { - background: ${themeVars.color.hover.self} !important; - border: 0; - font-size: 14px; - gap: 8px; - > .item { - background: unset !important; - border: 1px solid ${themeVars.color.hover.self}; - border-radius: ${otherThemeVars.border.radius}; - padding: 6px 12px !important; - &.active { - background: ${themeVars.color.menu} !important; - border-color: ${themeVars.color.light.border}; - font-weight: 600; - } - &::before { - display: none; - } - &:not(.active) { - // padding 纵向数值 + top 数值 = 8px 就居中 - // 不明白啥原理, 反正 height 设为 100% 就可以了 - top: 4px; - padding: 4px 12px !important; - height: 100%; - // 该方案只适用于 2 个 item 的情况 - // left / right 数值为 gap 数值的一半 - &:first-child { - left: 4px; - } - &:last-child { - right: 4px; - } - &:hover { - background: ${themeVars.github.control.transparent.bgColor.hover} !important; - } - } - } - } - } > .ui.attached.segment { border: 0; padding: 0; diff --git a/styles/public/dropdown.ts b/styles/public/dropdown.ts index 0bca1ff..afe1f49 100644 --- a/styles/public/dropdown.ts +++ b/styles/public/dropdown.ts @@ -78,6 +78,14 @@ export const dropdown = css` margin-bottom: 4px !important; } } + // 修复 wiki 的页面下拉菜单圆角 + .ui.floating.dropdown > .menu { + border-radius: 12px !important; + } + // 修复嵌套菜单的圆角问题, wiki 页面和组织页面的用户下拉菜单 + .ui.dropdown .menu .scrolling.menu { + border-radius: 0 0 12px 12px !important; + } // 修复下拉菜单元素溢出问题 // 用户菜单 .user-menu>.item, diff --git a/styles/public/menu.ts b/styles/public/menu.ts index 16c6002..1231760 100644 --- a/styles/public/menu.ts +++ b/styles/public/menu.ts @@ -236,3 +236,53 @@ export const paginationMenu = css` } } `; + +// 单行双选项菜单 +export const smallCompactMenu = css` + // 订阅/关注切换菜单(应只选中订阅/关注页面, 不能选中通知页面) + .page-content.user.notification > .ui.container:has(.flex-list), + // 里程碑/标签切换菜单(里程碑页) + .page-content.repository.milestones .list-header, + // 里程碑/标签切换菜单(标签页) + .page-content.repository.labels .issue-navbar { + .ui.compact.small.menu.small-menu-items { + background: ${themeVars.color.hover.self} !important; + border: 0; + font-size: 14px; + gap: 8px; + height: 32px; + min-height: 32px !important; + > .item { + background: unset !important; + border: 1px solid ${themeVars.color.hover.self}; + border-radius: ${otherThemeVars.border.radius}; + padding: 6px 12px !important; + &.active { + background: ${themeVars.color.menu} !important; + border-color: ${themeVars.color.light.border}; + font-weight: 600; + } + &::before { + display: none; + } + &:not(.active) { + top: 4px; + padding: 4px 12px !important; + height: calc(100% - 8px); + position: relative; + // 该方案只适用于 2 个 item 的情况 + // left / right 数值为 gap 数值的一半 + &:first-child { + left: 4px; + } + &:last-child { + right: 4px; + } + &:hover { + background: ${themeVars.github.control.transparent.bgColor.hover} !important; + } + } + } + } + } +`;