mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
feat(article-link): reimplement card hover using ::before method
The previous method was not intuitive since there was nothing in the <a> tag, and required group-xxx classes for every element. The new pseudo element method fixes those problems, see: https://kittygiraudel.com/2022/04/02/accessible-cards/
This commit is contained in:
@@ -36,11 +36,7 @@
|
||||
|
||||
|
||||
<div
|
||||
class="group-hover-card group relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
|
||||
<a
|
||||
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
|
||||
class="absolute inset-0"
|
||||
aria-label="{{ $.Title }}"></a>
|
||||
class="relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
|
||||
{{ with $featuredURL }}
|
||||
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ . }});"></div>
|
||||
{{ end }}
|
||||
@@ -50,22 +46,24 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
<div class="px-6 py-4">
|
||||
{{ with .Params.externalUrl }}
|
||||
<div
|
||||
class="group-hover-card-title decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 group-hover:underline group-hover:underline-offset-2">
|
||||
{{ $.Title | emojify }}
|
||||
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
|
||||
<span class="rtl:hidden">↗</span>
|
||||
<span class="ltr:hidden">↖</span>
|
||||
</span>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div
|
||||
class="group-hover-card-title decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 group-hover:underline group-hover:underline-offset-2">
|
||||
{{ .Title | emojify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
|
||||
<a
|
||||
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
|
||||
class="not-prose before:absolute before:inset-0 decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
|
||||
{{ with .Params.externalUrl }}
|
||||
<div>
|
||||
{{ $.Title | emojify }}
|
||||
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
|
||||
<span class="rtl:hidden">↗</span>
|
||||
<span class="ltr:hidden">↖</span>
|
||||
</span>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ .Title | emojify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</a>
|
||||
<div class="text-sm text-neutral-500 dark:text-neutral-400">
|
||||
{{ partial "article-meta/basic.html" . }}
|
||||
</div>
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
|
||||
Reference in New Issue
Block a user