How to add a thin boarder round the edge of my white colour swatch only?

Solved

How to add a thin boarder round the edge of my white colour swatch only?

emilyaugstudios
Pathfinder
122 1 58

Hi community, is there a way I can add a thin boarder round the edge of my white colour swatch only, currently it's struggling to show up against the background.

 

URL – https://pantee.co.uk/?_ab=0&_fd=0&_sc=1&preview_theme_id=144118972631

Colour swatch white: #fafafa 

 

Current white swatch (last colour) –

Screenshot 2024-09-11 at 16.39.14.png

 

What I need (think light grey border around the white swatch only) –

Screenshot 2024-09-11 at 16.41.38.png

Accepted Solution (1)

Made4uo-Ribe
Shopify Partner
8292 1989 2446

This is an accepted solution.

Hi @emilyaugstudios 

Check this one. 

From you Admin page, go to Online Store > Themes

Select the theme you want to edit

Under the Asset folder, open the main.css(base.css, style.css or theme.css)

Then place the code below at the very bottom of the file.

 

.swatch-method-swatches.swatch-style-icon_circle label[data-swatch="white"]::before {
    border: 1px solid grey;
}

 

And Save. 

Result:

Made4uoRibe_0-1726089442941.png

And if you like all the color: 

 

.swatch-method-swatches.swatch-style-icon_circle .opt-label--swatch::before {
     border: 1px solid grey;
}

 

And save. 

Result:

Made4uoRibe_1-1726089484114.png

 

 

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

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.

View solution in original post

Replies 5 (5)

BSS-TekLabs
Shopify Partner
2350 702 827

- Here is the solution for you @emilyaugstudios 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the theme.liquid file.
- Then add the following code at the before tag </head> and press 'Save' to save it.

<style>
label.opt-label.opt-label--swatch.btn.relative.text-center {
    border: 1px solid #fafafa !important;
}
</style>

- Here is the result you will achieve:

BSSTekLabs_0-1726069694307.png

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
emilyaugstudios
Pathfinder
122 1 58

Hi @BSS-TekLabs thank you for the help. Unfortunately that code doesn't work, it adds a border round all of my colour swatches, plus the swatch and border has padding whereas I want the border to be directly around the swatch with no white space in between. Thank you anyway 🙂

 

What that code does –

 

Screenshot 2024-09-11 at 16.52.30.png

BSSCommerce-B2B
Shopify Partner
1739 524 584

@emilyaugstudios, try this one 

<style>
label.opt-label.opt-label--swatch:before{
    border: 2px solid #fafafa !important;
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

Made4uo-Ribe
Shopify Partner
8292 1989 2446

This is an accepted solution.

Hi @emilyaugstudios 

Check this one. 

From you Admin page, go to Online Store > Themes

Select the theme you want to edit

Under the Asset folder, open the main.css(base.css, style.css or theme.css)

Then place the code below at the very bottom of the file.

 

.swatch-method-swatches.swatch-style-icon_circle label[data-swatch="white"]::before {
    border: 1px solid grey;
}

 

And Save. 

Result:

Made4uoRibe_0-1726089442941.png

And if you like all the color: 

 

.swatch-method-swatches.swatch-style-icon_circle .opt-label--swatch::before {
     border: 1px solid grey;
}

 

And save. 

Result:

Made4uoRibe_1-1726089484114.png

 

 

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

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.

GTLOfficial
Shopify Partner
554 120 109

HEllo @emilyaugstudios 
Go to online store ----> themes ----> actions ----> edit code ----> assets ---->main.css
add this code at the end of the file.

.swatch-style-icon_circle .option-selector .opt-label--swatch::before, {
border: 0.1px solid black;
}

result
3.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: [email protected] - Skype: ritesh_27dh