Transitions & Easing
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
| Variable | Default Value |
|---|---|
--dwc-transition-x-slow | 1000ms |
--dwc-transition-slow | 300ms |
--dwc-transition-medium | 250ms |
--dwc-transition-fast | 150ms |
--dwc-transition-x-fast | 100ms |
--dwc-transition | var(--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:
| Variable | Cubic Bezier |
|---|---|
--dwc-ease | cubic-bezier(0.4, 0, 0.2, 1) |
--dwc-ease-out | cubic-bezier(0, 0, 0.2, 1) |
--dwc-ease-in | cubic-bezier(0.4, 0, 1, 1) |
--dwc-ease-outGlide | cubic-bezier(0.32, 0.72, 0, 1) |
Extended easings
| Variable | Cubic Bezier | Test Link |
|---|---|---|
--dwc-ease-inQuad | cubic-bezier(0.55, 0.085, 0.68, 0.53) | Test it |
--dwc-ease-outQuad | cubic-bezier(0.25, 0.46, 0.45, 0.94) | Test it |
--dwc-ease-inOutQuad | cubic-bezier(0.455, 0.03, 0.515, 0.955) | Test it |
--dwc-ease-inCubic | cubic-bezier(0.55, 0.055, 0.675, 0.19) | Test it |
--dwc-ease-outCubic | cubic-bezier(0.215, 0.61, 0.355, 1) | Test it |
--dwc-ease-inOutCubic | cubic-bezier(0.645, 0.045, 0.355, 1) | Test it |
--dwc-ease-inQuart | cubic-bezier(0.895, 0.03, 0.685, 0.22) | Test it |
--dwc-ease-outQuart | cubic-bezier(0.165, 0.84, 0.44, 1) | Test it |
--dwc-ease-inOutQuart | cubic-bezier(0.77, 0, 0.175, 1) | Test it |
--dwc-ease-inQuint | cubic-bezier(0.755, 0.05, 0.855, 0.06) | Test it |
--dwc-ease-outQuint | cubic-bezier(0.23, 1, 0.32, 1) | Test it |
--dwc-ease-inOutQuint | cubic-bezier(0.86, 0, 0.07, 1) | Test it |
--dwc-ease-inExpo | cubic-bezier(0.95, 0.05, 0.795, 0.035) | Test it |
--dwc-ease-outExpo | cubic-bezier(0.19, 1, 0.22, 1) | Test it |
--dwc-ease-inOutExpo | cubic-bezier(1, 0, 0, 1) | Test it |
--dwc-ease-inCirc | cubic-bezier(0.6, 0.04, 0.98, 0.335) | Test it |
--dwc-ease-outCirc | cubic-bezier(0.075, 0.82, 0.165, 1) | Test it |
--dwc-ease-inOutCirc | cubic-bezier(0.785, 0.135, 0.15, 0.86) | Test it |
--dwc-ease-inBack | cubic-bezier(0.36, 0, 0.66, -0.56) | Test it |
--dwc-ease-outBack | cubic-bezier(0.34, 1.56, 0.64, 1) | Test it |
--dwc-ease-inOutBack | cubic-bezier(0.68, -0.6, 0.32, 1.6) | Test it |