Skip to content

Commit 186a999

Browse files
csharpfritzCopilot
andcommitted
fix(samples): Align global footer with sidebar
The global footer in App.razor was spanning full width and appearing behind the fixed-position sidebar. Added inline styles in head to ensure the footer respects sidebar width with responsive handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2b46e0a commit 186a999

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

samples/AfterBlazorServerSide/Components/App.razor

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@
1010
<link rel="stylesheet" href="css/brand-colors.css" />
1111
<link rel="stylesheet" href="css/site.css" />
1212
<link rel="stylesheet" href="css/search.css" />
13+
<style>
14+
/* Global footer - inline to avoid CSS caching issues */
15+
.global-footer {
16+
background-color: #f0f0f5;
17+
border-top: 1px solid #ddd;
18+
padding: 0.75rem 1.5rem;
19+
font-size: 0.8rem;
20+
text-align: center;
21+
color: #666;
22+
margin-left: var(--sidebar-width, 280px);
23+
transition: margin-left 0.3s ease-in-out;
24+
}
25+
.global-footer a { color: #512BD4; }
26+
.global-footer a:hover { color: #0d6efd; }
27+
@@media (max-width: 991.98px) {
28+
.global-footer { margin-left: 0; }
29+
}
30+
</style>
1331
<HeadOutlet @rendermode="InteractiveServer" />
1432
</head>
1533

@@ -22,7 +40,7 @@
2240
<a class="dismiss">🗙</a>
2341
</div>
2442

25-
<footer>
43+
<footer class="global-footer">
2644
This site was built with ♥♥ and <a href="https://blazor.net">Blazor</a>, <a href="https://dot.net">Open Source C#</a>, <a href="https://www.asp.net">ASP.NET 10.0</a>, and the <a target="_blank" href="https://github.com/FritzAndFriends/BlazorWebFormsComponents/">BlazorWebFormsComponents</a>
2745
<br />
2846
<strong>BlazorWebFormsComponents @($"v{Program.ComponentVersion}")</strong>

samples/AfterBlazorServerSide/wwwroot/css/site.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,26 @@ a.component-link.active {
204204
color: var(--webforms-blue);
205205
}
206206

207+
/* Global footer in App.razor - must respect sidebar */
208+
.global-footer {
209+
background-color: #f0f0f5;
210+
border-top: 1px solid #ddd;
211+
padding: 0.75rem 1.5rem;
212+
font-size: 0.8rem;
213+
text-align: center;
214+
color: #666;
215+
margin-left: var(--sidebar-width);
216+
transition: margin-left 0.3s ease-in-out;
217+
}
218+
219+
.global-footer a {
220+
color: var(--blazor-purple);
221+
}
222+
223+
.global-footer a:hover {
224+
color: var(--webforms-blue);
225+
}
226+
207227
/* ========================================
208228
Vertical Nav (component list)
209229
======================================== */
@@ -265,6 +285,14 @@ a.component-link.active {
265285
margin-left: 0;
266286
}
267287

288+
body > footer {
289+
margin-left: 0;
290+
}
291+
292+
.global-footer {
293+
margin-left: 0;
294+
}
295+
268296
.navbar .brand-text {
269297
font-size: 0.95rem;
270298
}

0 commit comments

Comments
 (0)