fix(single): align cover breadcrumb with the article title

With a featured image the breadcrumb sits under the title inside the cover
overlay, but its first icon started 6px left of the title's left edge.

The overlay rule carried an extra `padding: 0` that this theme added on top of
the reference. The same node also matches `ul.breadcrumb { padding: 0 }`
(0,1,1 specificity), which outranks the base `.breadcrumb { padding: 0 8px }`
(0,1,0) — so the reference's `margin-left: -6px` nudge was applied with no
inset to compensate, pulling the whole row 6px to the left.

Writing the inset back as `padding: 0 8px` on the overlay rule restores the
reference geometry: -6px + 8px nets +2px from the panel edge. The global
`ul.breadcrumb` reset and the video footer variant are untouched, so archive
and video breadcrumbs keep their current padding.

Tests: new case in the single-cover contract suite pins the 8px inset (and the
global reset); cover suite 12/12, widget suite 829/830 with the pre-existing
frontend-lifecycle failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-03 16:48:38 +08:00
1 parent 93e83e1835
commit f14e6bd88d
4 files changed
+26 -7

No files matched your search

@@ -230,3 +230,18 @@ test('dead cover css is removed from every stylesheet surface', () => {
'misc.js 的 initSlideCovers(无标记生产方)已删除'
);
});
test('cover overlay breadcrumb keeps the 8px inset so it aligns with the title', () => {
const breadcrumbCss = read('assets/css/frontend/breadcrumb.css');
// 同一节点同时命中 ul.breadcrumb{padding:0}(0,1,1)与 .breadcrumb{padding:0 8px}
// (0,1,0):守卫重置的优先级更高,封面层必须显式写回内边距。
const coverRule = breadcrumbCss.match(/\.single-cover-con \.breadcrumb,[\s\S]*?\n\}/);
assert.ok(coverRule, '封面面包屑规则缺失');
assert.match(coverRule[0], /padding: 0 8px;/, '封面面包屑需保留 8px 内边距,否则首项图标比标题左移 6px');
assert.match(coverRule[0], /margin: 5px 0 0 -6px;/, '参考主题的 -6px 左拉保持不变');
assert.doesNotMatch(coverRule[0], /padding: 0;/, '不得把内边距清零');
// 列表守卫仍是全局重置,归档页 nav 内边距不受影响。
assert.match(breadcrumbCss, /ul\.breadcrumb,[\s\S]{0,120}padding: 0;/, 'ul.breadcrumb 全局重置保持不变');
});