Jump to content

Can you define categories with specific colours?

Go to solution Solved by RyanDejaegher,

Recommended Posts

For an events summary section, I would like to make different categories appear in specific colours under the event thumbnail. Is this possible? For example, 'Category A' will appear in green text, and 'Category B' will appear in red etc...

Thanks!

Link to comment
  • Solution

@JButler yes you can customize the style for category links, you'll need to copy the link/url and copy it to the code below. You can do this with blog categories or shop categories. 

/* Add this code to Design -> Custom CSS */

a[href="/shop?category=tumblers"] {
  color: red;
}

a[href="/shop?category=straws"] {
  color: blue;
}

Here's an example from another site with this code in place
image.thumb.png.cd0eaf57f876fa426a577019cc2b391b.png

Philadelphia, PA

👉 Squarespace Tutorials 

Chat/Message on FB Messenger for quickest responsehttps://m.me/dejaegherryan

 

Link to comment
  • 6 months later...

Hi - 
I have tried using the code above, but I couldn't get it to work for my site - does anyone have any suggestions. 

I have tried a number of different inputs - original here. 

a[href="/shop?category=tumblers"] {
  color: red;
}

This is what I have input

- a[href="/Print-shop?category=Last-Chance"] {
  color: red;
}

The category I am trying to make red is "Last Chance" in Categories it is written with capitals like that "Last Chance" and the SHOP is Print shop or the url is /prints

Thanks for your help. 
Beanie



 

Link to comment
On 12/30/2020 at 10:23 PM, Beanie said:

Hi - 
I have tried using the code above, but I couldn't get it to work for my site - does anyone have any suggestions. 

I have tried a number of different inputs - original here. 


a[href="/shop?category=tumblers"] {
  color: red;
}

This is what I have input

- a[href="/Print-shop?category=Last-Chance"] {
  color: red;
}

The category I am trying to make red is "Last Chance" in Categories it is written with capitals like that "Last Chance" and the SHOP is Print shop or the url is /prints

Thanks for your help. 
Beanie



 

Try this code. If it doesn't work, please share site url, we can check easier

a[href*="Last-Chance"] {
  color: red !important;
}

 

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
  • 4 weeks later...
On 1/27/2021 at 7:12 AM, Beanie said:

Hi, thank you - I finally tried this - with a different category, as I currently do not have "Last Chance" active. 
I tried this: 
a[href*="Mountains"] {
  color: red !important;
}

For the Mountain category: https://www.terorepo.com/prints

but it did not work, so any help appreciated. Many thanks - does that URL work ok? 
Cheers 
 

Your typo

a.nested-category-breadcrumb-link[href*="mountains"] {
    color: red;
}

 

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
  • 10 months later...
On 12/30/2020 at 8:23 AM, Beanie said:

Hi - 
I have tried using the code above, but I couldn't get it to work for my site - does anyone have any suggestions. 

I have tried a number of different inputs - original here. 

a[href="/shop?category=tumblers"] {
  color: red;
}

This is what I have input

- a[href="/Print-shop?category=Last-Chance"] {
  color: red;
}

The category I am trying to make red is "Last Chance" in Categories it is written with capitals like that "Last Chance" and the SHOP is Print shop or the url is /prints

Thanks for your help. 
Beanie



 

This also wasn't working for me until I removed the case. Did you try:


a[href="/print-shop?category=last-chance"] {
  color: red !important;

 

once I made everything lowercase and slapped and important tag on it, it worked.

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.