Animations and patterns
Entrance animations
The Animation section lists the effects of forma_animations. Each is CSS only, with no script, and replays whenever items come in:
add_filter( 'forma_animations', fn( $presets ) => $presets + [
'flip' => [ 'label' => 'Flip', 'from' => 'opacity:0;transform:perspective(600px) rotateX(-30deg)' ],
'wipe' => [ 'label' => 'Wipe', 'from' => 'clip-path:inset(0 100% 0 0)', 'to' => 'clip-path:inset(-30%)', 'out' => true ],
'pop' => [ 'label' => 'Pop', 'keyframes' => 'my-theme-pop', 'ease' => 'ease-out' ],
] );
| Key | What it does |
|---|---|
from | The CSS an item starts from; it ends at its own style |
to | Where it ends, for a property that can’t go back to the item’s own style. A clip-path ends at a negative inset so shadows aren’t cut |
keyframes | The name of a @keyframes rule in your theme’s CSS, instead of from and to |
out | On a filter or page change, the old items leave one by one with the same movement in reverse |
ease | A keyword, cubic-bezier() or steps() |
The Animation section is part of Forma Pro.
Metro patterns
forma_metro_patterns adds patterns to the Metro picker. A pattern is the number of columns, a bar, then each tile’s width and height in columns and rows, separated by semicolons. The built-in Classic pattern is 3|2,1;1,.5;1,.5: a wide tile and two half-height tiles stacked beside it.
add_filter( 'forma_metro_patterns', fn( $patterns ) => $patterns + [
'hero-three' => [ 'label' => 'Hero + three', 'pattern' => '3|3,1;1,1;1,1;1,1' ],
] );
forma_freeform_patterns does the same for Freeform.
Was this article helpful?
Thanks for your feedback!