New Shopify Certification now available: Liquid Storefronts for Theme Developers

Adding A Boarder For Colour Swatches

zieglj
Visitor
1 0 1

Hi guys,

 

On our product pages, we have colour swatches like shown below, sometimes using html colour codes and sometimes using files (for the multi-coloured products). The white color swatch is invisible because the main background colour of our site is white, and we also don't like the look of the colour swatches that are half white. How can I add a thin black line to all swatches, not just the selected colour (grey in the example below)? 

I would appreciate your help. 

 

Bildschirmfoto 2023-10-29 um 19.38.10.png

URL: https://cradlestudio.de/products/100-baumwolle-piquee-kissen-007-pebble 

Replies 2 (2)
Made4uo-Ribe
Shopify Partner
4202 967 1175

Hi @zieglj

Here a thing, when you selected a color there is a border color black. What I did I colored it red. and the none selected color black border. You can change the color you like. 

  • From your Shopify admin dashboard, click on "Online Store" and then "Themes".
  • Find the theme that you want to edit and click on "Actions" and then "Edit code".
  • In the "Assets" folder, click on "base.css, style.css or theme.css" file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

 

:checked+.color-swatch, .color-swatch.is-selected {
    border-color: red;
}
.rounded-full {
    border: 1px solid black;
}

 

  • And Save. 
  • Result;
  • Made4uoRibe_0-1698606144656.png

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
Need a knowledgeable developer? Come and visit us at

Made4uo.com


PageFly-Henry
Globetrotter
504 130 104

Hi @zieglj 

This is Henry from PageFly - Landing Page Builder App

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.css

Step 3: Paste the below code at bottom of the file -> Save

 

a.color-swatch.rounded-full {

    border: 1px solid !important;

}

 

Hope that my solution works for you.

Best regards,

Henry | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.