theme(fix): hover color for social icons

Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
This commit is contained in:
Patrick Kollitsch 2024-10-21 05:59:52 +07:00
parent d9f9cb513f
commit 14eeb655ce
No known key found for this signature in database
GPG key ID: 5A5360B005AD68C7
3 changed files with 9 additions and 6 deletions

View file

@ -22,19 +22,22 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ with partialCached "func/socials/Get" "socials/Get" }} {{- $config := site.Params.ananke.social -}}
{{- $networks := $config.follow.networks -}}
{{- $setups := (collections.Where $config.networks "slug" "in" $networks) }}
{{ with $setups }}
{{ $socials_rules := slice }} {{ $socials_rules := slice }}
{{ range $service := . }} {{ range $service := . }}
{{ with .color }} {{ with .color }}
{{ $rule := printf ` {{ $rule := printf `
.ananke-socials a.%s:hover { .ananke-socials a.%s:hover {
color: %s color: %s !important;
}` $service.name $service.color }} }` $service.slug . }}
{{ $socials_rules = $socials_rules | append $rule }} {{ $socials_rules = $socials_rules | append $rule }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ with $socials_rules }} {{ with $socials_rules }}
{{ $socials_rules = delimit . "" }} {{ $socials_rules = delimit . " " }}
{{ $socials_css := $socials_rules | resources.FromString "ananke/css/generated_socials.css" }} {{ $socials_css := $socials_rules | resources.FromString "ananke/css/generated_socials.css" }}
{{ $assets_to_concat = $assets_to_concat | append $socials_css }} {{ $assets_to_concat = $assets_to_concat | append $socials_css }}
{{ end }} {{ end }}

View file

@ -23,7 +23,7 @@
{{- $languageDirection := cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}} {{- $languageDirection := cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}}
<a href="{{ $link }}" target="_blank" rel="noopener{{- with $rel }} {{ . -}}{{- end -}}" <a href="{{ $link }}" target="_blank" rel="noopener{{- with $rel }} {{ . -}}{{- end -}}"
class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ $languageDirection }}" class="ananke-social-link link-transition {{ $network }} link dib z-999 pt3 pt0-l {{ $languageDirection }}"
title="follow on {{ $label }} - Opens in a new window" title="follow on {{ $label }} - Opens in a new window"
aria-label="follow on {{ $label }} - Opens in a new window"> aria-label="follow on {{ $label }} - Opens in a new window">
{{/* @todo add the following lines to a partial, reused in social/share.html */}} {{/* @todo add the following lines to a partial, reused in social/share.html */}}

View file

@ -32,7 +32,7 @@
{{- $options := (dict "context" page "setup" $setup) }} {{- $options := (dict "context" page "setup" $setup) }}
{{- $href := partialCached "func/getShareLink.html" $options $options -}} {{- $href := partialCached "func/getShareLink.html" $options $options -}}
<a href="{{ $href }}" <a href="{{ $href }}"
class="ananke-social-link {{ .slug }} no-underline" class="ananke-social-link {{ $setup.slug }} no-underline"
title="{{ $label }}" aria-label="{{ $label }}" title="{{ $label }}" aria-label="{{ $label }}"
target="_blank" rel="nofollow noopener noreferrer"> target="_blank" rel="nofollow noopener noreferrer">
{{ with $config.share.icons -}} {{ with $config.share.icons -}}