Composing and debugging
How toon's presets combine, how to get clear error messages, and what to check when nothing moves.
Edit this pageCSS presets compose
Section titled “CSS presets compose”Presets use the individual transform properties (translate, scale and rotate), so they don’t overwrite your transform. Two presets that both set animation must go on nested elements.
Mistakes explain themselves
Section titled “Mistakes explain themselves”Load toon.debug.js while you develop: after toon.js as a script, or imported before toon.mjs. Wrong arguments then throw a message like toon.arc: end point must be { x, y } numbers, instead of failing deep inside or drawing nothing. See Errors and debugging.
Reduced motion
Section titled “Reduced motion”toon.css turns animation off when the reader’s system asks for reduced motion. On canvas that decision is yours; see the reduced-motion recipe.
If nothing moves
Section titled “If nothing moves”Check these in order:
- The browser’s console or network panel shows no missing
toon.cssortoon.js. A missing file means the path is wrong. - Your system’s reduced motion setting is off. With it on,
toon.csskeeps everything still on purpose. - A bouncing element has room above it. Without it, the bounce leaves the top of the page.
- If you load
toon.mjs, the page is served over HTTP. Browsers block modules opened from a file.