Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,25 @@
</header>
}

<main style="@Styles?.Main" class="bit-lyt-man @Classes?.Main">
<main style="@(ReverseNavPanel ? "flex-direction:row-reverse;" : "") @Styles?.Main" class="bit-lyt-man @Classes?.Main">
@if (showNavPanel)
{
<div style="@Styles?.NavPanel" class="bit-lyt-nmn @Classes?.NavPanel">
@NavPanel
</div>
}

<div style="@($"{(showNavPanel ? $"width:calc(100% - {NavPanelWidth}px);" : "")};{Styles?.MainContent}".Trim(';'))" class="bit-lyt-mcn @Classes?.MainContent">
<div style="@($"{(showNavPanel ? FormattableString.Invariant($"width:calc(100% - {NavPanelWidth}px);") : "")}") @Styles?.MainContent"
class="bit-lyt-mcn @Classes?.MainContent">
@Main
</div>
</main>

@if (Footer is not null)
{
<footer style="@Styles?.Footer" class="bit-lyt-ftr @Classes?.Footer">
<footer style="@Styles?.Footer" class="bit-lyt-ftr @Classes?.Footer">
@Footer
</footer>
</footer>
}
</CascadingValue>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public partial class BitLayout : BitComponentBase
/// </summary>
[Parameter] public int NavPanelWidth { get; set; }

/// <summary>
/// Reverses the position of the nav panel inside the main container.
/// </summary>
[Parameter] public bool ReverseNavPanel { get; set; }

/// <summary>
/// Enables sticky positioning of the footer at the bottom of the viewport.
/// </summary>
Expand All @@ -61,16 +66,16 @@ public partial class BitLayout : BitComponentBase

protected override string RootElementClass => "bit-lyt";

protected override void RegisterCssStyles()
{
StyleBuilder.Register(() => Styles?.Root);
}

protected override void RegisterCssClasses()
{
ClassBuilder.Register(() => Classes?.Root);

ClassBuilder.Register(() => StickyHeader ? "bit-lyt-shd" : string.Empty);
ClassBuilder.Register(() => StickyFooter ? "bit-lyt-sft" : string.Empty);
}

protected override void RegisterCssStyles()
{
StyleBuilder.Register(() => Styles?.Root);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public partial class BitLayoutDemo
Description = "The width of the nav panel section in px.",
},
new()
{
Name = "ReverseNavPanel",
Type = "bool",
DefaultValue = "false",
Description = "Reverses the position of the nav panel inside the main container.",
},
new()
{
Name = "Styles",
Type = "BitLayoutClassStyles?",
Expand Down
Loading