Skip to Content
Menu

easing()

Add easing to CSS animation either by name or with custom cubic-bezier values.

Sass May 7, 2022

Usage

Sass
easing($ease, $custom)

Parameters

$ease
(Optional) (String) The name of the easing to use.
Default: linear

$custom
(Optional) (String) Comma separated values
Default: None

Parameter Notes

Predefined easings are located in _variables.scss within a $easings variable.

To use custom values, pass “custom” as the $ease parameter.

Request or provide clarification »

Examples

Use a predefined easeOutBack easing.

Sass
.example {@include prefix((transition: right 0.5s easing(easeOutBack)));}

Use a custom values.

Sass
.example {@include prefix((transition: right 0.5s easing(custom, "0.190, 1.000, 0.220, 1.000")));}
Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /assets/scss/partials/_functions.scss on line 71.

    Sass
    @function easing($ease: linear, $custom: ""){
        @each $name, $values in $easings {
            @if $ease == $name {
                @return cubic-bezier(unquote(#{$values}) unquote(#{$custom}));
            } @else {
                //@warn "#{$ease} not found in the easings map.";
            }
        }
    }
    

    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 easing($ease, $custom){
        //Write your own code here, leave it blank, or return false.
    }