« get me outta code hell

css: allow custom scroll margin offset per-element - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-21 07:23:58 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-21 07:49:42 -0400
commit45fb872e3c9db62da126c94c3219133b4945b532 (patch)
tree94a465ce7932d5dadc4ece09d459402c3a9123a5 /src
parent92fc43c31f08d477c95524bc4a04b11ecb8fb5d1 (diff)
css: allow custom scroll margin offset per-element
Diffstat (limited to 'src')
-rw-r--r--src/static/site5.css5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/static/site5.css b/src/static/site5.css
index bb83fe67..6cdc0c35 100644
--- a/src/static/site5.css
+++ b/src/static/site5.css
@@ -1310,6 +1310,10 @@ h3.content-heading {
 
 /* Sticky heading */
 
+[id] {
+  --custom-scroll-offset: 0px;
+}
+
 #content [id] {
   /* Adjust scroll margin. */
   scroll-margin-top: calc(
@@ -1317,6 +1321,7 @@ h3.content-heading {
     + 33px /* Sticky subheading */
     - 1em  /* One line of text (align bottom) */
     - 12px /* Padding for hanging letters & focus ring */
+    + var(--custom-scroll-offset) /* Customizable offset */
   );
 }