Last active
December 14, 2015 03:49
-
-
Save RyoSugimoto/5023804 to your computer and use it in GitHub Desktop.
ベンダープリフィックスを自動で付与するSassミックスイン。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin vendor-prefix($prop, $value) { | |
#{$prop}: $value; | |
-webkit-#{$prop}: $value; | |
-ms-#{$prop}: $value; | |
-moz-#{$prop}: $value; | |
-o-#{$prop}: $value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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