Skip to content

Instantly share code, notes, and snippets.

@peteeveleigh
Last active August 29, 2015 14:01
Show Gist options
  • Save peteeveleigh/6d88a88b872cc4184682 to your computer and use it in GitHub Desktop.
Save peteeveleigh/6d88a88b872cc4184682 to your computer and use it in GitHub Desktop.
Sass/SCSS Mixin to create vendor prefixes on any property:value pair
/*
Mixin to add vendor prefixes to any property:value
By default prefixes for -moz and -webkit will be created
By specifying a list as the third parameter a custom list of prefixes can be made
e.g.
.cheese {
@include prefix($foo,$bar,(moz,webkit,o,ms));
}
will produce
.cheese {
-moz-foo: bar;
-webkit-foo: bar;
-o-foo: bar;
-ms-foo: bar;
foo: bar; }
*/
@mixin prefix($property, $value, $prefixes:(moz,webkit)) {
@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