Created
July 10, 2015 11:03
-
-
Save Razenbull/9ffdd38b5a59a36d7417 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
/// A mixin for generating vendor prefixes on non-standardized properties. | |
/// | |
/// @param {String} $property | |
/// Property to prefix | |
/// | |
/// @param {*} $value | |
/// Value to use | |
/// | |
/// @param {List} $prefixes | |
/// Prefixes to define | |
/// | |
/// @example scss - Usage | |
/// .element { | |
/// @include prefixer(border-radius, 10px, webkit ms spec); | |
/// } | |
/// | |
/// @example css - CSS Output | |
/// .element { | |
/// -webkit-border-radius: 10px; | |
/// -moz-border-radius: 10px; | |
/// border-radius: 10px; | |
/// } | |
/// | |
/// @require {variable} $prefix-for-webkit | |
/// @require {variable} $prefix-for-mozilla | |
/// @require {variable} $prefix-for-microsoft | |
/// @require {variable} $prefix-for-opera | |
/// @require {variable} $prefix-for-spec | |
@mixin prefixer($property, $value, $prefixes: all) { | |
/// Global variables to enable or disable vendor prefixes | |
$prefix-for-webkit: true !default; | |
$prefix-for-mozilla: true !default; | |
$prefix-for-microsoft: true !default; | |
$prefix-for-opera: true !default; | |
$prefix-all: true !default; | |
@each $prefix in $prefixes { | |
@if $prefix == webkit { | |
@if $prefix-for-webkit { | |
-webkit-#{$property}: $value; | |
} | |
} @else if $prefix == moz { | |
@if $prefix-for-mozilla { | |
-moz-#{$property}: $value; | |
} | |
} @else if $prefix == ms { | |
@if $prefix-for-microsoft { | |
-ms-#{$property}: $value; | |
} | |
} @else if $prefix == o { | |
@if $prefix-for-opera { | |
-o-#{$property}: $value; | |
} | |
} @else if $prefix == all { | |
@if $prefix-all { | |
-webkit-#{$property}: $value; | |
-moz-#{$property}: $value; | |
-ms-#{$property}: $value; | |
-o-#{$property}: $value; | |
#{$property}: $value; | |
} | |
} @else { | |
@warn "Unrecognized prefix: #{$prefix}. Use webkit, moz, ms, o, spec or all"; | |
} | |
} | |
} | |
div { | |
@include prefixer(border-radius, 10px, all); | |
} |
This file contains 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
div { | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
-ms-border-radius: 10px; | |
-o-border-radius: 10px; | |
border-radius: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment