Created
October 12, 2017 11:49
-
-
Save davidpollet/e8ea2b8c7eb7e348a079f40c17a9a176 to your computer and use it in GitHub Desktop.
Sass Mixin - Tinted background generator
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
// Generate a color or gradient filter above an image | |
// Codepen demo : https://codepen.io/davidpollet/pen/mAVyOG | |
@mixin bg-tinted( | |
$img-url, | |
$tint-1:#000, | |
$tint-opacity-1:0.8, | |
$tint-2: $tint-1, | |
$tint-opacity-2:$tint-opacity-1, | |
$direction: to bottom, | |
$position:center center, | |
$repeat: no-repeat | |
) { | |
background: linear-gradient( | |
$direction, | |
rgba($tint-1, $tint-opacity-1), | |
rgba($tint-2, $tint-opacity-2)), | |
url('#{$img-url}') $repeat $position; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment