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:
@@ -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
|
||||
|
||||
@@ -92,7 +92,7 @@ body {
|
||||
width: 140px;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin-bottom: 0.25rem;
|
||||
margin: 0 auto 0.25rem;
|
||||
}
|
||||
.login-logo {
|
||||
width: 200px;
|
||||
|
||||
Reference in New Issue
Block a user