Skip to content

Commit cf4cd93

Browse files
committed
use complete class names in nav
1 parent f25b652 commit cf4cd93

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

layouts/partials/nav.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{{- $textColor := cond .IsHome "white" "primary" -}}
1+
{{- $textColor := cond .IsHome "text-white" "text-primary" -}}
2+
{{- $borderColor := cond .IsHome "border-white" "border-primary" -}}
23
{{- $backgroundColor := cond .IsHome "bg-dark" "bg-white" -}}
3-
{{- $navBorderColor := cond .IsHome "border-transparent" "border-primary" -}}
44
{{- $currentRelPermalink := .RelPermalink -}}
5-
<nav class="w-full max-h-screen text-{{ $textColor }} fixed {{ $backgroundColor }} shadow-sm z-50">
5+
<nav class="w-full max-h-screen {{ $textColor }} fixed {{ $backgroundColor }} shadow-sm z-50">
66
<div class="flex justify-between items-stretch w-full lg:px-8">
77
<!-- Regular Navigation -->
88
<div class="flex items-stretch">
99
<!-- Toggle Button for Smartphone Navigation -->
10-
<button @click="isNavOpen = !isNavOpen" type="button" class="self-center lg:hidden border border-{{ $textColor }} rounded-sm px-2 py-1 mx-2" aria-label="Toggle Navigation">
10+
<button @click="isNavOpen = !isNavOpen" type="button" class="self-center lg:hidden border {{ $borderColor }} rounded-sm px-2 py-1 mx-2" aria-label="Toggle Navigation">
1111
<i x-show="isNavOpen" class="fas fa-times fa-fw" x-cloak></i>
1212
<i x-show="!isNavOpen" class="fas fa-bars fa-fw"></i>
1313
</button>
@@ -35,8 +35,8 @@
3535
</li>
3636
{{- range .Site.Data.nav.RelLinks }}
3737
{{- with $.Site.GetPage . }}
38-
{{- $borderColor := cond (hasPrefix $currentRelPermalink .RelPermalink) $textColor "transparent" }}
39-
<li class="flex items-center mx-2 border-b-2 border-{{ $borderColor }} hover:border-{{ $textColor }}">
38+
{{- $navItemBorderColor := cond (hasPrefix $currentRelPermalink .RelPermalink) $borderColor "border-transparent" }}
39+
<li class="flex items-center mx-2 border-b-2 {{ $navItemBorderColor }} hover:{{ $borderColor }}">
4040
<a class="p-2 hover:no-underline plausible-event-name=nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}" href="{{ .RelPermalink }}">{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}</a>
4141
</li>
4242
{{- end }}
@@ -93,7 +93,7 @@
9393
{{- end }}
9494

9595
<ul class="hidden lg:flex items-stretch list-none m-0">
96-
<li class="flex items-center m-3 border-l border-{{ $textColor }}"></li>
96+
<li class="flex items-center m-3 border-l {{ $borderColor }}"></li>
9797

9898
<li x-data="{ isLangDropdownOpen: false }" class="flex items-center mx-2">
9999
<button @click="isLangDropdownOpen = !isLangDropdownOpen" class="whitespace-nowrap p-2">

0 commit comments

Comments
 (0)