Last active
November 14, 2015 21:55
-
-
Save lozandier/faa9c6f8784a57366eaa to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
// Create a function that inserts the string `@2x` right before the filename | |
// extension (you may assume the extension has a length of 3 characters). | |
@function retinize($filename) { | |
@return str-insert($filename, '@2x', str-index($filename, '.')); // make magic here | |
//@return str-insert( $filename, '@2x', -6) | |
} | |
.foo { | |
background: url("some-image.png"); | |
@media retina { // this is pseudo-code | |
background: url( retinize("some-image.png.webp.apng") ); | |
} | |
} |
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
.foo { | |
background: url("some-image.png"); | |
} | |
@media retina { | |
.foo { | |
background: url("some-image@2x.png.webp.apng"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment