BLOG-70 Add tooltip for post preview (#76)
All checks were successful
Frontend CI / build (push) Successful in 1m7s

### Description

- A a `title` attribute on the `<a>` element.
- Make the title as `<h2>` and the description as `<p>`.

### Package Changes

_No response_

### Screenshots

![image.png](/attachments/0d4b815e-d1c5-432c-8174-53273189a9c3)

### Reference

Resolves #

### Checklist

- [x] A milestone is set
- [x] The related issuse has been linked to this branch

Reviewed-on: #76
Co-authored-by: SquidSpirit <squid@squidspirit.com>
Co-committed-by: SquidSpirit <squid@squidspirit.com>
This commit is contained in:
SquidSpirit 2025-07-26 01:29:18 +08:00 committed by squid
parent ff2b86358d
commit 9ad3809f47

View File

@ -17,7 +17,7 @@
}
</script>
<a class="flex cursor-pointer flex-col gap-y-6" href="/post/{postInfo.id}">
<a class="flex cursor-pointer flex-col gap-y-6" href="/post/{postInfo.id}" title={postInfo.title}>
<div class="relative aspect-video overflow-hidden rounded-2xl bg-gray-200">
<img
class="rounded-2xl object-cover transition-opacity duration-300
@ -34,8 +34,8 @@
</div>
<div class="flex flex-col gap-y-2.5">
<PostPreviewLabels labels={postInfo.labels} />
<span class="line-clamp-1 text-lg font-bold">{postInfo.title}</span>
<span class="line-clamp-3 text-justify text-sm">{postInfo.description}</span>
<h2 class="line-clamp-1 text-lg font-bold">{postInfo.title}</h2>
<p class="line-clamp-3 text-justify text-sm">{postInfo.description}</p>
<span class="text-sm text-gray-500">{postInfo.formattedPublishedTime}</span>
</div>
</a>