Skip to content

Instantly share code, notes, and snippets.

@svieira
Created October 7, 2013 20:06
Show Gist options
  • Save svieira/6874052 to your computer and use it in GitHub Desktop.
Save svieira/6874052 to your computer and use it in GitHub Desktop.
gradient-with-fallback(fallback=none, gradient-args...) {
args = unquote(join(", ", gradient-args))
fallback = typeof(fallback) == "string" ? unquote(fallback) : fallback
background: fallback
background-image: -vendor-linear-gradient(args)
background-image: linear-gradient(args)
}
.test {
gradient-with-fallback(#FFF 150px, #CCC 100%, fallback: top left repeat-y url("some/image.jpg"))
}
.another {
gradient-with-fallback(1, 2, 3, fallback: url("some/image.jpg"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment