Skip to Content

prefix()

Prefix properties with vendor tags for various rendering engines.

Sass February 22, 2017

Usage

Sass
prefix($map, $vendors)

Parameters

$map
(Required) (String) The property and value to prefix
Default: None

$vendors
(Optional) (String) Which engines to prefix with
Default: webkit moz ms o

Request or provide clarification »

Examples

Prefix a transition for only webkit and ms.

Sass
.element {@include prefix((transition: all 0.25s), webkit ms);}

Prefix an animation for all vendors

Sass
.element {@include prefix((animation: animation-name 2s infinite linear));}

Source File

Located in /assets/scss/partials/_mixins.scss on line 3.

Sass
@mixin prefix($map, $vendors: webkit moz ms o){
    @each $prop, $value in $map {
        @if $vendors {
            @each $vendor in $vendors {
                #{"-" + $vendor + "-" + $prop}: #{$value};
            }
        }

        #{$prop}: #{$value};
    }
}

Override

To override or disable this, redefine the mixin/function later on, or use different class names to prevent this from targeting your element.

Sass
@mixin prefix($map, $vendors){
    //Write your own code here, leave it blank, or return false.
}