CSS transitions animate style changes when a property value changes — typically triggered by :hover.
Morph applies one duration and one easing to the whole changed style delta. It does not model a separate timeline per property.
.btn {
transition: all 0.3s ease-in-out;
}This makes every property change on .btn animate smoothly over 0.3 seconds.
.card {
transition-duration: 0.2s;
transition-timing-function: ease;
}/* all changed properties, 0.3s, ease-in-out */
transition: all 0.3s ease-in-out;
/* the property name is parsed for compatibility, but timing still applies to the whole delta */
transition: background-color 0.2s ease;Per-property durations and multiple independently timed transitions are parsed but not represented separately: the first duration and easing token win for the whole delta. Use one transition timing for the card/button rather than expecting color and background-color to run on different clocks.
| Value | Behavior |
|---|---|
linear |
Constant speed |
ease |
Alias for ease-in-out |
ease-in |
Slow start |
ease-out |
Slow end |
ease-in-out |
Slow start and end (default) |
cubic-bezier() and steps() are not supported yet — they fall back to the default easing.
These properties interpolate smoothly (numbers lerp, colors blend):
background-color, color — RGBA interpolationmargin, padding — per-side numeric interpolationborder-width, border-radius — numeric interpolationborder-color — RGBA interpolationfont-size, gap — numeric interpolationwidth, height — interpolated when both values are explicitopacity — numeric interpolationleft, right, top, bottom — numeric interpolationbackground-image (gradient-to-gradient), border-image, box-shadow — interpolated layer-by-layer when both sides share structure (same kind / same stop or shadow count, same units); mismatched structures flip discretely at the midpoint, like browsersThese properties snap instantly (no interpolation):
display, position, flex-direction, font-weightoverflow, text-align, box-sizing, border-stylecursor, margin-autogrid-template-*, grid-auto-*, grid-column/grid-row, grid-area, align-content, justify-items, justify-self, row-gap, column-gap) — flip discretely at the midpoint in @keyframes, like browsers.btn {
background-color: #6366f1;
color: #ffffff;
transition: all 0.3s ease;
}
.btn:hover {
background-color: #4f46e5;
transform: translateY(-2px);
}.card {
border: 1px solid #334155;
transition: all 0.3s ease;
}
.card:hover {
border-color: #6366f1;
transform: translateY(-4px);
}Hover transitions work on the element being hovered:
.card-title {
transition: color 0.3s ease;
}
.card-title:hover {
color: #6366f1;
}Ancestor/group hover (.card:hover .card-title) and hover/active rules inside @media are not emitted in build output yet; they currently do nothing without a warning. The runtime has ancestor-hover machinery, but the build path does not generate the rules. Track this in CSS Finalization for Basic Apps.
transition-property and transition-delay are informational only; the runtime interpolates the whole state delta with no delay.cubic-bezier() and steps() fall back to the default easing.:hover/:active only apply to the final matched element, not an ancestor or sibling.Transitions run per-node — parent and child can transition independently.
Setting transition-duration: 0 (or omitting the transition) disables animation — style changes snap instantly. This is the default behavior and is fully backward-compatible.