Skip to content

Commit

Permalink
#47 Adds spacing to anchor links when sticky header is true
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>

Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>
  • Loading branch information
thetwopct committed May 21, 2024
1 parent dd70ac6 commit 293e026
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
{{- template "_internal/google_analytics.html" . -}}
{{- partial "head/custom-css.html" . }}
{{- partial "head/custom-head.html" . }}
{{- partial "head/sticky-header.html" . }}
</head>
13 changes: 13 additions & 0 deletions layouts/partials/head/sticky-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if .Site.Params.sticky_header }}
<style>
:target {
scroll-margin-top: 80px;
}

@media (min-width: 1000px) {
:target {
scroll-margin-top: 100px;
}
}
</style>
{{ end }}

0 comments on commit 293e026

Please sign in to comment.