Skip to content

Instantly share code, notes, and snippets.

@jackw
Created November 15, 2013 10:07
Show Gist options
  • Save jackw/7482037 to your computer and use it in GitHub Desktop.
Save jackw/7482037 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@mixin gimme-stuff($var1, $imagePaths...) {
@if length($imagePaths) < 2 {
&:before {
content: "You need to provide two or more vars for gimme-stuff to work";
display:block;
}
} @else {
& {
background:url(nth($imagePaths, 1)) no-repeat, url(nth($imagePaths, 2)) no-repeat, url(nth($imagePaths, 3)) no-repeat;
}
}
}
.my-selector {
@include gimme-stuff(monkey, 'my-first-image.png', 'my-second-image.png', 'my-third-image.png');
}
.my-selector {
background: url("my-first-image.png") no-repeat, url("my-second-image.png") no-repeat, url("my-third-image.png") no-repeat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment