Skip to main content

Animation Name

Run a keyframes animation you define in your config.

View as Markdown
baselinewidely
ClassCSS
an:noneanimation-name: none;

Variants

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

Breakpoints

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

@xs:an:noneFrom 32rem up.
@sm:an:noneFrom 40rem up.
@md:an:noneFrom 48rem up.
@lg:an:noneFrom 64rem up.
@xl:an:noneFrom 80rem up.
@xxl:an:noneFrom 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:an:noneContainer from 32rem up.
@c:sm:an:noneContainer from 40rem up.
@c:md:an:noneContainer from 48rem up.
@c:lg:an:noneContainer from 64rem up.
@c:xl:an:noneContainer from 80rem up.
@c:xxl:an:noneContainer 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:an:noneOn a touch screen.
@prm:an:noneWith reduced motion on.
@st:an:noneOn the first frame.

States

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

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

Pseudo Elements

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

a::an:noneOn ::after.
b::an:noneOn ::before.
p::an:noneOn ::placeholder.
s::an:noneOn ::selection.

Define Keyframes

Name an animation once in theme.keyframes & write its body as plain CSS. Each name becomes an an: class.

yumma.config.mjs
import { defineConfig } from "yummacss";
export default defineConfig({ theme: { keyframes: { spin: "to { rotate: 360deg; }", "fade-in": "from { opacity: 0; }", }, },});

Using Keyframes

Combine a name with Animation Duration, Animation Timing Function & Animation Iteration Count.

<span className="d:b w:4 h:4 bw:2 br:9999 an:spin adu:700 atf:l aic:inf"></span>

Only the keyframes a class uses are written to the output, once, however many variants use them.

Reduced Motion

Stop an animation for people who have asked for less motion with the @prm: variant.

<span className="an:spin adu:700 aic:inf @prm:an:none"></span>