Skip to content

Instantly share code, notes, and snippets.

@charliepark
Created March 26, 2013 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charliepark/5249843 to your computer and use it in GitHub Desktop.
Save charliepark/5249843 to your computer and use it in GitHub Desktop.
A vendor prefixing mixin for Sass. Found it online. Sorry to whoever wrote it initially!
/**
* This mixin is awesome. Handles vendor prefixing in a single line.
*/
@mixin vendor-prefix($name, $argument) {
-webkit-#{$name}: $argument;
-moz-#{$name}: $argument;
-ms-#{$name}: $argument;
-o-#{$name}: $argument;
#{$name}: $argument;
}
/**
* To use:
*/
.something {
@include vendor-prefix(transition, 200ms ease);
}
/**
* Which renders as:
*/
.something {
-webkit-transition: 200ms ease;
-moz-transition: 200ms ease;
-ms-transition: 200ms ease;
-o-transition: 200ms ease;
transition: 200ms ease;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment