Change a single menu color on Pipeline

Solved

Change a single menu color on Pipeline

JulianDavis
Tourist
8 0 2

Hi! 

 

I have done this before, but not in the pipeline theme, I am not sure if that is the problem or not! By chance, does anyone know how to change the color of one menu bar item (SALES) to red?  

I tried this: 

.nav-bar__item a[href="/collections/2023-gift-guide"] { color: red; }

 

However, it did not work! Does anyone have any suggestions? 

 

Our website : maisondavis.ch

 

Thanks in advance

Accepted Solution (1)

Michael-Thomas
Shopify Partner
66 12 14

This is an accepted solution.

Under the header try adding the following CSS into the custom CSS field.

 

To change the "SALES" menu item to red, use this CSS targeting its specific link:

 

/* Target the SALES menu item by its URL */
.navlink[href="/collections/sales"] .navtext {
  color: red !important;
  /* If needed, also change hover color: */
  transition: color 0.2s;
}

.navlink[href="/collections/sales"]:hover .navtext {
  color: #cc0000 !important;
}

 


Explanation:

  1. Uses an attribute selector [href="/collections/sales"] to target the specific menu item

  2. Targets the text element with class .navtext

  3. !important ensures it overrides existing styles

  4. Added hover state for better interaction

Pro Tip: If your theme uses CSS variables, you could alternatively override the color variable:

css
Copy

 

.navlink[href="/collections/sales"] {
  --navtext-color: red !important;
}

 

 

Hope that helps. 

Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!

View solution in original post

Replies 9 (9)

goldi07
Trailblazer
143 9 16

Hello @JulianDavis 

1.Go to Shopify Admin → Online Store → Themes.
2.Click "Edit Code" on your active theme.
3.Open base.css, theme.css, or stylesheet.css (whichever your theme uses in the assets folder).
4.Scroll to the bottom of the file.
5.Paste the CSS code above.

.site-nav__link[href="/collections/2023-gift-guide"],
.nav-bar__item a[href="/collections/2023-gift-guide"] {
    color: red !important;
}

6.Click Save and refresh your site.

Thank you 😊

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here
JulianDavis
Tourist
8 0 2
Hello Goldi,

Thank you,

I tried but it doesn't work,
Should I replace 2023-gift-guide with sales? I tried but it doesn't work
goldi07
Trailblazer
143 9 16

Hey @JulianDavis 

Ensure the correct URL path is used

right-click the SALES menu item on your website.
. Select Inspect and check the exact href value in the <a> tag.
. The href might not be /collections/sales; it could be something like /pages/sales or a different collection name.
. Try a more specific selector

If the original CSS doesn’t work, try this alternative:

 

a.site-nav__link[href*="sales"],
.nav-bar__item a[href*="sales"] {
    color: red !important;
}

 

. This targets any link that contains "sales" in the URL, even if it’s /collections/sales, /pages/sales, or something else.

 

. do a Hard Refresh

After saving, you should press Ctrl + Shift + R (Windows) or Cmd + Shift + R (Mac) to clear the cache and see the changes.

Thank you 😊

 

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here
JulianDavis
Tourist
8 0 2

Thank you very much Goldie,

I tried a lot of alternative but unfortunately it didn't work..

 

When I inspect the link, here is what I find:
<a href="/collections/sales" data-top-link="" class="navlink navlink--toplevel">
<span class="navtext">SALES</span>
</a>

<span class="navtext">SALES</span>

 

Do you see a reason why it wouldn't work?

Thank you again

goldi07
Trailblazer
143 9 16

Hey @JulianDavis 

Based on the inspected HTML you provided, your original CSS didn’t work likely because of class specificity. Try this updated CSS:

 

 .navlink.navlink--toplevel[href="/collections/sales"] {
    color: red !important;
}

 

 

Explanation:
. . navlink.navlink--toplevel is the class assigned to your menu items.
. [href="/collections/sales"] ensures we are only targeting the SALES menu item.
. !important forces the style to override other CSS rules.

 

If That Doesn't Work:
Try this alternative, which specifically targets the <span> inside the link:

 

 

.navlink.navlink--toplevel[href="/collections/sales"] .navtext {
    color: red !important;
}

 

Final Steps:
1. Add the CSS to your theme (Online Store → Themes → Customize → Edit Code → theme.css or base.css).
2. Save the file.
3. Hard Refresh the page (Ctrl + Shift + R on Windows or Cmd + Shift + R on Mac) to clear cache and see the update.

 

Thank you 😊

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here

Michael-Thomas
Shopify Partner
66 12 14

This is an accepted solution.

Under the header try adding the following CSS into the custom CSS field.

 

To change the "SALES" menu item to red, use this CSS targeting its specific link:

 

/* Target the SALES menu item by its URL */
.navlink[href="/collections/sales"] .navtext {
  color: red !important;
  /* If needed, also change hover color: */
  transition: color 0.2s;
}

.navlink[href="/collections/sales"]:hover .navtext {
  color: #cc0000 !important;
}

 


Explanation:

  1. Uses an attribute selector [href="/collections/sales"] to target the specific menu item

  2. Targets the text element with class .navtext

  3. !important ensures it overrides existing styles

  4. Added hover state for better interaction

Pro Tip: If your theme uses CSS variables, you could alternatively override the color variable:

css
Copy

 

.navlink[href="/collections/sales"] {
  --navtext-color: red !important;
}

 

 

Hope that helps. 

Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!

JulianDavis
Tourist
8 0 2

THANK YOU IT WORKED!!!
I also noticed I had to adjust the link according to the language I'm usingon the website

For exemple, for the french version, I needed to add /fr/collections/sales

anyway, it works perfectly, thank you very much!!

JulianDavis
Tourist
8 0 2

New problem unlocked:

On the mobile, it doesn't has the red color...

 

Any trick?

Michael-Thomas
Shopify Partner
66 12 14

Give this a try.

 

/* Target SALES menu item on mobile */
.sliderow__title[href="/collections/sales"] {
  color: red !important;
}

/* Optional: Change color on hover */
.sliderow__title[href="/collections/sales"]:hover {
  color: #cc0000 !important;
}

 

Hope that helps. 

Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!