Shopify themes, liquid, logos, and UX
Hi,
I am trying to add borders around all colour swatches so that lighter colours are more obvious against a light background. I would also like to add a check mark in the selected option so that it is obvious what is selected.
Is this possible?
I have tried contacting the developers but they only suggested changing the White colour to off-white so that it shows up, but this is not an acceptable solution.
Many thanks in advance.
Hi @Chris032009
Please share the link to your store
It would be easier if you could allow me to view your current store url.
However, I tested this with the default Habitat theme and added some custom CSS.
Here are the steps:
.variations
.product-form__input--color
input[type="radio"]:checked
+ label:before {
content: "✓";
position: absolute;
top: -2px;
right: -2px;
background: #2e8b57;
color: #fff;
border-radius: 50%;
display: inline-block;
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
z-index: 10;
text-indent: 0;
}
Hope this custom code is helpful to you!
Hi,
Thank you so much for this. So it shows on the Preview in the Customisor, but when I hit Save I get the error message 'Online Store editor session can not be published'. Also, the tick mark is cut off slightly:
Actually, the tick now appears in full now that I have added inventory but the borders are not showing and I still can not save the changes:
It seems that the method of adding custom code might be limited. You can try the following approach instead:
<style>
.variations .product-form__input--color input[type=radio]+label {
box-shadow: 0 0 0 1px var(--color-border) inset;
}
.variations
.product-form__input--color
input[type="radio"]:checked
+ label:before {
content: "✓";
position: absolute;
top: -2px;
right: -2px;
background: #2e8b57;
color: #fff;
border-radius: 50%;
display: inline-block;
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
z-index: 10;
text-indent: 0;
}
</style>
Let me know if you need further assistance!
Thanks!
So I added that in and have the following result (I think the borders are too light against the background):
How can I change the colour of the borders so that they are all black and the selected colour is different? Say, red?
Hi @Chris032009
General Code for All Colors
To set the border color for all color options, you can use the following code:
.variations .product-form__input--color input[type=radio]+label {
box-shadow: 0 0 0 1px var(--color-border) inset;
}
.variations .product-form__input--color input[type=radio]+label {
box-shadow: 0 0 0 1px #000000 inset;
}
Custom Code for Specific Colors
If you need to customize the border for a particular color, add this code:
.variations .product-form__input--color input[type=radio][value=White]+label {
box-shadow: 0 0 0 1px red inset;
}
Hi @Chris032009
Please kindly share the store URL ❤️
Best,
Daisy
Hi @Chris032009
The password seems wrong. Could you please check it again ?
Best,
Daisy
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025