v0.167.1: center the sidebar logo (margin: 0 auto)

.sidebar-logo was left-aligned; add auto side-margins so the 140px logo centers in
the header (desktop sidebar + mobile drawer share the element). Adds TestSidebarLogo_Centered.
This commit is contained in:
2026-07-24 13:57:48 +02:00
parent 59d182a6b9
commit d37bb1eb6a
3 changed files with 25 additions and 1 deletions
@@ -88,6 +88,24 @@ func TestMobileCSS_StripRemovedDrawerPresent(t *testing.T) {
}
}
// The sidebar logo is horizontally centered in its header (desktop sidebar + mobile drawer share
// the element). Red-proof: revert to `margin-bottom: 0.25rem` (no auto side-margins) → this FAILS.
func TestSidebarLogo_Centered(t *testing.T) {
data, err := StyleCSS()
if err != nil {
t.Fatalf("StyleCSS(): %v", err)
}
css := string(data)
i := strings.Index(css, ".sidebar-logo {")
if i < 0 {
t.Fatal(".sidebar-logo rule not found")
}
rule := css[i : i+strings.Index(css[i:], "}")]
if !strings.Contains(rule, "margin: 0 auto") {
t.Errorf(".sidebar-logo is not centered (no `margin: 0 auto`); rule was:\n%s", rule)
}
}
// Group A — drawer markup (Scenario A/C), asserted through the real layout render.
//
// Red-proof: remove aria-controls from the burger button in layout.html → the aria-controls