From 14eeb655ce9dacaa93bcc4e5fc4f3359cc9ef719 Mon Sep 17 00:00:00 2001 From: Patrick Kollitsch Date: Mon, 21 Oct 2024 05:59:52 +0700 Subject: [PATCH] theme(fix): hover color for social icons Signed-off-by: Patrick Kollitsch --- layouts/partials/func/style/GetMainCSS.html | 11 +++++++---- layouts/partials/social/follow.html | 2 +- layouts/partials/social/share.html | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/layouts/partials/func/style/GetMainCSS.html b/layouts/partials/func/style/GetMainCSS.html index d7ddd5b..b28e2f2 100644 --- a/layouts/partials/func/style/GetMainCSS.html +++ b/layouts/partials/func/style/GetMainCSS.html @@ -22,19 +22,22 @@ {{ 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 }} {{ range $service := . }} {{ with .color }} {{ $rule := printf ` .ananke-socials a.%s:hover { - color: %s - }` $service.name $service.color }} + color: %s !important; + }` $service.slug . }} {{ $socials_rules = $socials_rules | append $rule }} {{ end }} {{ end }} {{ with $socials_rules }} - {{ $socials_rules = delimit . "" }} + {{ $socials_rules = delimit . " " }} {{ $socials_css := $socials_rules | resources.FromString "ananke/css/generated_socials.css" }} {{ $assets_to_concat = $assets_to_concat | append $socials_css }} {{ end }} diff --git a/layouts/partials/social/follow.html b/layouts/partials/social/follow.html index 84942c8..5fbe4fb 100644 --- a/layouts/partials/social/follow.html +++ b/layouts/partials/social/follow.html @@ -23,7 +23,7 @@ {{- $languageDirection := cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}} {{/* @todo add the following lines to a partial, reused in social/share.html */}} diff --git a/layouts/partials/social/share.html b/layouts/partials/social/share.html index 1543be5..31a8112 100644 --- a/layouts/partials/social/share.html +++ b/layouts/partials/social/share.html @@ -32,7 +32,7 @@ {{- $options := (dict "context" page "setup" $setup) }} {{- $href := partialCached "func/getShareLink.html" $options $options -}} {{ with $config.share.icons -}}