From 297f88bae339909812711ba1b00a89170e09878a Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:17:05 +0800 Subject: [PATCH] Rename sticky navbar class --- src/_includes/main/navbar.njk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_includes/main/navbar.njk b/src/_includes/main/navbar.njk index b926f8ca..ecf6ddcb 100644 --- a/src/_includes/main/navbar.njk +++ b/src/_includes/main/navbar.njk @@ -46,7 +46,7 @@ } /* Added to the navbar with JS when it reaches its scroll position */ - .sticky-nav { + .nav--sticky { position: fixed; width: 100%; top: 0; @@ -55,7 +55,7 @@ /* Add some top padding to the page content to prevent sudden quick movement as the navigation bar gets a new position at the top of the page (position:fixed and top:0) */ - .sticky-nav + main { + .nav--sticky + main { padding-top: 2rem; } @@ -68,9 +68,9 @@ const scrollPos = window.scrollY || document.documentElement.scrollTop; const stickyLine = hero.scrollHeight - navbar.scrollHeight; if (scrollPos > stickyLine) { - navbar.classList.add("sticky-nav"); + navbar.classList.add("nav--sticky"); } else { - navbar.classList.remove("sticky-nav"); + navbar.classList.remove("nav--sticky"); } }); \ No newline at end of file