Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve scroll-dependent navbar style
The setup before was over complicated, because I tried to use IntersectionObserver to check if navbar was intersecting with the main element before styling it with a border etc. This kind of worked, but it broke testing with Cypress because the website was rendered inside an iframe, which the IntersectionObserver API has issues when using implicit root and rootMargin, see w3c/IntersectionObserver#283 (comment) for details. Now, I simplified it to get rid of IntersectionObserver. Now, the border is applied when we detect that the page scroll is greater than the navbar height. Also, the navbar will get hidden every time the user scrolls down, regardless of where in the page (before this commit, this only happened after the top of the viewport intersected with the main element).
- Loading branch information