How to add a strike through sold out and unavailable variants in a dropdown list?

Does anyone know how to add a strike through sold out and unavailable size in a dropdown list?

I am using Symmetry theme and my website is https://stelleworld.com/

Below is a picture of what I want to do:

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 before the tag


Result:

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

It works great! Thank you!