baselinewidely| Class | CSS |
|---|---|
| an:none | animation-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:none | From 32rem up. |
| @sm:an:none | From 40rem up. |
| @md:an:none | From 48rem up. |
| @lg:an:none | From 64rem up. |
| @xl:an:none | From 80rem up. |
| @xxl:an:none | From 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:none | Container from 32rem up. |
| @c:sm:an:none | Container from 40rem up. |
| @c:md:an:none | Container from 48rem up. |
| @c:lg:an:none | Container from 64rem up. |
| @c:xl:an:none | Container from 80rem up. |
| @c:xxl:an:none | Container 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:none | On a touch screen. |
| @prm:an:none | With reduced motion on. |
| @st:an:none | On the first frame. |
States
Apply a class only while the element is in a state, such as hovered, focused or checked.
| h:an:none | On :hover. |
| f:an:none | On :focus. |
| fv:an:none | On :focus-visible. |
| a:an:none | On :active. |
| d:an:none | On :disabled. |
| fc:an:none | On :first-child. |
| c:an:none | On :checked. |
| e:an:none | On :empty. |
| fw:an:none | On :focus-within. |
| i:an:none | On :invalid. |
| in:an:none | On :indeterminate. |
| lc:an:none | On :last-child. |
| nc:an:none | On :nth-child. |
| r:an:none | On :required. |
| ro:an:none | On :read-only. |
| v:an:none | On :valid. |
Pseudo Elements
Style a part of the element rather than the element itself, such as its placeholder or the selected text.
| a::an:none | On ::after. |
| b::an:none | On ::before. |
| p::an:none | On ::placeholder. |
| s::an:none | On ::selection. |
Define Keyframes
Name an animation once in theme.keyframes & write its body as plain CSS. Each name becomes an an: class.
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>