Documentation
Masthead — Responsive Header Templates
Version 1.0.0 · Vanilla HTML · 10 files · 58 KB
Getting started
- Unzip the download and open index.html in a browser. No server, installation or build step is needed.
- Edit the text directly in the HTML files.
- Change colours, fonts and spacing through the CSS custom properties at the top of assets/css/style.css.
- Replace the artwork in assets/images/ with your own images.
- Upload the whole folder to any static host.
File structure
The download contains these 10 files:
- LICENSE.txt1.3 KB
- README.md2.6 KB
- assets/css/style.css19 KB
- assets/fonts/hanken-grotesk-LICENSE.txt4.4 KB
- assets/fonts/hanken-grotesk-latin-wght-normal.woff234 KB
- assets/images/favicon.svg336 B
- assets/js/main.js6.6 KB
- documentation/index.html11 KB
- documentation/licenses/lucide-LICENSE.txt3.1 KB
- index.html24 KB
Colours
These custom properties are defined at the top of the stylesheet. Change a value once and it updates everywhere it is used.
--color-bg#f6f7f9--color-surface#ffffff--color-ink#111827--color-muted#4b5563--color-line#e5e7eb--color-accent#2563eb--color-accent-strong#1d4ed8--color-accent-soft#eff4ff--mh-hover#f1f3f6--mh-accent-fg#fff
Interactive features
Mobile menu
Add a button with data-menu-toggle and aria-controls set to the id of your nav. The script toggles aria-expanded and an is-open class; the CSS shows the nav below 900px only when that class is present.
Dropdowns and mega panels
Put a button with data-dropdown and aria-controls inside an element with the class mh__item, followed by the panel with the matching id and the hidden attribute. Style the panel as .mh__drop or .mh__panel.
Solid on scroll
Add data-solid-on-scroll="40" to the header. It gains the class is-solid once the page, or the closest ancestor with data-scroll-root, has scrolled that many pixels. Remove data-scroll-root in a real site to use the window.
Search toggle and cart badge
The phone search toggle uses data-search-toggle with aria-controls pointing at the form. The demo cart badge is the [data-cart-count] element; replace the click handler section in main.js with your own cart logic.
Customisation notes
Change the breakpoint
Headers switch layout at 900px. Search style.css for min-width: 900px and replace it everywhere, and update the matching media query in assets/js/main.js.
Re-theme a header
Each header reads --mh-bg, --mh-fg, --mh-muted, --mh-line, --mh-hover and --mh-accent. Override them on the header's modifier class, as the five variants do, instead of editing the shared base.
Copy one header
Copy its HTML block, then CSS section 1 tokens, section 2 (shared base) and the section for that header. The demo-page styles in section 8 are not needed.
Swap the brand marks
Each logo is an inline SVG with class mh__mark followed by the brand name. Replace it with your own SVG or an img tag with width and height.
What is front-end only
This is a front-end template. The behaviours below are demonstrations that run in the browser; connect them to your own server or service before relying on them.
- The header search field is not connected to anything; submitting it only shows a demo message.
- The cart badge in header 4 counts button clicks and stores nothing.
- All brand names, links and menu items are fictional placeholders.
Bundled components and licences
Everything the template needs is inside the download; nothing is loaded from the network.
- Hanken Grotesk typeface — OFL-1.1 (
assets/fonts/hanken-grotesk-LICENSE.txt) - Lucide icons (inlined SVG) — ISC (
documentation/licenses/lucide-LICENSE.txt)
Changelog
Version 1.0.0 · Nov 23, 2026
- Initial release.