How can I add a border to all color swatches on my product pages?

Topic summary

A user needs to add borders to color swatches on product pages because white swatches are invisible against the white site background, and partially white swatches look unappealing.

Two solutions were provided:

Solution 1 (Made4uo-Ribe):

  • Navigate to Shopify admin → Online Store → Themes → Actions → Edit code
  • Open the Assets folder and locate base.css, style.css, or theme.css
  • Add CSS at the bottom:
.color-swatch:checked + .color-swatch.is-selected {
  border-color: red;
}
.color-swatch.rounded-full {
  border: 1px solid black;
}
  • This adds black borders to all swatches and a red border to selected ones (colors customizable)

Solution 2 (PageFly-Henry):

  • Go to Online Store → Theme → Edit code
  • Search for theme.css file
  • Add at bottom:
a.color-swatch.rounded-full {
  border: 1px solid !important;
}

Both approaches involve adding CSS to apply borders to color swatch elements. The original poster was advised to mark the helpful solution.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

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

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