| 1 |
//************************************************************************// |
| 2 |
// Example: @include prefixer(border-radius, $radii, webkit ms spec); |
| 3 |
//************************************************************************// |
| 4 |
$prefix-for-webkit: true !default; |
| 5 |
$prefix-for-mozilla: true !default; |
| 6 |
$prefix-for-microsoft: true !default; |
| 7 |
$prefix-for-opera: true !default; |
| 8 |
$prefix-for-spec: true !default; // required for keyframe mixin |
| 9 |
|
| 10 |
@mixin prefixer ($property, $value, $prefixes) { |
| 11 |
@each $prefix in $prefixes { |
| 12 |
@if $prefix == webkit { |
| 13 |
@if $prefix-for-webkit { |
| 14 |
-webkit-#{$property}: $value; |
| 15 |
} |
| 16 |
} |
| 17 |
@else if $prefix == moz { |
| 18 |
@if $prefix-for-mozilla { |
| 19 |
-moz-#{$property}: $value; |
| 20 |
} |
| 21 |
} |
| 22 |
@else if $prefix == ms { |
| 23 |
@if $prefix-for-microsoft { |
| 24 |
-ms-#{$property}: $value; |
| 25 |
} |
| 26 |
} |
| 27 |
@else if $prefix == o { |
| 28 |
@if $prefix-for-opera { |
| 29 |
-o-#{$property}: $value; |
| 30 |
} |
| 31 |
} |
| 32 |
@else if $prefix == spec { |
| 33 |
@if $prefix-for-spec { |
| 34 |
#{$property}: $value; |
| 35 |
} |
| 36 |
} |
| 37 |
@else { |
| 38 |
@warn "Unrecognized prefix: #{$prefix}"; |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
@mixin disable-prefix-for-all() { |
| 44 |
$prefix-for-webkit: false; |
| 45 |
$prefix-for-mozilla: false; |
| 46 |
$prefix-for-microsoft: false; |
| 47 |
$prefix-for-opera: false; |
| 48 |
$prefix-for-spec: false; |
| 49 |
} |