Jump to content

Custom CSS for shop navigation categories but NOT subcategories

Recommended Posts

Site URL: https://blenny-octagon-5nrn.squarespace.com/shop/melissa%C2%A0

I have a client's site where I have used some CSS to make the 2nd child in the shop nav a different style so it stands out. This worked fine until she added some subcategories and the CSS is applying to the 2nd item there as well. I can tweak the code to apply only to the 2nd child in the subcategory list but the other way around.

The current code I'm using is below. Anyone have thoughts on a solution to exclude the subcategories from this? 

.products.collection-content-wrapper .nested-category-tree-wrapper li:nth-child(2) {
  color: rgb(102, 43, 125);
  font-weight: 700;
  text-transform: uppercase;
}

 

Read my eCommerce Blog or Subscribe to my eCommerce Newsletter for all things Squarespace x eCommerce. 

Link to comment
  • Replies 6
  • Views 678
  • Created
  • Last Reply
On 3/23/2021 at 11:51 PM, KristineNeilStudio said:

@tuanphan sorry about that. Here is the correct URL: https://blenny-octagon-5nrn.squarespace.com/shop/melissa

Edit this class

.products.collection-content-wrapper .nested-category-tree-wrapper li:nth-child(2)

to this

.products.collection-content-wrapper .nested-category-tree-wrapper ul>li:nth-child(2)

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/25/2021 at 10:29 PM, KristineNeilStudio said:

This didn't change anything but I feel like we must be close! 🤏

Edit to this class

.products.collection-content-wrapper .nested-category-tree-wrapper>ul>li:nth-child(2)

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.