This does the job in a simple way:
{% for variant in product.variants %}
{% if variant.available %}
<span class="active">{{ variant.options[0] }}</span>
{% else %}
<span class="inactive">{{ variant.options[0] }}</span>
{% endif %}
{% endfor %}
Quality e-commerce solutions since 2010.