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
2 changes: 1 addition & 1 deletion src/Elastic.Markdown/Slices/Layout/_PagesNav.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<aside class="sidebar bg-white fixed md:sticky shadow-2xl md:shadow-none left-[100%] group-has-[#pages-nav-hamburger:checked]/body:left-0 bottom-0 md:left-auto pl-6 md:pl-0 top-[calc(var(--offset-top)+1px)] order-1 w-[80%] md:w-auto shrink-0 border-r-1 border-r-grey-20 z-40 md:z-auto">
<nav
id="pages-nav"
class="sidebar-nav"
class="sidebar-nav h-full"
@* used to invalidate session storage *@
data-current-navigation="@LayoutViewModel.CurrentNavigationId">
@(new HtmlString(Model.NavigationHtml))
Expand Down
45 changes: 23 additions & 22 deletions src/Elastic.Markdown/Slices/Layout/_TocTree.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
@if (Model.IsPrimaryNavEnabled && current is { Group.Index: not null })
{
<div class="sticky top-0 py-6 bg-white z-10 border-b-1 border-grey-20 pr-4">
<details class="block group border-1 border-grey-20 rounded-sm font-sans">
<summary class="grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20">
<div class="block group border-1 border-grey-20 rounded-sm font-sans relative">
<button class="w-full text-left grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20">
<span>
<a
<a
class="hover:underline text-blue-elastic hover:text-blue-elastic-100"
href="@current.Group.Index?.Url"
@Htmx.GetNavHxAttributes(true)
>
@Htmx.GetNavHxAttributes(true)>
@current.Group.Index?.NavigationTitle
</a>
</span>
Expand All @@ -29,23 +28,25 @@
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
</svg>
</div>
</summary>
<ul class="py-2">
@foreach (var item in Model.TopLevelItems)
{
if (item.Group.Index == null) continue;
if (item.Id == current?.Id) continue;
<li class="block">
<a
class="block py-2 px-4 hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold @(item.Group.Id == Model.Tree.Id ? "text-blue-elastic" : "")"
href="@item.Group.Index.Url"
@Htmx.GetNavHxAttributes(false, "mouseover")>
@item.Group.Index.NavigationTitle
</a>
</li>
}
</ul>
</details>
</button>
<div class="hidden group-focus-within:block left-0 right-0 absolute top-full">
<ul class="mt-1 py-2 bg-white border-1 border-grey-20 rounded-sm shadow-md">
@foreach (var item in Model.TopLevelItems)
{
if (item.Group.Index == null) continue;
if (item.Id == current?.Id) continue;
<li class="block">
<a
class="block py-2 px-4 hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold @(item.Group.Id == Model.Tree.Id ? "text-blue-elastic" : "")"
href="@item.Group.Index.Url"
@Htmx.GetNavHxAttributes(false, "mouseover")>
@item.Group.Index.NavigationTitle
</a>
</li>
}
</ul>
</div>
</div>
</div>
}
else
Expand Down
Loading