From 7532e0ab12442ba82562eae0063432c4748830c4 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 02:22:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20anchor=20header=20lin?= =?UTF-8?q?ks=20on=20hover=20Closes=20#64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/blog/_index.md | 1 + sass/parts/_misc.scss | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/content/blog/_index.md b/content/blog/_index.md index b026d8b..79a1185 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -4,4 +4,5 @@ path = "/blog" title = "Blog" sort_by = "date" template = "section.html" +insert_anchor_links = "left" +++ diff --git a/sass/parts/_misc.scss b/sass/parts/_misc.scss index 077c2e7..334e83d 100644 --- a/sass/parts/_misc.scss +++ b/sass/parts/_misc.scss @@ -31,6 +31,30 @@ iframe { margin-bottom: 3vmin; } +.zola-anchor { + font-size: 1rem; + position: absolute; + margin-left: -1.7em; + padding-right: 0.45em; + padding-left: 0.4em; + opacity: 0; +} + +h1:hover .zola-anchor, +h2:hover .zola-anchor, +h3:hover .zola-anchor, +h4:hover .zola-anchor, +h5:hover .zola-anchor, +h6:hover .zola-anchor { + opacity: 1; +} + +h1, h2, h3, h4, h5, h6{ + a:hover { + background-color: transparent; + } +} + ul { margin-top: 0; } @@ -91,7 +115,7 @@ a:hover { color: var(--hover-color); } -a:not(.no-hover-padding)::before { +a:not(.no-hover-padding, .zola-anchor)::before { content: ""; position: absolute; top: 0;