Skip to main content

Transition Timing Function

Set the speed curve for a transition effect.

View as Markdown
baselinewidely
ClassCSS
ttf:ltransition-timing-function: linear;
ttf:eitransition-timing-function: ease-in;
ttf:eotransition-timing-function: ease-out;
ttf:iotransition-timing-function: ease-in-out;

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:ttf:eo.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:ttf:eoFrom 32rem up.
@sm:ttf:eoFrom 40rem up.
@md:ttf:eoFrom 48rem up.
@lg:ttf:eoFrom 64rem up.
@xl:ttf:eoFrom 80rem up.
@xxl:ttf:eoFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:ttf:eoContainer from 32rem up.
@c:sm:ttf:eoContainer from 40rem up.
@c:md:ttf:eoContainer from 48rem up.
@c:lg:ttf:eoContainer from 64rem up.
@c:xl:ttf:eoContainer from 80rem up.
@c:xxl:ttf:eoContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:ttf:eoOn a touch screen.
@prm:ttf:eoWith reduced motion on.
@st:ttf:eoOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:ttf:eoOn :hover.
f:ttf:eoOn :focus.
fv:ttf:eoOn :focus-visible.
a:ttf:eoOn :active.
d:ttf:eoOn :disabled.
fc:ttf:eoOn :first-child.
c:ttf:eoOn :checked.
e:ttf:eoOn :empty.
fw:ttf:eoOn :focus-within.
i:ttf:eoOn :invalid.
in:ttf:eoOn :indeterminate.
lc:ttf:eoOn :last-child.
nc:ttf:eoOn :nth-child.
r:ttf:eoOn :required.
ro:ttf:eoOn :read-only.
v:ttf:eoOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::ttf:eoOn ::after.
b::ttf:eoOn ::before.
p::ttf:eoOn ::placeholder.
s::ttf:eoOn ::selection.

Working with easings

Name a curve once in theme.easings, written as any CSS timing function. Each name becomes a ttf: & an atf: class.

import { defineConfig } from "yummacss";
export default defineConfig({ theme: { easings: { "out-quart": "cubic-bezier(0.25, 1, 0.5, 1)", }, },});