Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
Forked from dgoodlad/_gradient.sass
Created February 18, 2010 11:18
Show Gist options
  • Save aslakhellesoy/307582 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/307582 to your computer and use it in GitHub Desktop.
=v-gradient(!top_color, !bottom_color, !midpoint_color = false, !midpoint = false)
@if !midpoint_color == false
!midpoint_color = !top_color / 2 + !bottom_color / 2
@if !midpoint == false
!midpoint = 50%
background: -webkit-gradient(linear, center top, center bottom, from(#{!top_color}), color-stop(#{!midpoint}, #{!midpoint_color}), to(#{!bottom_color}))
background: -moz-linear-gradient(top, #{!top_color}, #{!midpoint_color} #{!midpoint}, #{!bottom_color})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment