Added prefix tools

This commit is contained in:
2018-02-23 22:55:07 +11:00
parent fc3a727604
commit 584a5ce9af

View File

@ -0,0 +1,42 @@
/*
* Prefix Mixins
* Mixins used to add browser prefix to values and/or properties
*
* Version:
* 1.0.0 - 2018/02/23
*/
@mixin t-prefix-property($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}';
}
}
}
@mixin t-prefix-value($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit {
#{$property}: -webkit-#{$value};
} @else if $prefix == moz {
#{$property}: -moz-#{$value};
} @else if $prefix == ms {
#{$property}: -ms-#{$value};
} @else if $prefix == o {
#{$property}: -o-#{$value};
} @else if $prefix == spec {
#{$property}: #{$value};
} @else {
@warn 'Unrecognized prefix: #{$prefix}';
}
}
}