Permalink
Browse files

Refactored prefixer to make accept a list. Prefixer will now be more …

…succinct
  • Loading branch information...
1 parent 5ff0bf1 commit 0985f3a4cd4cf46932f7bbaf443891e0f467fbd7 Phil LaPier committed Dec 5, 2012
Showing with 24 additions and 13 deletions.
  1. +24 −13 app/assets/stylesheets/addons/_prefixer.scss
@@ -1,16 +1,27 @@
//************************************************************************//
-// Default: Webkit, moz, spec
-// Example: @include prefixer(border-radius, $radii, $o: true);
+// Example: @include prefixer(border-radius, $radii, webkit ms spec);
//************************************************************************//
-@mixin prefixer ($property, $value,
- $webkit: true,
- $moz: true,
- $ms: false,
- $o: false,
- $spec: true) {
- @if $webkit { -webkit-#{$property}: $value; }
- @if $moz { -moz-#{$property}: $value; }
- @if $ms { -ms-#{$property}: $value; }
- @if $o { -o-#{$property}: $value; }
- @if $spec { #{$property}: $value; }
+@mixin prefixer ($property, $value, $prefixes) {
+
+ @each $prefix in $prefixes {
+
+ @if $prefix == webkit {
+ -webkit-#{$property}: $value;
+ }
+ @else if $prefix == moz {
+ -moz-#{$property}: $value;
+ }
+ @else if $prefix == ms {
+ -ms-#{$property}: $value;
+ }
+ @else if $prefix == o {
+ -o-#{$property}: $value;
+ }
+ @else if $prefix == spec {
+ #{$property}: $value;
+ }
+ @else {
+ @warn "Unrecognized prefix: #{$prefix}";
+ }
+ }
}

0 comments on commit 0985f3a

Please sign in to comment.