fixed anchors

This commit is contained in:
Nuno Coração 2022-11-06 22:28:52 +00:00
parent c7156995e7
commit 8ec3504224
3 changed files with 24 additions and 1 deletions

View file

@ -3148,6 +3148,14 @@ body:has(#menu-controller:checked) {
box-shadow: 5px 5px 20px 1px rgba(0, 0, 0, 0.3);
}
.anchor {
display: block;
position: relative;
top: -100px;
height: 0px;
visibility: hidden;
}
@media (min-width: 640px) {
.thumbnail {
min-width: 100%;

View file

@ -383,6 +383,14 @@ body:has(#menu-controller:checked) {
box-shadow: 5px 5px 20px 1px rgba(0, 0, 0, 0.3);
}
.anchor {
display: block;
position: relative;
top: -100px;
height: 0px;
visibility: hidden;
}
@screen sm {
.thumbnail {
min-width: 100%;

View file

@ -1 +1,8 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="relative group">{{ .Text | safeHTML }} {{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}<span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#{{ .Anchor | safeURL }}" aria-label="{{ i18n "article.anchor_label" }}">#</a></span>{{ end }}</h{{ .Level }}>
<div id="{{ .Anchor | safeURL }}" class="anchor">{{ .Text | safeHTML }}></div>
<h{{ .Level }} class="relative group">{{ .Text | safeHTML }}
{{ if.Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#{{ .Anchor | safeURL }}" aria-label="{{ i18n "article.anchor_label" }}">#</a></span>
{{ end }}
</h{{ .Level }}>