hd-garden 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,11 +40,16 @@ const getCssScrollPaddingTop = () => {
|
|
|
40
40
|
return Number.isFinite(offset) ? offset : 0;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
// Where a heading should stop: the page's scroll-padding-top, the same
|
|
44
|
+
// offset the browser uses for a #link, so a script jump never differs from
|
|
45
|
+
// the native one. If that padding would leave the heading under the sticky
|
|
46
|
+
// header, stop 16px below the header instead.
|
|
43
47
|
const getScrollPaddingTop = () => {
|
|
44
|
-
const
|
|
48
|
+
const padding = getCssScrollPaddingTop();
|
|
49
|
+
const header = document.querySelector(".sh-header, .site-header");
|
|
45
50
|
const headerBottom = header?.getBoundingClientRect().bottom ?? 0;
|
|
46
|
-
if (headerBottom > 8) return headerBottom +
|
|
47
|
-
return
|
|
51
|
+
if (headerBottom > 8 && padding < headerBottom) return headerBottom + 16;
|
|
52
|
+
return padding > 0 ? padding : 24;
|
|
48
53
|
};
|
|
49
54
|
|
|
50
55
|
const getReadingProbe = () => {
|
package/app/globals.css
CHANGED
|
@@ -3035,7 +3035,10 @@ html[data-theme="dark"] .article-references {
|
|
|
3035
3035
|
}
|
|
3036
3036
|
|
|
3037
3037
|
.giscus-container {
|
|
3038
|
-
|
|
3038
|
+
/* giscus's empty state (reactions + sign-in box) is 372px tall at every
|
|
3039
|
+
width; reserving it keeps the footer still when the frame loads. More
|
|
3040
|
+
comments simply make it taller. */
|
|
3041
|
+
min-height: 372px;
|
|
3039
3042
|
margin-top: 24px;
|
|
3040
3043
|
}
|
|
3041
3044
|
|