Color swatches in 2...
 
Notifications
Clear all

Color swatches in 2.0: extending colors

4 Posts
3 Users
2 Reactions
1,231 Views
remi
 remi
(@remi)
Active Member
Joined: 4 years ago
Posts: 12
Topic starter  

Hi 🙂

Plaktheme 2.0 is very nice! I like the color swatches that really make it easy to filter.

My question is: I have some exotic colors that it doesn't recognise yet. Can I add some css somewhere to make the color class known, so it can display it? I do have color names and hex color codes readily available so I could generate some css for them. If you could help me a bit and tell me where please? Example: Dark Azure: #3399ff;

Thanks in advance! 👍 

Remi


   
Quote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 

Hi @remi

Such a good question 😉

Here is how to add some CSS to show the desired color for each tagged special color.

 

  • From your Shopify dashboard, click Online store > Actions > Edit code
  • Open the file collection_tag-filter.liquid
  • On the CSS in line number 44 replace the entire code between <style> and </style> with this one
 .{{tag}} .fa.fa-circle-o.fa-lg{
background:#3399ff;
border-radius: 50%;
border: 1px solid grey;
{% if tag contains 'dark_azure' %}
color:#3399ff;
background:#3399ff;
{% else %}
color:{{tag}};
background:{{tag}};
{% endif %}
}
  • If you would like to add a second special color (ex : Light Green) you can use this code instead
 .{{tag}} .fa.fa-circle-o.fa-lg{
background:#3399ff;
border-radius: 50%;
border: 1px solid grey;
{% if tag contains 'dark_azure' %}
color:#3399ff;
background:#3399ff;
{% elsif tag contains 'light_green' %}
color:#EAFCCE;
background:#EAFCCE;
{% else %}
color:{{tag}};
background:{{tag}};
{% endif %}
}
  • Click Save

 

Note : Remember to use an underline for your special colors, like dark_azure and light_green

Let me know if you have any other questions

Kind regards,
Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
remi reacted
ReplyQuote
remi
 remi
(@remi)
Active Member
Joined: 4 years ago
Posts: 12
Topic starter  

Thanks a lot @plaktheme 😍 

Hacked around a bit because my color tags have spaces, but from this starting point that was easy to do. Then generated the css statements and pasted in the file (our 12K products have about 100 different color names). Also handled translations that way. Very happy with the result! See screenshot for a small sample. Woohoo!


   
ReplyQuote
Jasmine Keinsh
(@plakadmin)
Estimable Member Admin
Joined: 4 years ago
Posts: 131
 

Hi @remi

My name is Jasmine, a new Shopify expert from Plak support here,

Your color swatches look pretty cool ! You did a great job with the assistance of Katrine 🙂

Enjoy your weekend Remi and feel free to get to back to us whenever you need help.

Jasmine

Jasmine | Plak theme support
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple