DISCOVER-Cookbook icon indicating copy to clipboard operation
DISCOVER-Cookbook copied to clipboard

Fix: prevent section headings from being hidden behind sticky navbar

Open dineshkolhe1 opened this issue 1 month ago β€’ 2 comments

Summary

Fixed an issue where clicking internal navbar anchors (About, Versions, Contribute) caused the section titles to appear hidden behind the sticky navbar.

Changes

  • Added this into html
  • Added scroll-padding or scroll-margin CSS to offset anchor jumps.
  • Verified layout on both light and dark themes.

How I tested

  1. Ran python -m http.server locally.
  2. Opened http://localhost:8000
  3. Clicked all navigation links β€” headings now align correctly below the navbar.

Screenshots

Before -
Screenshot 2025-11-13 230010

After - Screenshot 2025-11-14 005207


Fixes #426

dineshkolhe1 avatar Nov 13 '25 19:11 dineshkolhe1

Deploy Preview for stupendous-kringle-a86e81 ready!

Name Link
Latest commit c07b12e9598c19d77787de4a75f726ee26464b07
Latest deploy log https://app.netlify.com/projects/stupendous-kringle-a86e81/deploys/69163094eb208d00085d4e0c
Deploy Preview https://deploy-preview-427--stupendous-kringle-a86e81.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Nov 13 '25 19:11 netlify[bot]

Can we please include this snippet at the end (under the

const navbarCollapse = document.getElementById('navbarNav');
        const navList = document.querySelector('.navbar-nav');
        
        navList.addEventListener('click', (e) => {
            if (e.target.closest('.nav-link')) {
                bootstrap.Collapse.getOrCreateInstance(navbarCollapse).hide();
            }
        });

AR21SM avatar Nov 23 '25 08:11 AR21SM