fix(web): 计数角标改回悬挂在标题右上角,搜索框圆角恢复 12px

- 角标:绝对定位 top -8 / right -18、16 高、8 圆角、12/700、危险色阴影(原来跟在标题后面占行内空间)
- 标题前色条补 8px 右间距,标题起点与旧版一致
- 搜索框:圆角 6 → 12(旧版 card-box 的圆角)
This commit is contained in:
stash
2026-10-29 10:23:09 +08:00
parent de1af92ee5
commit 2724d6f3ff
2 changed files with 39 additions and 8 deletions
+30 -1
View File
@@ -94,6 +94,7 @@
.search-row > *:first-child,
.search-row > *:first-child:focus-within {
border-color: var(--su-border);
border-radius: var(--su-radius-md);
box-shadow: var(--su-shadow-card);
}
@@ -216,6 +217,32 @@
margin-bottom: var(--su-space-4);
}
.section-title-wrapper {
display: flex;
align-items: center;
}
/* 角标是挂在标题右上角的绝对定位元素(旧版行为),不占行内宽度 */
.section-title-box {
position: relative;
display: inline-flex;
align-items: center;
}
.count-badge {
position: absolute;
top: -8px;
right: -18px;
height: 16px;
min-width: 16px;
padding: 0 4px;
border-radius: 8px;
box-shadow: 0 1px 3px color-mix(in srgb, var(--su-color-danger) 30%, transparent);
font-size: 12px;
font-weight: var(--su-font-weight-strong);
line-height: 1;
}
/* 旧版分区标题是 16/1.2,更多按钮是 24px 小方按钮 */
.section-header h2 {
line-height: 1.2;
@@ -229,7 +256,9 @@
.section-bar {
width: 4px;
height: 16px;
border-radius: var(--su-radius-pill);
margin-right: var(--su-space-2);
border-radius: 2px;
background-color: var(--su-color-primary);
}
/* ---------- 应用条目 ---------- */
@@ -1,4 +1,4 @@
import { Badge, Card, Icon, IconButton, Space, Title } from '@stash/ui'
import { Badge, Card, Icon, IconButton, Title } from '@stash/ui'
import type { ReactNode } from 'react'
/**
@@ -19,13 +19,15 @@ export function SectionCard({ title, count, barColor, onMore, children }: Sectio
return (
<Card padding="md" className="section-card">
<div className="section-header">
<Space gap="sm">
<span className="section-title-wrapper">
<span className="section-bar" style={{ backgroundColor: barColor }} aria-hidden="true" />
<span className="section-title-box">
<Title level={3} as="h2" weight="semibold">
{title}
</Title>
<Badge count={count} tone="danger" />
</Space>
<Badge count={count} tone="danger" className="count-badge" />
</span>
</span>
{onMore !== undefined && (
<IconButton