Forked from stevebosworth/a11y-examples-sale-price.liquid
Last active
March 21, 2017 17:35
Sale price Liquid for accessible Shopify themes - https://www.shopify.com/partners/blog/developing-shopify-themes-with-accessibility-in-mind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if product.compare_at_price > product.price %> | |
<span class=”visually-hidden”>Regular Price</span> | |
<span id=”ComparePrice”> $100</span> | |
<span class=”visually-hidden”>Sale price</span> | |
{% endif %} | |
<span id=”ProductPrice” itemprop=”price”>$50</span> | |
<style> | |
.visually-hidden { | |
position: absolute !important; | |
overflow: hidden; | |
clip: rect(0 0 0 0); | |
height: 1px; | |
width: 1px; | |
margin: -1px; | |
padding: 0; | |
border: 0; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment