From 5edc8a488aedee01ea2e360ce331c2c1120eb511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 26 Dec 2018 10:07:32 -0500 Subject: [PATCH] Attempt to keep anchor targets below the fixed header Largely using the CSS technique from https://stackoverflow.com/a/28824157/1028376 --- agaric/sass/agaric/_component.navbar.scss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/agaric/sass/agaric/_component.navbar.scss b/agaric/sass/agaric/_component.navbar.scss index d0531d5..e2394d3 100644 --- a/agaric/sass/agaric/_component.navbar.scss +++ b/agaric/sass/agaric/_component.navbar.scss @@ -28,6 +28,26 @@ } } +// Attempt to keep anchor targets below the fixed header rather than having its +// associated content hidden behind the header; hence the height and negative +// margin here match the fixed header height at different breakpoints. +:target::before { + content: ""; + display: block; + height: 3.3125em; + margin: -3.3125em 0 0; + @include desktop { + height: 5.875em; + margin: -5.875em 0 0; + } +} + +a:target, +a:target:hover { + padding: 0; + margin: 0; +} + .navbar { color: $white; background-color: $dark;