Created
June 9, 2015 13:11
-
-
Save cahnory/5e75fcf81cf4f158a982 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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin rgback($color, $alpha: 1, $rest...) { | |
@if 'color' != type-of($color) or 1 == alpha($color) { | |
$color: rgba($color, $alpha, $rest...); | |
} | |
@if alpha($color) < 1 { | |
background: url( | |
'#{$RGBACK__PATH}' + | |
'#{to-lower-case(str-slice(ie_hex_str($color), 4))}' + | |
'-#{alpha($color)}.png' | |
); | |
} | |
background: $color; | |
} | |
$RGBACK__PATH: '../img/rgba-'!default; | |
test { | |
@include rgback(#F80); | |
@include rgback(#F80, .5); | |
@include rgback(255, 136, 0, .5); | |
@include rgback(rgba(255, 136, 0, .5)); | |
} |
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
test { | |
background: #ff8800; | |
background: url("../img/rgba-ff8800-0.5.png"); | |
background: rgba(255, 136, 0, 0.5); | |
background: url("../img/rgba-ff8800-0.5.png"); | |
background: rgba(255, 136, 0, 0.5); | |
background: url("../img/rgba-ff8800-0.5.png"); | |
background: rgba(255, 136, 0, 0.5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment