Skip to content

Instantly share code, notes, and snippets.

@spac3unit
Created November 25, 2016 09:28
Show Gist options
  • Save spac3unit/f366589a7aa4a4f44f0e1afa4d424aee to your computer and use it in GitHub Desktop.
Save spac3unit/f366589a7aa4a4f44f0e1afa4d424aee to your computer and use it in GitHub Desktop.
%currency {
position: relative;
&:before {
content: '$';
position: relative;
left: 0;
}
}
.USD %currency:before { content: '$'; }
.EUR %currency:before { content: '\20AC'; } // must escape the html entities for each currency symbol
.ILS %currency:before { content: '\20AA'; }
.GBP %currency:before { content: '\00A3'; }
Example Usage
<body class="USD">
<span class="price">45</span>
</body>
.price {
@extend %currency;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment