Skip to main content

Transitions & Easing

Open in ChatGPT

Transition variables are used to provide consistent animation durations across your app. They control how long an animation takes to complete.

Example

.element {
transition: background-color var(--dwc-transition-slow);
}

Variables

VariableDefault Value
--dwc-transition-x-slow1000ms
--dwc-transition-slow300ms
--dwc-transition-medium250ms
--dwc-transition-fast150ms
--dwc-transition-x-fast100ms
--dwc-transitionvar(--dwc-transition-medium)

Easing

Easing variables define how values change over time, making transitions feel more natural.

Example

.element {
transition: transform var(--dwc-transition) var(--dwc-ease-inOutBack);
}

Standard easings

These are the general-purpose easing curves used by most components:

VariableCubic Bezier
--dwc-easecubic-bezier(0.4, 0, 0.2, 1)
--dwc-ease-outcubic-bezier(0, 0, 0.2, 1)
--dwc-ease-incubic-bezier(0.4, 0, 1, 1)
--dwc-ease-outGlidecubic-bezier(0.32, 0.72, 0, 1)

Extended easings

VariableCubic BezierTest Link
--dwc-ease-inQuadcubic-bezier(0.55, 0.085, 0.68, 0.53)Test it
--dwc-ease-outQuadcubic-bezier(0.25, 0.46, 0.45, 0.94)Test it
--dwc-ease-inOutQuadcubic-bezier(0.455, 0.03, 0.515, 0.955)Test it
--dwc-ease-inCubiccubic-bezier(0.55, 0.055, 0.675, 0.19)Test it
--dwc-ease-outCubiccubic-bezier(0.215, 0.61, 0.355, 1)Test it
--dwc-ease-inOutCubiccubic-bezier(0.645, 0.045, 0.355, 1)Test it
--dwc-ease-inQuartcubic-bezier(0.895, 0.03, 0.685, 0.22)Test it
--dwc-ease-outQuartcubic-bezier(0.165, 0.84, 0.44, 1)Test it
--dwc-ease-inOutQuartcubic-bezier(0.77, 0, 0.175, 1)Test it
--dwc-ease-inQuintcubic-bezier(0.755, 0.05, 0.855, 0.06)Test it
--dwc-ease-outQuintcubic-bezier(0.23, 1, 0.32, 1)Test it
--dwc-ease-inOutQuintcubic-bezier(0.86, 0, 0.07, 1)Test it
--dwc-ease-inExpocubic-bezier(0.95, 0.05, 0.795, 0.035)Test it
--dwc-ease-outExpocubic-bezier(0.19, 1, 0.22, 1)Test it
--dwc-ease-inOutExpocubic-bezier(1, 0, 0, 1)Test it
--dwc-ease-inCirccubic-bezier(0.6, 0.04, 0.98, 0.335)Test it
--dwc-ease-outCirccubic-bezier(0.075, 0.82, 0.165, 1)Test it
--dwc-ease-inOutCirccubic-bezier(0.785, 0.135, 0.15, 0.86)Test it
--dwc-ease-inBackcubic-bezier(0.36, 0, 0.66, -0.56)Test it
--dwc-ease-outBackcubic-bezier(0.34, 1.56, 0.64, 1)Test it
--dwc-ease-inOutBackcubic-bezier(0.68, -0.6, 0.32, 1.6)Test it