Skip to main content

Animation Timing Function

Set how an animation progresses through each cycle.

View as Markdown
baselinewidely
ClassCSS
atf:lanimation-timing-function: linear;
atf:eianimation-timing-function: ease-in;
atf:eoanimation-timing-function: ease-out;
atf:ioanimation-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:atf:eo.

Breakpoints

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

@xs:atf:eoFrom 32rem up.
@sm:atf:eoFrom 40rem up.
@md:atf:eoFrom 48rem up.
@lg:atf:eoFrom 64rem up.
@xl:atf:eoFrom 80rem up.
@xxl:atf: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:atf:eoContainer from 32rem up.
@c:sm:atf:eoContainer from 40rem up.
@c:md:atf:eoContainer from 48rem up.
@c:lg:atf:eoContainer from 64rem up.
@c:xl:atf:eoContainer from 80rem up.
@c:xxl:atf: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:atf:eoOn a touch screen.
@prm:atf:eoWith reduced motion on.
@st:atf:eoOn the first frame.

States

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

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

Pseudo Elements

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

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

Define Easings

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

yumma.config.mjs
import { defineConfig } from "yummacss";
export default defineConfig({ theme: { easings: { "out-quart": "cubic-bezier(0.25, 1, 0.5, 1)", }, },});
<span className="d:b an:spin adu:700 atf:out-quart aic:inf"></span>