Skip to content

Commit cf6adef

Browse files
authored
Improve pagination nav with disabled state and accesskeys (#469)
1 parent ae9c3e0 commit cf6adef

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

antora-ui/src/css/pagination.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,9 @@ Spirit style navigation
8686
border-width: 0;
8787
vertical-align: middle;
8888
}
89+
90+
.spirit-nav .disabled {
91+
opacity: 0.35;
92+
cursor: not-allowed;
93+
pointer-events: none;
94+
}
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<div class="spirit-nav">
22
{{#with page.previous}}
3-
<a accesskey="p" href="{{{relativize ./url}}}"><span class="material-symbols-outlined" title="Previous: {{{./content}}}">arrow_back</span></a>
4-
{{/with}}
5-
{{#with page.parent}}
6-
<a accesskey="p" href="{{{relativize ./url}}}"><span class="material-symbols-outlined" title="Up: {{{./content}}}">arrow_upward</span></a>
3+
<a accesskey="p" href="{{{relativize ./url}}}">
4+
<span class="material-symbols-outlined" title="Previous: {{{./content}}}">arrow_back</span>
5+
</a>
76
{{/with}}
7+
{{#if page.parent}}
8+
<a accesskey="u" href="{{{relativize page.parent.url}}}">
9+
<span class="material-symbols-outlined" title="Up: {{{page.parent.content}}}">arrow_upward</span>
10+
</a>
11+
{{else}}
12+
<a class="disabled" accesskey="u" aria-disabled="true" tabindex="-1">
13+
<span class="material-symbols-outlined" title="Up:">arrow_upward</span>
14+
</a>
15+
{{/if}}
816
{{#with page.next}}
9-
<a accesskey="p" href="{{{relativize ./url}}}"><span class="material-symbols-outlined" title="Next: {{{./content}}}">arrow_forward</span></a>
17+
<a accesskey="n" href="{{{relativize ./url}}}">
18+
<span class="material-symbols-outlined" title="Next: {{{./content}}}">arrow_forward</span>
19+
</a>
1020
{{/with}}
11-
</div>
21+
</div>

0 commit comments

Comments
 (0)