Shopify themes, liquid, logos, and UX
Hi,
I need help with the active swatches/ variant options. Currently, when a swatch is clicked/ selected, its border color darkens. However, I aim for the selected swatch/option to change its color. For example, upon selecting the 500 grams option, the color of the chosen box should shift to black with white text.
Link: https://testingstoresandthemes.myshopify.com/
Storefront Password: test
Theme: Turbo
Thanks
Solved! Go to the solution
This is an accepted solution.
Hi @technase ,
Try adding below css to styles.css.
.swatch_options input:checked+.swatch-element {
background: #000;
color: #fff;
}
Please don't hesitate to reach out if you require further help to optimize or customize your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
This is an accepted solution.
Add This Css In your edit Code > Style.css File
.swatch_options input:checked+.swatch-element {
background: #000;
color: #fff;
}
If you require further help to optimize your store, please don’t hesitate to reach out.
This contribution will always benefit you and you will get my full help easily and you can contact me easily.
Contect On My Mail :-Mail@gmail.com
This is an accepted solution.
You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code above the </head> tag
<style>
.swatch_options input:checked+.swatch-element {
background-color: #000;
color: #fff;
}
</style>
After modification:
Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!
This is an accepted solution.
Hello @technase ,
I understand you are looking to provide a black background color and white text color on selected options.
Please add the below-mentioned code at the bottom of the theme.liquid file before </body> tag and save.
<style>
.swatch_options input:checked+.swatch-element {
background: black;
color: white;
}
</style>
Output ->
I hope the code helps you.
Please share if you have any queries.
Thank you.
This is an accepted solution.
Hi @technase ,
Try adding below css to styles.css.
.swatch_options input:checked+.swatch-element {
background: #000;
color: #fff;
}
Please don't hesitate to reach out if you require further help to optimize or customize your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
This is an accepted solution.
Add This Css In your edit Code > Style.css File
.swatch_options input:checked+.swatch-element {
background: #000;
color: #fff;
}
If you require further help to optimize your store, please don’t hesitate to reach out.
This contribution will always benefit you and you will get my full help easily and you can contact me easily.
Contect On My Mail :-Mail@gmail.com
This is an accepted solution.
You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code above the </head> tag
<style>
.swatch_options input:checked+.swatch-element {
background-color: #000;
color: #fff;
}
</style>
After modification:
Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!
This is an accepted solution.
Hello @technase ,
I understand you are looking to provide a black background color and white text color on selected options.
Please add the below-mentioned code at the bottom of the theme.liquid file before </body> tag and save.
<style>
.swatch_options input:checked+.swatch-element {
background: black;
color: white;
}
</style>
Output ->
I hope the code helps you.
Please share if you have any queries.
Thank you.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025