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
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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.