Created
August 6, 2014 05:38
-
-
Save rymizuki/f38c3d132f74cdeef7a0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<div class="block"> | |
hello | |
</div> | |
<div class="block2"> | |
hello | |
</div> |
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
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0.rc.1) | |
// ---- | |
@mixin image-replacement( | |
$color: transparent, | |
$repeat: no-repeat, | |
$position: center center, | |
$path: null, | |
$size: 0 0 | |
) { | |
width: auto; | |
height: auto; | |
font: 0/0 a; | |
line-height: 0; | |
text-shadow: none; | |
color: transparent; | |
&:after { | |
content: ''; | |
display: block; | |
@if $path != null { | |
background: $color url($path) $repeat $position; | |
background-size: $size; | |
} | |
@else { | |
@content | |
} | |
} | |
} | |
.block2 { | |
@include image-replacement( | |
$path: "/path/to.png" | |
) | |
} | |
.block { | |
@include image-replacement { | |
background: red; | |
width: 100px; | |
height: 100px; | |
} | |
} |
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
.block2 { | |
width: auto; | |
height: auto; | |
font: 0/0 a; | |
line-height: 0; | |
text-shadow: none; | |
color: transparent; | |
} | |
.block2:after { | |
content: ''; | |
display: block; | |
background: transparent url("/path/to.png") no-repeat center center; | |
background-size: 0 0; | |
} | |
.block { | |
width: auto; | |
height: auto; | |
font: 0/0 a; | |
line-height: 0; | |
text-shadow: none; | |
color: transparent; | |
} | |
.block:after { | |
content: ''; | |
display: block; | |
background: red; | |
width: 100px; | |
height: 100px; | |
} |
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
<div class="block"> | |
hello | |
</div> | |
<div class="block2"> | |
hello | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment