transition-timing-function

A propriedade CSS transition-timing-function é usada para descrever como os valores intermediários das propriedades CSS sendo afetados por um efeito de transição são calculados. Em essência isso permite você estabelecer uma curva de aceleração, para que então a velocidade da transição possa variar durante sua duração.

Essa curva de aceleração é definida usando <timing-function> (en-US) para cada propriedade a ser transicionada.

/* Keyword values */
transition-timing-function: ease;
transition-timing-function: ease-in;
transition-timing-function: ease-out;
transition-timing-function: ease-in-out;
transition-timing-function: linear;
transition-timing-function: step-start;
transition-timing-function: step-end;

/* Function values */
transition-timing-function: steps(4, end);
transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
transition-timing-function: frames(10);

/* Multiple timing functions */
transition-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1);

/* Global values */
transition-timing-function: inherit;
transition-timing-function: initial;
transition-timing-function: unset;

You may specify multiple timing functions; each one will be applied to the corresponding property as specified by the transition-property (en-US) property, which acts as a master list. If there are fewer functions specified than in the master list, missing values are set to the initial value (ease). If there are more timing functions, the list is simply truncated to the right size. In both case the CSS declaration stays valid.

Initial valueease
Aplica-se aall elements, ::before and ::after pseudo-elements
Inheritednão
Computed valueas specified
Animation typediscrete

Syntax

Values

<timing-function>
Each <timing-function> (en-US) represents the timing function to link to the corresponding property to transition, as defined in transition-property (en-US).

Formal syntax

<easing-function># (en-US)

where
<easing-function> = linear | (en-US) <cubic-bezier-timing-function> | (en-US) <step-timing-function>

where
<cubic-bezier-timing-function> = ease | (en-US) ease-in | (en-US) ease-out | (en-US) ease-in-out | (en-US) cubic-bezier([0,1] (en-US)>, <number>, [0,1] (en-US)>, <number>)
<step-timing-function> = step-start | (en-US) step-end | (en-US) steps(<integer> (en-US)[ (en-US), <step-position>] (en-US)? (en-US))

where
<step-position> = jump-start | (en-US) jump-end | (en-US) jump-none | (en-US) jump-both | (en-US) start | (en-US) end

Examples

transition-timing-function: ease

transition-timing-function: ease-in

transition-timing-function: ease-out

transition-timing-function: ease-in-out

transition-timing-function: linear

transition-timing-function: step-start

transition-timing-function: step-end

transition-timing-function: steps(4, end)

Specifications

Specification Status Comment
CSS Transitions
The definition of 'transition-timing-function' in that specification.
Rascunho atual Initial definition

Compatibilidade com navegadores

Estamos convertendo nossos dados de compatibilidade para o formato JSON. Esta tabela de compatibilidade ainda usa o formato antigo, pois ainda não convertemos os dados que ela contém. Descubra como você pode ajudar! (en-US)

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 26 (Yes)-webkit (en-US)
(Yes)
4.0 (2.0)-moz (en-US)
16.0 (16.0)[1]
10 11.6-o (en-US)
12.10 #
(Yes)-webkit (en-US)
frames() (Yes) ? 55.0 (55.0) Não suportado (Yes) ?
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes)-webkit (en-US) (Yes)-webkit (en-US) (Yes)-webkit (en-US)
(Yes)
4.0 (2.0)-moz (en-US)
16.0 (16.0)[1]
? ? (Yes)-webkit (en-US)
frames() ? (Yes) ? 55.0 (55.0) Não suportado (Yes) ?

[1] In addition to the unprefixed support, Gecko 44.0 (Firefox 44.0 / Thunderbird 44.0 / SeaMonkey 2.41) added support for a -webkit prefixed version of the property for web compatibility reasons behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49.0 (Firefox 49.0 / Thunderbird 49.0 / SeaMonkey 2.46) the preference defaults to true.

See also