About this set
A fixed header that sits transparent over a full-height hero, with white text on the dark teal gradient, and turns into a compact white bar with dark text and a soft shadow as soon as the page scrolls more than 40px. The logo, the four links (Routes, Guides, Gear, Journal) and the Book a trek button all swap colours, and the bar shrinks from 74px to 62px, with each change animated by CSS transitions. A short scroll listener toggles a .solid class, so the styling for both states lives in the stylesheet. On screens narrower than 992px the links move into a panel behind a menu button; opening it also makes the header solid so the list stays readable over the photo or gradient underneath. Use it for travel, hospitality, agency and product pages that open with a large hero image. Without JavaScript the header stays transparent, so keep the script if the page scrolls onto a light background. The Bootstrap version is a .navbar.fixed-top with the Collapse plugin, and the Tailwind version styles the solid state with group-[.solid] variants.
What’s included
- Transparent over the hero, solid and shorter after 40px of scroll
- Colours, height and shadow change with CSS transitions
- Opening the phone menu turns the header solid
- Book a trek button stays visible at every width
- Scroll listener is passive and only toggles one class
Accessibility
The links are in a nav labelled Main with aria-current="page" on Routes. The menu button carries aria-expanded and aria-controls, and Esc closes the menu and returns focus to it. Focus outlines are white over the hero and teal once the header is solid, and all transitions switch off under prefers-reduced-motion.
Customise it
Edit --ht-ink and --ht-muted and the .solid rules for the scrolled colours; the 40 in the script is the scroll distance. Bootstrap maps both states onto --bs-navbar-* variables; in Tailwind change the --color-ht-* theme colours and the group-[.solid] utilities.



















