This commit is contained in:
2026-10-20 23:49:50 +08:00
parent e60f1b300a
commit 1c771066ea
7 changed files with 121 additions and 4 deletions
+8
View File
@@ -418,6 +418,14 @@
box-shadow: none;
}
/* Page/detail wrappers use their parent's inset; independent cards keep theirs. */
@media screen {
.admin-workbench.workbench-panel.is-page-surface:not(.admin-page),
.admin-workbench .workbench-panel.is-page-surface:not(.admin-page) {
padding: 0;
}
}
/* Main lists share one compact header. Nested tables and dialog density stay local. */
@media (min-width: 721px) {
.admin-workbench .workbench-table.is-page-surface > .data-table > .data-table__toolbar,
+30
View File
@@ -201,6 +201,36 @@ describe('Admin workbench opt-in styles', () => {
expect(declarationsFor(get('#card')).get('padding')).toBe('var(--workbench-card-space)')
})
it('removes the detail wrapper inset without flattening inner cards or changing page and print spacing', () => {
const get = fixture(`
<main id="page" class="admin-page admin-workbench">
<section id="detail" class="workbench-panel is-compact is-page-surface">
<article id="card" class="workbench-panel is-compact">
<section id="nested-detail" class="admin-workbench workbench-panel is-compact is-page-surface"></section>
</article>
<article id="regular-card" class="workbench-panel"></article>
</section>
</main>
<section id="own-root" class="admin-workbench workbench-panel is-compact is-page-surface"></section>
<main id="page-surface" class="admin-page admin-workbench workbench-panel is-compact is-page-surface"></main>
<section id="outside" class="workbench-panel is-compact is-page-surface"></section>
`)
for (const selector of ['#detail', '#nested-detail', '#own-root']) {
expect(declarationsFor(get(selector)).get('padding')).toBe('0')
}
for (const selector of ['#page', '#page-surface']) {
expect(declarationsFor(get(selector)).get('padding')).toBe('var(--workbench-page-padding)')
}
expect(declarationsFor(get('#card')).get('padding')).toBe('var(--workbench-compact-card-space)')
expect(declarationsFor(get('#regular-card')).get('padding')).toBe('var(--workbench-card-space)')
expect(declarationsFor(get('#outside')).has('padding')).toBe(false)
root(styles).walkRules(rule => {
if (!rule.selector.includes('.workbench-panel.is-page-surface:not(.admin-page)')) return
expect(rule.parent?.type === 'atrule' && rule.parent.name).toBe('media')
expect(rule.parent?.type === 'atrule' && rule.parent.params).toBe('screen')
})
})
it('compacts only main list headers and aligns their filters without fixing content height', () => {
const table = (id: string) => `
<div class="data-table data-table--integrated">