Skip to content

Instantly share code, notes, and snippets.

@iamtyce
Last active December 19, 2015 04:29
Show Gist options
  • Save iamtyce/5897944 to your computer and use it in GitHub Desktop.
Save iamtyce/5897944 to your computer and use it in GitHub Desktop.
An ScSS image extension replace mixin designed to serve PNG files to IE8, and SVG to all other browsers
// *************************** //
// IMAGE EXTENSION REPLACEMENT //
// *************************** //
// Use: @include image-background($image: "../lib/img/", $repeat: no-repeat, $position: center center);
@mixin image-background($color: transparent,$image: none,$repeat: no-repeat,$attachment: scroll,$position: center center) {
// Add extension to $image
$image: '#{$image}.#{$imageextension}';
// Output the $imageextension
background: $color url($image) $repeat $attachment $position;
}
@aaronallport
Copy link

Can do do this as a pull request, based on the IE8 opacity method I've put in?

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment