Skip to content

Commit 79cfa1b

Browse files
committed
Layout updates
1 parent 09b61fb commit 79cfa1b

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@namespace BlazorBootstrap.Demo.RCL
22
@inherits MainLayoutBase
33

4-
<BlazorBootstrapLayout>
4+
<BlazorBootstrapLayout HeaderSectionSticky="true">
55
<HeaderSection>
66
<div>
77
<a class="nav-link py-2 px-2" href="@githubUrl" target="_blank" rel="noopener">

blazorbootstrap/Components/Layout/BlazorBootstrapLayout.razor.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@ public partial class BlazorBootstrapLayout : BlazorBootstrapLayoutComponentBase
1313
[Parameter] public RenderFragment? FooterSection { get; set; }
1414
[Parameter] public string? FooterSectionCssClass { get; set; } = "bg-body-tertiary";
1515
protected string? FooterSectionCssClassNames => BuildClassNames(FooterSectionCssClass, ("bb-footer p-4", true));
16-
16+
1717
[Parameter] public RenderFragment? HeaderSection { get; set; }
1818
[Parameter] public string? HeaderSectionCssClass { get; set; } = "d-flex justify-content-end";
19-
protected string? HeaderSectionCssClassNames => BuildClassNames(HeaderSectionCssClass, ("bb-top-row px-4", true));
19+
20+
protected string? HeaderSectionCssClassNames =>
21+
BuildClassNames(
22+
HeaderSectionCssClass,
23+
("bb-top-row", true),
24+
("bb-top-row-sticky", HeaderSectionSticky),
25+
("px-4", true)
26+
);
27+
28+
[Parameter] public bool HeaderSectionSticky { get; set; }
2029

2130
[Parameter] public RenderFragment? SidebarSection { get; set; }
2231

blazorbootstrap/wwwroot/blazor.bootstrap.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ table > tbody > tr > td:is(.freeze-column-right).freeze-column-active {
458458
flex-direction: row !important;
459459
}
460460

461-
.bb-top-row {
461+
.bb-top-row-sticky {
462462
position: sticky;
463463
top: 0;
464464
z-index: 1;

0 commit comments

Comments
 (0)