Created
January 16, 2015 10:15
-
-
Save dieppon/3162280b94b848c11e87 to your computer and use it in GitHub Desktop.
Base64 background images mixin
This file contains hidden or 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
| @mixin background-64($code,$code-hd:null,$width:null,$height:null,$type:png) { | |
| background-image: url('data:image/' + $type + ';base64,' + $code); | |
| @if $code-hd == null { | |
| } @else { | |
| @media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { | |
| background-image: url('data:image/' + $type + ';base64,' + $code-hd); | |
| -webkit-background-size: $width $height; | |
| background-size: $width $height; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment