Created
April 4, 2014 08:24
-
-
Save benjamindean/9970390 to your computer and use it in GitHub Desktop.
Creates SVG background image with PNG fallback. Example: @include('picture', 'center', 'center', 'no-repeat', 'fallback'); #{$imgFallback} - global var, folder with fallbacks.
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
@mixin image($name, $x, $y, $repeat, $fallback: "") { | |
@if $fallback == "fallback" { | |
background: url(#{$imgFallback}/#{$name}.png) $x $y $repeat; | |
background: rgba(0, 0, 0, 0) url(#{$img}/#{$name}.svg) $x $y $repeat; | |
} | |
@else { | |
background: url(#{$img}/#{$name}.png) $x $y $repeat; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment