|
9 | 9 | { |
10 | 10 | var f = file.File; |
11 | 11 | var isCurrent = f == Model.CurrentDocument; |
12 | | - <li class="block ml-2 pl-2 w-full border-l-1 group @(isCurrent ? "current border-l-gray-200" : "border-l-gray-200")"> |
| 12 | + <li class="block ml-2 pl-2 w-full border-l-1 border-l-gray-200 group/li @(isCurrent ? "current" : string.Empty)"> |
13 | 13 | <div class="flex"> |
14 | 14 | <div class="w-5"> |
15 | 15 | </div> |
16 | 16 | <a |
17 | | - class="block py-1 text-sm leading-[1.2em] tracking-[-0.02em] group-[.current]:text-blue-elastic! hover:text-ink-dark" |
18 | | - href="@f.Url"> |
| 17 | + class="block py-1 text-sm leading-[1.2em] tracking-[-0.02em] group-[.current]/li:text-blue-elastic! hover:text-ink-dark @(isCurrent ? "pointer-events-none" : string.Empty)" |
| 18 | + href="@f.Url" |
| 19 | + @(isCurrent ? "aria-current=page" : string.Empty) |
| 20 | + > |
19 | 21 | @f.NavigationTitle |
20 | 22 | </a> |
21 | 23 | </div> |
|
30 | 32 | var containsCurrent = g.HoldsCurrent(Model.CurrentDocument) || g.ContainsCurrentPage(Model.CurrentDocument); |
31 | 33 | var shouldInitiallyExpand = containsCurrent || g.Depth <= initialExpandLevel; |
32 | 34 | <li class="flex flex-wrap ml-2 pl-2 @(g.Depth > 1 ? "border-l-1 border-l-gray-200" : string.Empty)"> |
33 | | - <label for="@slug" class="peer group flex items-center mr-1"> |
| 35 | + <label for="@slug" class="peer group/label flex items-center mr-1"> |
34 | 36 | <svg |
35 | 37 | xmlns="http://www.w3.org/2000/svg" |
36 | 38 | fill="none" |
37 | 39 | viewBox="0 0 24 24" |
38 | 40 | stroke-width="1.5" |
39 | 41 | stroke="currentColor" |
40 | | - class="w-4 shrink -rotate-90 group-has-checked:rotate-0 cursor-pointer"> |
| 42 | + class="w-4 shrink -rotate-90 group-has-checked/label:rotate-0 cursor-pointer"> |
41 | 43 | <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/> |
42 | 44 | </svg> |
43 | 45 | <input |
|
46 | 48 | class="hidden" |
47 | 49 | aria-hidden="true" |
48 | 50 | data-should-expand="@containsCurrent.ToLowerString()" |
49 | | - @(shouldInitiallyExpand ? "checked" : string.Empty)> |
| 51 | + @(shouldInitiallyExpand ? "checked" : string.Empty) |
| 52 | + > |
| 53 | + <a |
| 54 | + href="@g.Index?.Url" |
| 55 | + class="block py-1 text-sm leading-[1.2em] tracking-[-0.02em] hover:text-ink-dark @(containsCurrent ? "font-semibold" : string.Empty) @(isCurrent ? "current pointer-events-none text-blue-elastic!" : string.Empty)"> |
| 56 | + @g.Index?.NavigationTitle |
| 57 | + </a> |
50 | 58 | </label> |
51 | | - <a |
52 | | - href="@g.Index?.Url" |
53 | | - class="block py-1 text-sm leading-[1.2em] tracking-[-0.02em] hover:text-ink-dark @(containsCurrent && g.Depth == 1 ? "font-bold" : string.Empty) @(isCurrent ? "current text-blue-elastic!" : string.Empty) "> |
54 | | - @g.Index?.NavigationTitle |
55 | | - </a> |
56 | 59 | @if (g.NavigationItems.Count > 0) |
57 | 60 | { |
58 | 61 | <ul class="h-0 grow overflow-hidden peer-has-checked:h-auto w-full overflow-hidden" data-has-current="@g.ContainsCurrentPage(Model.CurrentDocument)"> |
|
0 commit comments