« 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
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-24 13:45:10 -0400
commit82bb115d8404b88fe8b1af1bf714b3c70969f99b (patch)
tree457371441eea546db9f908608954d88b6f337db6
parent8b81a3aa4e266548ef2c8083391f6bb859915133 (diff)
css: allow custom scroll margin offset per-element
-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 c1dfff82..fb3cf057 100644
--- a/src/static/site5.css
+++ b/src/static/site5.css
@@ -1380,6 +1380,10 @@ h3.content-heading {
 
 /* Sticky heading */
 
+[id] {
+  --custom-scroll-offset: 0px;
+}
+
 #content [id] {
   /* Adjust scroll margin. */
   scroll-margin-top: calc(
@@ -1387,6 +1391,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 */
   );
 }