Skip to content

Commit b674336

Browse files
committed
Add previous/next button design
1 parent 4425e3d commit b674336

File tree

4 files changed

+42
-28
lines changed

4 files changed

+42
-28
lines changed

src/Elastic.Markdown/Assets/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
tracking-[-0.02em];
8080
}
8181
}
82+
83+
.content-container {
84+
@apply w-full max-w-[80ch];
85+
}
8286
}
8387

8488
* {

src/Elastic.Markdown/Slices/Layout/_TableOfContents.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<a href="@Model.GithubEditUrl" class="link">
2828
Edit this page
2929
<svg class="link-arrow"
30-
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
31-
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3" />
30+
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
31+
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"/>
3232
</svg>
3333
</a>
3434
</div>

src/Elastic.Markdown/Slices/_Layout.cshtml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,44 @@
1717
@await RenderPartialAsync(_PagesNav.Create(Model))
1818
@await RenderPartialAsync(_TableOfContents.Create(Model))
1919
<main class="w-full pt-6 pb-30 px-6 order-2">
20-
@await RenderPartialAsync(_Breadcrumbs.Create(Model))
21-
<article class="markdown-content w-full max-w-[80ch]">
20+
<div class="content-container">
21+
@await RenderPartialAsync(_Breadcrumbs.Create(Model))
22+
</div>
23+
<article class="content-container">
2224
@await RenderBodyAsync()
2325
</article>
24-
<div class="flex justify-between mt-12">
25-
<div class="grow flex justify-start flex-nowrap">
26-
@if (Model.Previous != null)
27-
{
28-
<a href="@Model.Previous.Url" class="flex items-center text-blue-elastic leading-0">
29-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
30-
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18"/>
31-
</svg>
32-
<div class="title ml-2">@Model.Previous.NavigationTitle</div>
33-
</a>
34-
}
35-
</div>
36-
<div class="grow flex justify-end flex-nowrap">
37-
@if (Model.Next != null)
38-
{
39-
<a href="@Model.Next.Url" class="flex items-center text-blue-elastic leading-0">
40-
<div class="title mr-2">@Model.Next.NavigationTitle</div>
41-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
42-
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"/>
43-
</svg>
44-
</a>
45-
}
26+
<footer class="content-container mt-20">
27+
<div class="flex flex-wrap lg:flex-nowrap gap-2 mt-2">
28+
<div class="w-full">
29+
@if (Model.Previous != null)
30+
{
31+
<a href="@Model.Previous.Url" class="flex h-full items-center text-ink-light hover:black border-1 border-gray-300 hover:border-gray-500 rounded-lg p-6 shadow-md">
32+
<svg class="size-6 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
33+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5"/>
34+
</svg>
35+
<div>
36+
<div class="text-xs lg:text-sm">Previous</div>
37+
<div class="text-base lg:text-xl text-black">@Model.Previous.NavigationTitle</div>
38+
</div>
39+
</a>
40+
}
41+
</div>
42+
<div class="w-full">
43+
@if (Model.Next != null)
44+
{
45+
<a href="@Model.Next.Url" class="flex h-full items-center justify-end text-ink-light hover:black border-1 border-gray-300 hover:border-gray-500 rounded-lg p-6 shadow-md text-right">
46+
<div>
47+
<div class="text-xs lg:text-sm">Next</div>
48+
<div class="text-base lg:text-xl text-black">@Model.Next.NavigationTitle</div>
49+
</div>
50+
<svg class="size-6 ml-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
51+
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5"/>
52+
</svg>
53+
</a>
54+
}
55+
</div>
4656
</div>
47-
</div>
57+
</footer>
4858
</main>
4959
</div>
5060
</div>

src/Elastic.Markdown/Slices/_ViewImports.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
@using Elastic.Markdown.Slices.Layout
1111

1212
@tagHelperPrefix __disable_tagHelpers__:
13-
@removeTagHelper *, Microsoft.AspNetCore.Mvc.Razor
13+
@removeTagHelper *, Microsoft.AspNetCore.Mvc.Razor

0 commit comments

Comments
 (0)