Remove border around variant swatch that is "white"

Topic summary

A user seeks CSS code to remove the border appearing around white color variant swatches in the Prestige theme on their Shopify store.

Initial Solution:

  • The user applied .border { border-width: 0px; } which removed the border but raised concerns about unintended side effects across the site.

Community Feedback:

  • One respondent confirmed the original CSS targets all .border class elements site-wide, potentially affecting product cards, buttons, and other components.
  • A more specific solution was suggested: targeting .color-swatch--white or .color-swatch--#ffffff with border: none !important; to isolate the fix.

Refined Approach:

  • Another contributor recommended using .color-swatch.border { border-width: 0; } combined with :checked + .color-swatch.border { border-width: 1px; } to remove borders on unselected swatches while restoring them when selected.

Status: Multiple CSS solutions provided; discussion remains open for implementation feedback.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Looking for css code to add to by store theme to remove the boarder that shows up on just the white variant in the prestige theme. Site is blomus.us

You can see it on this page: Soap Dispenser - SONO

1 Like

All I did to fix it was put the code below but I am not sure if it messes with other functions on the site.

.border {
border-width: 0px;
border-color: rgb(var(–border-color));
}

1 Like

that CSS you added will indeed remove the border, but it also targets every element using the .border class across your site (not just the color swatch). That means it could unintentionally affect product cards, buttons, or other components using that same class.

A safer fix is to make the CSS more specific so it only applies to the white color swatches for example:

.color-swatch--white,
.color-swatch--#ffffff {
  border: none !important;
  box-shadow: none !important;
}

That keeps your global borders intact while cleaning up the issue on the product grid.

If you want I can help check your theme’s structure and make sure no other components are affected.

Hi @Christa_Michel

This selector is too broad. Another problem with this is that when “White” is selected, it does not show. I’d rather use this:

.color-swatch.border {
  border-width: 0;
}
:checked + .color-swatch.border {
  border-width: 1px;
}

This will remove border on a swatch, but will restore it when it’s selected.