Skip to content

Instantly share code, notes, and snippets.

@bryanerayner
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanerayner/9200953 to your computer and use it in GitHub Desktop.
Save bryanerayner/9200953 to your computer and use it in GitHub Desktop.
/**
Prefix - Prefixes a property with webkit, moz, or o.
Usage:
@include prefix(animation, slide 1s)
Outputs:
-webkit-animation: slide 1s;
-moz-animation: slide 1s;
-o-animation: slide 1s;
animation: slide 1s;
Want to forget Opera or use a different set of prefixes?
@include prefix(animation, slide 1s, (-webkit-,-ms-))
Outputs:
-webkit-animation: slide 1s;
-ms-animation: slide 1s;
animation: slide 1s;
*/
@mixin prefix($property, $value, $prefixes:(-webkit-,-moz-,-o-,-ms-''))
{
@each $prefix in $prefixes
{
#{$prefix}#{$property}: #{$value};
}
#{$property}: #{$value};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment