Wrap entire card in <a> to make clickable.

I'm going to revert this and use an ::after pseudo-element to expand the
click target, but I need a point to which I can revert my changes.
This commit is contained in:
Benjamin A. Shelton 2026-11-25 19:46:36 -07:00
commit ee2c813ee9
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 19 additions and 17 deletions

View file

@ -44,7 +44,7 @@ const { notes } = Astro.props;
<div id="notes-list"> <div id="notes-list">
<ul>{notes.map((note: CollectionEntry<'notes'>) => ( <ul>{notes.map((note: CollectionEntry<'notes'>) => (
<li> <li class="flex"><a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>
<div class="header-image"> <div class="header-image">
<img src={urlfrag(base, note.data.post_image)} class="rounded-md" /> <img src={urlfrag(base, note.data.post_image)} class="rounded-md" />
</div> </div>
@ -60,12 +60,10 @@ const { notes } = Astro.props;
</ul> </ul>
</div> </div>
<hgroup> <hgroup>
<h2> <h2>{note.data.title}</h2>
<a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>{note.data.title}</a>
</h2>
<h3>{note.data.sub_heading}</h3> <h3>{note.data.sub_heading}</h3>
</hgroup> </hgroup>
<time>{dateFormat(note.data.date)}</time> <time>{dateFormat(note.data.date)}</time>
</li> </a></li>
))}</ul> ))}</ul>
</div> </div>

View file

@ -403,26 +403,29 @@ dialog.scripture {
#notes-list > ul > li { #notes-list > ul > li {
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
@apply flex flex-col rounded-xl bg-transparent p-2 hover:bg-gray-100 border-gray-200; @apply flex rounded-xl bg-transparent p-2 hover:bg-gray-100 border-gray-200;
@apply dark:bg-transparent dark:text-gray-300 dark:border-gray-800 dark:hover:bg-gray-800; @apply dark:bg-transparent dark:text-gray-300 dark:border-gray-800 dark:hover:bg-gray-800;
} }
#notes-list > ul > li > a {
@apply flex w-full flex-col;
@apply focus-visible:outline-4 focus-visible:outline-offset-8 focus-visible:rounded-2xl;
@apply focus-visible:outline-blue-500;
}
#notes-list ul > li .header-image { #notes-list ul > li .header-image {
@apply relative overflow-hidden rounded-lg shadow-md shadow-gray-300; @apply relative overflow-hidden rounded-lg shadow-md shadow-gray-300;
@apply dark:shadow-gray-900; @apply dark:shadow-gray-900;
} }
#notes-list ul > li h2 a { #notes-list ul > li > a > hgroup {
@apply grow p-4 transition-colors duration-500;
h2 {
@apply font-bold text-2xl inline-block;
border-bottom: 5px; border-bottom: 5px;
border-style: solid; border-style: solid;
@apply border-blue-300 transition duration-500 ease-in-out hover:border-blue-900 hover:text-blue-800; @apply border-blue-300 transition duration-500 ease-in-out hover:border-blue-900 hover:text-blue-800;
@apply dark:border-blue-500 dark:hover:border-blue-600 dark:hover:text-blue-300; @apply dark:border-blue-500 dark:hover:border-blue-600 dark:hover:text-blue-300;
}
#notes-list ul > li > hgroup {
@apply grow p-4 transition-colors duration-500;
h2 > a {
@apply font-bold text-2xl;
} }
h3 { h3 {
@apply mt-2 text-xl font-medium; @apply mt-2 text-xl font-medium;
@ -443,7 +446,8 @@ dialog.scripture {
} }
#notes-list ul li time { #notes-list ul li time {
@apply block text-xl text-gray-400 pl-4 pr-4 pt-2 text-right relative bottom-0; @apply text-xl text-gray-400 pl-4 pr-4 pt-2 text-right;
@apply mt-auto self-end;
} }
#notes-list ul.types li { #notes-list ul.types li {