Skip to content

Commit 34a2d1d

Browse files
committed
fix overflow blog ref tooltips to hide and be on top
1 parent dbcdbcd commit 34a2d1d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

blog.templ

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ templ blogs(posts []*Post, tags map[string]TagStatus) {
7575
}
7676

7777
templ blog(post *Post) {
78-
<div class="container mx-auto">
79-
<section class="">
78+
<div class="relative overflow-x-hidden">
79+
<section class="container mx-auto">
8080
<h1 class="v-h1 text-center">{ post.Title }</h1>
8181
<div class="mt-4 flex flex-wrap gap-x-2 justify-center">
8282
for tag := range post.Tags {
@@ -124,7 +124,7 @@ templ blog(post *Post) {
124124
<hr class="border-1 border-v-gray"/>
125125
</article>
126126
</div>
127-
<section>
127+
<section class="container mx-auto">
128128
<div class="v-h2">
129129
<h2 class="">Read similar posts</h2>
130130
</div>

md_citations.templ

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package website
33
import "strconv"
44

55
templ citationTemplate(ref reference) {
6-
<sup class="group prose-a:no-underline prose-a:font-normal">
6+
<sup class="relative group prose-a:no-underline prose-a:font-normal">
77
<a href={ templ.URL(ref.URL.String()) } target="_blank">
88
[{ strconv.Itoa(ref.Index) }]
99
</a>
10-
<span class="invisible absolute -top-0 left-5 z-10 w-max truncate italic bg-v-pink px-2 py-3 text-center text-v-white group-hover:visible">{ ref.Title }</span>
10+
<span class="invisible absolute inline-block bottom-[calc(100%)] left-[calc(50%)] -translate-x-2/4 z-10 max-w-80 truncate italic bg-v-pink px-2 py-3 text-v-white group-hover:visible">{ ref.Title }</span>
1111
</sup>
1212
}

testdata/golden/TestCitations.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<h1>Title</h1>
2-
<p>This is a <sup class="group prose-a:no-underline prose-a:font-normal"><a href="http://localhost:666" target="_blank">[1]</a> <span class="invisible absolute -top-0 left-5 z-10 w-max truncate italic bg-v-pink px-2 py-3 text-center text-v-white group-hover:visible"></span></sup> to a reference.</p>
2+
<p>This is a <sup class="relative group prose-a:no-underline prose-a:font-normal"><a href="http://localhost:666" target="_blank">[1]</a> <span class="invisible absolute inline-block bottom-[calc(100%)] left-[calc(50%)] -translate-x-2/4 z-10 max-w-80 truncate italic bg-v-pink px-2 py-3 text-v-white group-hover:visible"></span></sup> to a reference.</p>

0 commit comments

Comments
 (0)