From bbc2149d8b3f1aaccedd45c5e3d972596a3063d6 Mon Sep 17 00:00:00 2001 From: DenebTM <deneb@screee.ee> Date: Wed, 19 Feb 2025 02:14:59 +0100 Subject: [PATCH] highlight current language in language selector --- assets/css/its.css | 6 ++++++ layouts/partials/languages-compact.html | 10 ++++++++-- themes/mainroad | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/css/its.css b/assets/css/its.css index 8516efb..6cd85ad 100644 --- a/assets/css/its.css +++ b/assets/css/its.css @@ -1,3 +1,5 @@ +{{- $highlightColor := .Site.Params.style.vars.highlightColor | default (.Site.Params.highlightColor | default "#e22d30") -}} + :root { --nixie-orange: orange; --nixie-orange-glow: #ffa500; @@ -37,6 +39,10 @@ color: white; } +.languages-compact a.current-lang { + color: {{ $highlightColor }}; +} + #main-banner { position: relative; } diff --git a/layouts/partials/languages-compact.html b/layouts/partials/languages-compact.html index 6737408..0dcd2e0 100644 --- a/layouts/partials/languages-compact.html +++ b/layouts/partials/languages-compact.html @@ -3,9 +3,15 @@ <div class="languages-compact"> {{- range $index, $lang := $translations }} {{- if ne $index 0}}<span> | </span>{{end}} - <a class="" href="{{ .RelPermalink }}"> + <a class=" + {{- if eq $lang.Language $.Site.Language -}} + current-lang + {{- end -}} + " + href="{{ .RelPermalink }}" + > {{ $lang.Language | upper }} </a> {{- end }} </div> -{{- end }} \ No newline at end of file +{{- end }} diff --git a/themes/mainroad b/themes/mainroad index 3a1878d..67036fc 160000 --- a/themes/mainroad +++ b/themes/mainroad @@ -1 +1 @@ -Subproject commit 3a1878d608d1261e9fef271eb5cc8074bfcc4cd8 +Subproject commit 67036fc5f2fcb31117c6219c0610f75dac643de1