style: 将主体列表悬停底色改为固定斑马纹

This commit is contained in:
GouJ
2026-09-02 11:00:11 +08:00
parent 924ccc4b48
commit 12f5fc74ae
3 changed files with 12 additions and 15 deletions
+8 -6
View File
@@ -140,7 +140,7 @@ async function selectTab(label: string) {
}
describe('拆解页内容滚动', () => {
it.each(['人物', '场景', '道具'])('%s 使用共用斑马纹悬停样式,搜索后保持列表条目结构', async label => {
it.each(['人物', '场景', '道具'])('%s 使用共用固定斑马纹样式,搜索后保持列表条目结构', async label => {
mountPage()
await selectTab(label)
const list = wrapper!.get('.subject-record-list')
@@ -178,16 +178,18 @@ describe('拆解页内容滚动', () => {
expect(css + readFileSync('src/styles.css', 'utf8')).not.toContain('.search-field')
})
it('只为主体斑马纹空白行添加主题化悬停底色,不覆盖已有条纹和操作状态', () => {
// DOM 环境无法模拟浏览器 :hover 命中;此项检查状态选择器与主题变量契约。
it('主体奇数行常驻原悬停底色,偶数行不变,整行不再随鼠标或焦点变色', () => {
// DOM 环境无法模拟浏览器 :hover 命中;检查静态底色与无整行交互选择器的契约。
const css = readFileSync('src/styles.css', 'utf8')
expect(css).toMatch(/\.record-list > article:nth-child\(even\)\s*\{\s*background:\s*var\(--app-subtle\);/)
expect(css).toMatch(
/@media \(hover: hover\)\s*\{\s*\.subject-record-list > article:nth-child\(odd\):hover\s*\{\s*background:\s*var\(--app-control\);/
/\.subject-record-list > article:nth-child\(odd\)\s*\{\s*background:\s*var\(--app-control\);/
)
expect(css).toMatch(
/\.subject-record-list > article:nth-child\(odd\):focus-within\s*\{\s*background:\s*var\(--app-control\);/
expect(css + readFileSync('src/admin.css', 'utf8')).not.toMatch(
/\.subject-record-list[^{}]*(?::hover|:focus-within)/
)
// 仅移除整行变色,不影响内部链接、折叠等控件的键盘焦点提示。
expect(css).toMatch(/:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--color-accent\);/)
})
it('分镜选择与计数、入口同排,默认显示实际剧集,切换后内容和统计同步', async () => {