Skip to content

Instantly share code, notes, and snippets.

@RyoSugimoto
Last active December 14, 2015 03:49
Show Gist options
  • Save RyoSugimoto/5023804 to your computer and use it in GitHub Desktop.
Save RyoSugimoto/5023804 to your computer and use it in GitHub Desktop.
ベンダープリフィックスを自動で付与するSassミックスイン。
@mixin vendor-prefix($prop, $value) {
#{$prop}: $value;
-webkit-#{$prop}: $value;
-ms-#{$prop}: $value;
-moz-#{$prop}: $value;
-o-#{$prop}: $value;
}
// Another pattern
// using an array-like variable
$vendor-prefix: webkit, moz, ms, o;
@mixin add-prefix ($prop, $val) {
$prop: $val;
@each $the-prefix in $vendor-prefix {
-#{$the-prefix + '-' + #{$prop}}: $val;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment