Hi,
I am using the impulse theme and there is no option to change the color of an active menu link.
Need to enable this for both Header and Footer menus.
Can you guys help me do this please?
Thanks,
Hi,
I am using the impulse theme and there is no option to change the color of an active menu link.
Need to enable this for both Header and Footer menus.
Can you guys help me do this please?
Thanks,
Hey @MKsac
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hey @MKsac
Follow these Steps:
Go to Online Store
Edit Code
Find theme.liquid file
Add the following code in the bottom of the file above tag
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
document.addEventListener("DOMContentLoaded", function() {
// Select all menu links
const menuLinks = document.querySelectorAll(".site-nav__link");
const currentPath = window.location.pathname;
// Loop through each link and check if it matches the current URL
menuLinks.forEach(link => {
if (link.href.includes(currentPath)) {
link.classList.add("active");
}
});
});
/* Active menu link styling */
.site-nav__link.active {
color: #FF5733 !important; /* Replace with your desired color */
font-weight: bold; /* Optional: Make it bold */
text-decoration: underline; /* Optional: Underline the link */
}
/* Optional: Active state for dropdown links */
.site-nav__dropdown .site-nav__link.active {
background-color: #f0f0f0; /* Highlight dropdown active link */
}