feat(theme): P0 L1 组件密度与层次打磨(列表/按钮/主子表弹窗)
数据驱动的 amis 主题打磨,全程覆盖 amis 自身 CSS 变量/定向规则,
零 SDK 重建、单独成块可回退。amis-theme.css 新增三节:
§10 列表(M1,占60%): 行高 45→38px、表头 14/400→12.5/600 加层次、
行 hover 品牌淡底、选中行(.is-checked)品牌淡底+左色条。
覆盖 --TableCell-paddingY/--Table-fontSize/--Table-thead-*。
(修正:原 §5 .cxd-Table-content 是对不上本 SDK 的死选择器)
§11 表单/按钮: --Form-item-gap 24→16px;default 按钮灰底→白底描边、
danger 红字红边、primary 保持蓝、hover 品牌色(启用态)。
§12 内容多的主子表弹窗: input-table 行 47→41px(padding 7→4);
.cxd-Modal-content 封顶 90vh+flex 列、body 内部滚动(操作条常驻);
子表表头 sticky。简单弹窗无回归(实测用户新增弹窗正常)。
实测验证(playwright,admin/111111): 列表/新闻/采购申请主子表/树 多页型零回归。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -314,3 +314,126 @@
|
||||
.amis-scope .eip4-treegrid-tree.cxd-Tree {
|
||||
max-height: calc(100vh - 230px);
|
||||
}
|
||||
|
||||
/* ============================================================================
|
||||
10. P0 · L1 列表密度与表头打磨 — 2026-06-15(基于真实 DOM 实测校准)
|
||||
实测本 SDK 列表:amis 全用 CSS 变量驱动单元格——
|
||||
padding=var(--TableCell-paddingY/X)、字号=var(--Table-fontSize)、
|
||||
表头=var(--Table-thead-fontSize/color)、字重=var(--fontWeightNormal)。
|
||||
实测行高 45px、表头 14px/400 与正文无层次、hover/选中无视觉反馈。
|
||||
故此处覆盖 amis 自身变量(最稳,无特异性之争;同本文件覆盖 --colors-* 路子),
|
||||
统一全站列表(M1,占 60%)密度基调。第 5 节 `.cxd-Table-content .cxd-Table td`
|
||||
在本 SDK 不匹配(死选择器),保留无害。
|
||||
============================================================================ */
|
||||
|
||||
/* 10a. 覆盖 amis 表格密度/表头设计变量 */
|
||||
:root,
|
||||
.amis-scope .AMISCSSWrapper {
|
||||
--TableCell-paddingY: 7px; /* 行密度:默认 calc(~11px) → 7px,行高 45→~38px */
|
||||
--Table-fontSize: 13px; /* 正文 12 → 13,密而可读 */
|
||||
--Table-thead-fontSize: 12.5px; /* 表头小一号 */
|
||||
--Table-thead-color: #555c66; /* 表头中性色 = --text-2 */
|
||||
}
|
||||
[data-dark="1"] :root,
|
||||
[data-dark="1"],
|
||||
[data-dark="1"] .amis-scope .AMISCSSWrapper {
|
||||
--Table-thead-color: #a3aab5;
|
||||
}
|
||||
|
||||
/* 10b. 表头字重/字距:amis 用 var(--fontWeightNormal),此处定向加粗(匹配 amis 选择器特异性) */
|
||||
.amis-scope .cxd-Table-table > thead > tr > th {
|
||||
font-weight: 600;
|
||||
letter-spacing: .02em;
|
||||
}
|
||||
|
||||
/* 10c. 行 hover:当前无反馈 → 品牌淡底,强化"指到哪一行" */
|
||||
.amis-scope .cxd-Table-table > tbody > tr:hover > td {
|
||||
background-color: color-mix(in srgb, #2B5CE6, transparent 95%);
|
||||
}
|
||||
|
||||
/* 10d. 行选中(勾选):当前 SDK 无选中样式 → 品牌淡底 + 左侧色条,强化痛点②选中可见性 */
|
||||
.amis-scope .cxd-Table-table > tbody > tr.is-checked > td {
|
||||
background-color: color-mix(in srgb, #2B5CE6, transparent 90%);
|
||||
}
|
||||
.amis-scope .cxd-Table-table > tbody > tr.is-checked > td:first-child {
|
||||
box-shadow: inset 3px 0 0 #2B5CE6;
|
||||
}
|
||||
|
||||
/* ============================================================================
|
||||
11. P0 · L1 按钮层次 + 表单密度 — 2026-06-15(基于真实 DOM 实测校准)
|
||||
实测:工具栏 10+ 个 default 按钮全是同一灰底 #f6f7f9(糊成"灰墙"、删除的
|
||||
破坏性也看不出);表单行距 --Form-item-gap=24px(偏松,内容多的弹窗易溢出)。
|
||||
============================================================================ */
|
||||
|
||||
/* 11a. 表单密度:行距 24px → 16px,弹窗/表单容纳更多、不挤(全局 amis 变量) */
|
||||
:root,
|
||||
.amis-scope .AMISCSSWrapper {
|
||||
--Form-item-gap: 16px;
|
||||
}
|
||||
|
||||
/* 11b. 默认按钮:灰底 → 白底 + 描边(更轻、更现代,似壳层 .btn),hover 品牌色 */
|
||||
.amis-scope .cxd-Button--default {
|
||||
background: #ffffff;
|
||||
border-color: #cdd2d9; /* --line-strong */
|
||||
color: #555c66; /* --text-2 */
|
||||
}
|
||||
.amis-scope .cxd-Button--default:hover {
|
||||
background: #ffffff;
|
||||
border-color: #2B5CE6;
|
||||
color: #2B5CE6;
|
||||
}
|
||||
[data-dark="1"] .amis-scope .cxd-Button--default {
|
||||
background: transparent;
|
||||
border-color: #424b59;
|
||||
color: #a3aab5;
|
||||
}
|
||||
|
||||
/* 11c. 危险按钮(删除):红字 + 红描边,hover 红底,明确"破坏性"语义 */
|
||||
.amis-scope .cxd-Button--danger {
|
||||
background: #ffffff;
|
||||
border-color: color-mix(in srgb, #d1453b, transparent 55%);
|
||||
color: #d1453b;
|
||||
}
|
||||
.amis-scope .cxd-Button--danger:hover {
|
||||
background: #fbe9e7; /* --err-soft */
|
||||
border-color: #d1453b;
|
||||
color: #d1453b;
|
||||
}
|
||||
|
||||
/* ============================================================================
|
||||
12. P0 · L1 内容多的主子表弹窗 — 2026-06-15(基于真实 13 行子表实测校准)
|
||||
实测三因:①子表行 47px(列为可编辑控件,32px input+padding 撑高)
|
||||
②弹窗 1034px > 视口(操作条够不到) ③子表表头非 sticky(滚动列头消失)。
|
||||
三项均 L1/L2 解决,不碰 SDK。
|
||||
============================================================================ */
|
||||
|
||||
/* 12a. 子表行密度:控件 32→28px + 单元格 padding 7→4px → 行高 ~47→~37px */
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table > tbody > tr > td {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table .cxd-TextControl-input,
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table .cxd-Select,
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table .cxd-Number,
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table .cxd-Form-control {
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
/* 12b. 弹窗高度封顶到视口 + body 内部滚动(操作条/底部按钮常驻可达) */
|
||||
.amis-scope .cxd-Modal-content {
|
||||
max-height: 90vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.amis-scope .cxd-Modal-content > .cxd-Modal-body {
|
||||
overflow-y: auto;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* 12c. 子表表头 sticky:随 body 滚动钉在顶部,列头不丢 */
|
||||
.amis-scope .cxd-InputTable .cxd-Table-table > thead > tr > th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user