Mastering Sticky Headers on BigCommerce Cornerstone: A UX-First Approach
Mastering Sticky Headers on BigCommerce Cornerstone: A UX-First Approach
A sticky header, visible at the top of the screen as users scroll, enhances navigation and user experience by keeping crucial elements accessible. A recent BigCommerce forum discussion highlighted this common request for the Cornerstone theme, revealing important considerations beyond basic implementation.
The Basic CSS Solution for Sticky Headers
The thread began with a query for a sticky header on desktop and mobile for the Cornerstone theme. While Cornerstone typically provides a sticky header on mobile, desktop requires custom CSS. BigCommerce partners Daniel Olvera and Sajid Jameel provided the straightforward solution:
.header {
position: sticky;
top: 0;
z-index: 999;
}
This CSS uses position: sticky to make the header adhere to the viewport's top (top: 0) and z-index: 999 to ensure it overlays other content.
Implementing the CSS on BigCommerce
You can add this CSS to your BigCommerce store via:
- Storefront > Custom CSS: Paste the CSS directly.
- Script Manager: Create a script, set placement to Head and load on All Pages, then paste the CSS wrapped in
- Theme File Editor: For developers, edit theme files (Storefront → My Themes → Edit Theme Files). Add the CSS to
assets/css/theme.cssor embed theblock withintemplates/layout/base.html'ssection.
The Critical UX Consideration: Tall Headers and Screen Real Estate
While basic CSS makes the header sticky, the discussion, particularly Sajid Jameel's input, highlighted a crucial user experience (UX) pitfall. If a desktop header is initially tall—featuring a stacked logo, utility bar, and navigation—making that entire block sticky consumes significant screen space. This "oversized" sticky header pushes product listings and calls-to-action out of view, negatively impacting:
- Trust & Credibility: An unprofessional, overly large sticky header can deter users.
- Conversions: Limited visibility of product content can lead to user disengagement.
- Desktop UX: Users expect a minimal sticky header that doesn't obstruct browsing.
The "Proper Fix": A Compact Sticky Header
The recommended best practice for desktop is a "compact sticky header." This slimmed-down version appears once the user scrolls past the initial full header. Essential elements like the logo, main navigation, and cart icon are arranged horizontally, taking minimal vertical space—a proven UX standard for top-converting e-commerce stores.
Implementing a compact sticky header typically requires more advanced theme customization, often involving JavaScript to detect scroll position and dynamically change header classes or content. The forum thread provided the basic CSS but emphasized that achieving the compact version requires additional development work.
Conclusion
Adding a sticky header to your BigCommerce Cornerstone theme is valuable. While basic CSS offers a quick fix, optimal desktop UX demands consideration of header height and layout. A compact sticky header, though requiring advanced customization, offers significant UX improvement, positively impacting engagement and conversion rates. Merchants should weigh the benefits of a simple CSS solution against the long-term gains of a professionally implemented, compact sticky header.