Skip to content

Instantly share code, notes, and snippets.

@m4dz
Created November 5, 2012 14:04
Show Gist options
  • Save m4dz/4017334 to your computer and use it in GitHub Desktop.
Save m4dz/4017334 to your computer and use it in GitHub Desktop.
LessCSS Radial Gradient compliant mixin
.radial-gradient(@position, @cover, @begin, @end, ...) {
@props: ~`"@{arguments}".replace(/[\[\]]/g, '')`;
@stop_color: ~`"@{props}".split(/[\s,]+/).slice(-2, -1)`;
background-color: @stop_color;
background: -webkit-radial-gradient(@props);
background: -moz-radial-gradient(@props);
background: -ms-radial-gradient(@props);
background: -o-radial-gradient(@props);
background: radial-gradient(@props);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment