Hey there.
I’m looking to change the logo in my header when somebody hovers over it. The logos are identical apart from 1 subtle change, so I’d like them to overlay each other perfectly. I don’t want any sort of effect. Just switching from one logo/image to another when you mouse over it. I’m using the latest Dawn theme.
Thank you
Hi there!
You can swap the logo on hover in Dawn by adding this CSS under Theme Settings → Custom CSS or in base.css:
.header,heading-logo img {
content: url(“https://your-default-logo.png”);
}
.header,heading-logo:hover img {
content: url(“https://your-hover-logo.png”);
}
Just replace the image URLs with your own — it will instantly switch the logo with no animation. Let me know if you need help inserting it!
1 Like
Thank you for the reply but this doesn’t seem to work.
It’s giving invalid url errors.
1 Like
I’m using the dawn theme and yes, it’s just for the logo in the header. Thank you
1 Like
Hey @mikeylew 
Two easy ways to swap the header logo on hover in Dawn. No effects—just a clean switch.
Option A — CSS-only (fastest)
-
Upload your hover logo to Assets (e.g., logo-hover.png).
-
Add this to assets/base.css (bottom):
/* Swap header logo on hover (Dawn) */
.header__heading-link:hover img {
content: url('{{ "logo-hover.png" | asset_url }}');
}
Make sure the hover image has exactly the same canvas size as your normal logo so it overlays perfectly and doesn’t shift the header.
Option B — Two images stacked (most robust)
If you prefer not to rely on content:url, render two logos and toggle opacity.
- In sections/header.liquid, find the logo
<img> and replace it with:
<a href="{{ routes.root_url }}" class="header__heading-link" style="position:relative;display:inline-block">
<img
src="{{ settings.logo | image_url }}"
alt="{{ shop.name }}"
class="logo-primary"
width="{{ settings.logo.width }}"
height="{{ settings.logo.height }}"
loading="eager"
>
<img
src="{{ 'logo-hover.png' | asset_url }}"
alt="{{ shop.name }}"
class="logo-hover"
width="{{ settings.logo.width }}"
height="{{ settings.logo.height }}"
loading="eager"
>
</a>
- Add to base.css:
.logo-primary,
.logo-hover {
display:block;
width:100%;
height:auto;
}
.header__heading-link .logo-hover {
position:absolute;
inset:0;
opacity:0;
}
.header__heading-link:hover .logo-hover { opacity:1; }
.header__heading-link:hover .logo-primary { opacity:0; }
That’s it—no animation, just an instant swap on hover.
(If you also want it on focus for keyboard users, duplicate the :hover rules with :focus-visible.)
You can check out our Shopify Partner profile — we’ve built and shared several free Shopify app solutions to help store owners. Feel free to explore our profile and see how our apps can make your Shopify experience better!
Heya
Neither of these seem to work but I’m not exactly sure what I’m doing.