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 @@ -3,24 +3,33 @@
@layout MainLayout
@inject NavigationManager Nav

<MudLayout>
<MudDrawer Open="true" Elevation="1" Class="pa-2" Style="width:260px; background: transparent">
<DocsSidebar />
</MudDrawer>
<div class="docs-shell">

<MudMainContent Class="docs-main">
<aside class="docs-sidebar-column">
<div class="docs-sticky">
<DocsSidebar />
</div>
</aside>

<main class="docs-main-column">
@Body
</MudMainContent>
</main>

<aside class="docs-toc-column">
@if (!IsDocsLandingPage)
{
<div class="docs-sticky">
<DocsToc />
<MudPageContentNavigation SectionClassSelector="mud-scrollspy-section" />
</div>
}
</aside>

@if (!IsDocsLandingPage)
{
<MudDrawer Open="true" Elevation="0" Class="pa-2 docs-toc-container" Style="width:260px; background: transparent" Anchor="Anchor.End">
<DocsToc />
<MudPageContentNavigation SectionClassSelector="mud-scrollspy-section" />
</MudDrawer>
}
</MudLayout>
</div>

@code {
private bool IsDocsLandingPage => Nav.ToBaseRelativePath(Nav.Uri).Trim('/').Equals("docs", StringComparison.OrdinalIgnoreCase);
private bool IsDocsLandingPage =>
Nav.ToBaseRelativePath(Nav.Uri)
.Trim('/')
.Equals("docs", StringComparison.OrdinalIgnoreCase);
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ else if (_doc is not null)
private PersistingComponentStateSubscription _subscription;
private DocPage? _doc;
private bool _notFound;
private string? _highlightedHtml;
private ElementReference _contentRef;

protected override void OnInitialized()
Expand Down Expand Up @@ -127,10 +128,12 @@ else if (_doc is not null)

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JS.InvokeVoidAsync("highlightDocsCode");
}
if (_doc is null || _doc.Html == _highlightedHtml)
return;

await JS.InvokeVoidAsync("highlightDocsCode");

_highlightedHtml = _doc.Html;
}

private Task PersistDocAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
@implements IDisposable
@inject PersistentComponentState PersistentState

<div style="min-height: 20vh; max-height: 90vh; overflow-y: auto;">
<div class="ua-docs-sidebar">
@if (!Inline)
{
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="ua-docs-header">
<div class="ua-docs-brand">
<MudText Typo="Typo.subtitle1">UltimateAuth</MudText>
<span>DOCUMENTATION</span>
</div>
@* <MudText Typo="Typo.h6" Class="mb-2 px-2">UAuth Docs</MudText> *@

<MudIconButton Icon="@(HasExpandedGroups ? Icons.Material.Filled.UnfoldLess : Icons.Material.Filled.UnfoldMore)" Color="Color.Default" Size="Size.Small" OnClick="ToggleAllGroups" />
</MudStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ h1:focus {

.ua-footer {
position: relative;
z-index: calc(var(--mud-zindex-drawer) + 1);
background: var(--mud-palette-background) !important;
border-top: 1px solid var(--mud-palette-lines-default);
}
Expand Down Expand Up @@ -302,11 +301,9 @@ h1:focus {

/* Sidebar container */
.ua-docs-sidebar {
min-height: 20vh;
max-height: 90vh;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--mud-palette-lines-default) transparent;
min-height: 0;
max-height: none;
overflow: visible;
}

/* Header */
Expand Down Expand Up @@ -790,3 +787,58 @@ h1:focus {
text-decoration: underline;
text-underline-offset: 2px;
}



/* Documentation layout */

.docs-shell {
display: grid;
grid-template-columns: 260px minmax(0, 1fr) 260px;
min-height: calc(100vh - 64px);
}

.docs-sidebar-column,
.docs-toc-column {
min-width: 0;
padding: 8px;
}

.docs-main-column {
min-width: 0;
}

.docs-sticky {
position: sticky;
top: 80px;
max-height: calc(100dvh - 96px);
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-width: thin;
scrollbar-color: var(--mud-palette-lines-default) transparent;
}

/* Tablet: left sidebar + content */

@media (min-width: 600px) and (max-width: 1199px) {
.docs-shell {
grid-template-columns: 260px minmax(0, 1fr);
}

.docs-toc-column {
display: none;
}
}

/* Mobile: content only */

@media (max-width: 599px) {
.docs-shell {
grid-template-columns: minmax(0, 1fr);
}

.docs-sidebar-column,
.docs-toc-column {
display: none;
}
}
Loading