Skip to content

Commit 0ccf94b

Browse files
authored
Merge pull request #2351 from servedsmart/replace-custom-javascript-logic-with-anchor-tags
🚑 Hotfix for issues in #2252
2 parents ec912c4 + fef2b64 commit 0ccf94b

File tree

6 files changed

+50
-39
lines changed

6 files changed

+50
-39
lines changed

assets/css/compiled/main.css

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,6 +2415,13 @@ body.zen-mode-enable {
24152415
}
24162416
}
24172417
}
2418+
.group-hover\:underline-offset-2 {
2419+
&:is(:where(.group):hover *) {
2420+
@media (hover: hover) {
2421+
text-underline-offset: 2px;
2422+
}
2423+
}
2424+
}
24182425
.group-hover\:opacity-100 {
24192426
&:is(:where(.group):hover *) {
24202427
@media (hover: hover) {
@@ -3721,44 +3728,29 @@ a {
37213728
pre {
37223729
text-align: left;
37233730
}
3724-
.thumbnail {
3725-
min-width: 300px;
3726-
height: 180px;
3731+
.thumbnail, .thumbnail_card, .thumbnail_card_related, .thumbnail_card_term, .single_hero_basic, .single_hero_background {
37273732
background-repeat: no-repeat;
37283733
background-size: cover;
37293734
background-position: center;
37303735
}
3736+
.thumbnail {
3737+
min-width: 300px;
3738+
height: 180px;
3739+
}
37313740
.thumbnail_card {
37323741
height: 200px;
3733-
background-repeat: no-repeat;
3734-
background-size: cover;
3735-
background-position: center;
37363742
}
37373743
.thumbnail_card_related {
37383744
height: 150px;
3739-
background-repeat: no-repeat;
3740-
background-size: cover;
3741-
background-position: center;
37423745
}
37433746
.thumbnail_card_term {
37443747
height: 150px;
3745-
background-repeat: no-repeat;
3746-
background-size: cover;
3747-
background-position: center;
3748-
}
3749-
.single_hero_basic {
3750-
background-repeat: no-repeat;
3751-
background-size: cover;
3752-
background-position: center;
37533748
}
37543749
.single_hero_round {
37553750
max-height: 50vh;
37563751
object-fit: cover;
37573752
}
37583753
.single_hero_background {
3759-
background-repeat: no-repeat;
3760-
background-size: cover;
3761-
background-position: center;
37623754
z-index: -10;
37633755
}
37643756
.hero_gradient {
@@ -3821,6 +3813,9 @@ pre {
38213813
text-decoration-thickness: 3px;
38223814
text-underline-offset: 4px;
38233815
}
3816+
.group-hover-card:hover:has(.group-hover-cancel:hover) .group-hover-card-title {
3817+
text-decoration: none !important;
3818+
}
38243819
@layer base {
38253820
[type='text'],input:where(:not([type])),[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
38263821
appearance: none;

assets/css/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,8 @@ pre {
277277
text-decoration-thickness: 3px;
278278
text-underline-offset: 4px;
279279
}
280+
281+
/* Cancel group hover if .group-hover-card contains .group-hover-cancel*/
282+
.group-hover-card:hover:has(.group-hover-cancel:hover) .group-hover-card-title {
283+
text-decoration: none !important;
284+
}

layouts/partials/article-link/_shortcode.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{ $constrainItemsWidth := site.Params.list.constrainItemsWidth | default false }}
55
{{ $disableImageOptimization := site.Params.disableImageOptimization | default false }}
66

7-
{{ $articleClasses := "flex flex-wrap md:flex-nowrap article" }}
7+
{{ $articleClasses := "group-hover-card group flex flex-wrap md:flex-nowrap article relative" }}
88
{{ if site.Params.list.showCards }}
99
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }}
1010
{{ else }}
@@ -30,7 +30,12 @@
3030
{{ end }}
3131

3232

33-
<a class="{{ $articleClasses }}" {{ partial "article-link/_external-link.html" $target | safeHTMLAttr }}>
33+
<div class="{{ $articleClasses }}">
34+
<a
35+
{{ partial "article-link/_external-link.html" $target | safeHTMLAttr }}
36+
class="absolute inset-0"
37+
aria-label="{{ $.Title }}"></a>
38+
3439
{{- with $target.Params.images -}}
3540
{{- range first 6 . }}
3641
<meta property="og:image" content="{{ . | absURL }}">
@@ -70,7 +75,7 @@
7075
{{ with $target.Params.externalUrl }}
7176
<div>
7277
<div
73-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
78+
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">
7479
{{ $target.Title | emojify }}
7580
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
7681
<span class="rtl:hidden">&#8599;</span>
@@ -80,7 +85,7 @@
8085
</div>
8186
{{ else }}
8287
<div
83-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2"
88+
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"
8489
href="{{ $target.RelPermalink }}">
8590
{{ $target.Title | emojify }}
8691
</div>
@@ -94,7 +99,7 @@
9499
{{ partial "extend-article-link.html" $target }}
95100
{{ end }}
96101
</div>
97-
<div class="text-sm text-neutral-500 dark:text-neutral-400">
102+
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
98103
{{ partial "article-meta/basic.html" $target }}
99104
</div>
100105
{{ $showSummary := false }}
@@ -111,10 +116,10 @@
111116
{{ $compactSummary = $target.Params.compactSummary | default (site.Params.list.compactSummary | default false) }}
112117
{{ end }}
113118
<div class="overflow-hidden pt-1">
114-
<div class="{{ if $compactSummary }}line-clamp-3{{ end }} max-w-fit prose dark:prose-invert">
119+
<div class="{{ if $compactSummary }}line-clamp-3{{ end }} prose dark:prose-invert max-w-fit">
115120
{{ $target.Summary | plainify }}
116121
</div>
117122
</div>
118123
{{ end }}
119124
</div>
120-
</a>
125+
</div>

layouts/partials/article-link/card-related.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
22
<div
3-
class="relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
3+
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">
44
<a
55
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
66
class="absolute inset-0"
@@ -48,7 +48,7 @@
4848
<div class="px-6 py-4">
4949
{{ with .Params.externalUrl }}
5050
<div
51-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
51+
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">
5252
{{ $.Title | emojify }}
5353
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
5454
<span class="rtl:hidden">&#8599;</span>
@@ -57,11 +57,13 @@
5757
</div>
5858
{{ else }}
5959
<div
60-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
60+
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">
6161
{{ .Title | emojify }}
6262
</div>
6363
{{ end }}
64-
<div class="text-sm text-neutral-500 dark:text-neutral-400">{{ partial "article-meta/basic.html" . }}</div>
64+
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
65+
{{ partial "article-meta/basic.html" . }}
66+
</div>
6567
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
6668
<div class="prose dark:prose-invert py-1">{{ .Summary | plainify }}</div>
6769
{{ end }}

layouts/partials/article-link/card.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
22
<div
3-
class="relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
3+
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">
44
<a
55
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
66
class="absolute inset-0"
@@ -45,7 +45,7 @@
4545
<div class="px-6 py-4">
4646
{{ with .Params.externalUrl }}
4747
<div
48-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
48+
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">
4949
{{ $.Title | emojify }}
5050
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
5151
<span class="rtl:hidden">&#8599;</span>
@@ -54,11 +54,13 @@
5454
</div>
5555
{{ else }}
5656
<div
57-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
57+
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">
5858
{{ .Title | emojify }}
5959
</div>
6060
{{ end }}
61-
<div class="text-sm text-neutral-500 dark:text-neutral-400">{{ partial "article-meta/basic.html" . }}</div>
61+
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
62+
{{ partial "article-meta/basic.html" . }}
63+
</div>
6264
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
6365
<div class="prose dark:prose-invert py-1">{{ .Summary | plainify }}</div>
6466
{{ end }}

layouts/partials/article-link/simple.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ $constrainItemsWidth := .Page.Site.Params.list.constrainItemsWidth | default false }}
22

3-
{{ $articleClasses := "flex flex-wrap md:flex-nowrap article relative" }}
3+
{{ $articleClasses := "group-hover-card group flex flex-wrap md:flex-nowrap article relative" }}
44
{{ if .Site.Params.list.showCards }}
55
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }}
66
{{ else }}
@@ -71,7 +71,7 @@
7171
<div class="items-center text-left text-xl font-semibold">
7272
{{ with .Params.externalUrl }}
7373
<div
74-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
74+
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">
7575
{{ $.Title | emojify }}
7676
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
7777
<span class="rtl:hidden">&#8599;</span>
@@ -80,7 +80,7 @@
8080
</div>
8181
{{ else }}
8282
<div
83-
class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
83+
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">
8484
{{ .Title | emojify }}
8585
</div>
8686
{{ end }}
@@ -91,7 +91,9 @@
9191
{{ partial "extend-article-link.html" . }}
9292
{{ end }}
9393
</div>
94-
<div class="text-sm text-neutral-500 dark:text-neutral-400">{{ partial "article-meta/basic.html" . }}</div>
94+
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
95+
{{ partial "article-meta/basic.html" . }}
96+
</div>
9597
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
9698
<div class="prose dark:prose-invert max-w-fit py-1">{{ .Summary | plainify }}</div>
9799
{{ end }}

0 commit comments

Comments
 (0)