Automatic CSS includes composable Hover, Entrance, Exit, and On Visible effects. Applying several utility classes to every element works, but it gets repetitive when the same combinations repeat across a site. This guide uses Etch recipes to build those combinations directly into custom classes. Automatic CSS remains the animation engine. The recipes add…
Automatic CSS includes composable Hover, Entrance, Exit, and On Visible effects. Applying several utility classes to every element works, but it gets repetitive when the same combinations repeat across a site.
This guide uses Etch recipes to build those combinations directly into custom classes. Automatic CSS remains the animation engine. The recipes add only the effect-specific CSS each custom class needs.
Requirements and assumptions
This approach assumes all of the following:
- You are using a licensed copy of Automatic CSS 4 or later.
- You have enabled the effects you plan to use in the Automatic CSS dashboard.
- Etch Toolkit from Nick Arce is installed, with the Recipes feature enabled.
- You can add a small PHP snippet through WPCodeBox, a snippets plugin, a child theme, or a small custom plugin.
The recipe file does not replace Automatic CSS or enable disabled ACSS features. ACSS provides shared animation rules, keyframes, the Intersection Observer script, fallbacks, and reduced-motion handling.
Code
These are the recipes
JSON
ExpandContent is hidden in Gutenberg
By default (as of 4.0.1), the animations are problematic in the Gutenberg editor. Use this script to disable them. Add this to wpCodeBox or another snippet manager. Hopefully a fix is coming natively to ACSS soon, and this won’t be needed.
PHP<?php
/**
* Plugin Name: ACSS Effects — Gutenberg Visibility Fix
* Description: Keeps ACSS animated content visible inside the WordPress block editor without changing the front end.
* Version: 1.0.0
*/
defined( 'ABSPATH' ) || exit;
/**
* Load the reset as editor-content CSS. Since WordPress 6.3,
* enqueue_block_assets also places styles inside the editor iframe.
*/
add_action(
'enqueue_block_assets',
static function ()
);
<?php
/**
* Plugin Name: ACSS Effects — Gutenberg Visibility Fix
* Description: Keeps ACSS animated content visible inside the WordPress block editor without changing the front end.
* Version: 1.0.0
*/
defined( 'ABSPATH' ) || exit;
/**
* Load the reset as editor-content CSS. Since WordPress 6.3,
* enqueue_block_assets also places styles inside the editor iframe.
*/
add_action(
'enqueue_block_assets',
static function ()
);
Confirm that the supplied PHP fix is active. If a caching or optimization plugin caches editor assets, clear that cache and reload the editor.
Step 1: Enable the effects in Automatic CSS
Open the Automatic CSS dashboard and enable each effect family you intend to use:
- Hover Effects
- Entrance Effects
- Exit Effects
- On Visible Effects
Only enable the families your site needs. The recipes depend on ACSS’s generated CSS, and On Visible also depends on ACSS’s visibility script.
Step 2: Import the recipes into Etch Toolkit
Open the Etch Toolkit settings and select the Recipes section. Under Import, drop the downloaded JSON file into the import area or choose it from your computer.
Etch Toolkit will preview the import before saving it. Confirm the import, then open the Recipes tab in the Etch Style Manager. The imported recipes use names such as:
- acss-hover-grow
- acss-enter-fade
- acss-enter-all-float
- acss-exit-grow
- acss-visible-fade
- acss-visible-all-stagger
In an Etch CSS editor, type ? followed by the recipe name to insert it.
Step 3: Add the Gutenberg visibility fix
ACSS animation classes can leave blocks transparent, translated, scaled, or blurred inside Gutenberg. The front-end animation script is not meant to run inside the editor, so content using these effects may be difficult or impossible to edit.
The supplied PHP file loads a small CSS reset only in the WordPress editor. It makes ACSS Entrance, Exit, and On Visible content fully visible while editing. It does not disable the effects on the front end.
Add the PHP using one of these methods:
- Add it as a PHP snippet in WPCodeBox or another snippets plugin and set it to run everywhere.
- Add the code to a child theme’s
functions.phpfile. - Package it as a small plugin and activate it.
The snippet uses is_admin() to identify a WordPress admin or editor request. That function does not require the user to have the Administrator role. The reset applies when WordPress loads the editor for any user it has authorized to edit that content, including valid editors of custom post types.
Step 4: Use an ACSS-compatible class name
The class name matters. ACSS discovers effects through specific prefixes, so a custom class must contain the prefix for the effect family it uses.
| Effect | Single element | Direct children |
|---|---|---|
| On Visible | on-visible-- | on-visible-all-- |
| Entrance | on-enter-- | on-enter-all-- |
| Exit | on-exit-- | on-exit-all-- |
| Hover | on-hover-- | Not applicable |
For example, .stagger-fade is an ordinary class. ACSS will not register it as an On Visible effect. Name it .on-visible-all--stagger-fade instead.
You are not adding several ACSS utility classes. The custom-prefixed class is the trigger, and the recipes provide its combined effects.
Use the All recipes for direct children
Recipes containing -all- animate the parent’s direct children instead of the parent itself. Pair them with an ACSS class prefix that also contains -all-.
For example, use this class name:
on-visible-all--fade-float-grow
Then insert the matching recipes:
CSSacss-visible-all-fade
acss-visible-all-float
acss-visible-all-grow
acss-visible-all-fade
acss-visible-all-float
acss-visible-all-grow
Each All recipe includes its own > * selector. As a result, the generated CSS may contain several repeated blocks:
> *
> *
> *
> *
> *
> *
This repetition is valid CSS. The browser combines the declarations and applies them to the same direct children. You can merge the blocks manually, but you don’t have to.
The recipes may also produce repeated final-state selectors:
CSS&.acss-visible > *
&.acss-visible > *
&.acss-visible > *
&.acss-visible > *
&.acss-visible > *
&.acss-visible > *
These are also valid and can remain separate.
Use the All version consistently for every effect in the combination:
CSSacss-visible-all-fade
acss-visible-all-float
acss-visible-all-grow
acss-visible-all-stagger
acss-visible-all-fade
acss-visible-all-float
acss-visible-all-grow
acss-visible-all-stagger
Do not mix acss-visible-fade with acss-visible-all-float. The non-All recipe targets the element carrying the class, while the All recipe targets its direct children.
The > * selector only affects direct children. Grandchildren and other nested descendants will not animate unless they have their own effect class.
Example: Fade and float direct children with a stagger
Create a custom class named:
on-visible-all--stagger-fade
Insert these recipes into the class:
CSSacss-visible-settings
acss-visible-all-fade
acss-visible-all-float
acss-visible-all-stagger
acss-visible-settings
acss-visible-all-fade
acss-visible-all-float
acss-visible-all-stagger
The resulting CSS will look like this:
CSS.on-visible-all--stagger-fade
.on-visible-all--stagger-fade
Apply that one class to the parent element. ACSS observes the parent, adds .acss-visible when it crosses the configured threshold, and transitions its direct children into their final state.
The stagger uses the modern sibling-index() function. Browsers without support still run the fade and float, but the children animate together.
Example: Fade, float, and grow a single element
Create this class:
on-visible--fade-float-grow
Insert:
CSSacss-visible-fade
acss-visible-float
acss-visible-grow
acss-visible-fade
acss-visible-float
acss-visible-grow
ACSS treats the custom class as one On Visible trigger. You do not need to add on-visible--fade, on-visible--float, and on-visible--grow separately to the element.
Example: Entrance and Exit effects
Entrance and Exit effects use CSS scroll-driven animations. They can be composed the same way.
For an element that fades and floats into view, create on-enter--fade-float and insert:
acss-enter-fade
acss-enter-float
acss-enter-fade
acss-enter-float
For a group whose children fade and grow as they leave, create on-exit-all--fade-grow and insert:
acss-exit-all-fade
acss-exit-all-grow
acss-exit-all-fade
acss-exit-all-grow
Add acss-enter-all-stagger or acss-exit-all-stagger when the direct children should start at different points in the scroll timeline.
Example: Hover effects
Create on-hover--float-grow and insert:
acss-hover-float
acss-hover-grow
acss-hover-float
acss-hover-grow
The recipes use individual translate and scale properties, so the effects can run together. Add acss-hover-settings when that class needs a different duration or easing curve from the ACSS defaults.
Customize an effect locally
ACSS custom properties still control the effect amounts. Add overrides to the same custom class after inserting its recipes.
.on-visible-all--stagger-fade
.on-visible-all--stagger-fade
These values affect only elements using this custom class. Global values remain under ACSS control.
Why there is no separate global animation stylesheet
The recipes deliberately omit shared keyframes, base selectors, browser fallbacks, and prefers-reduced-motion rules. ACSS already generates them when the related effects are enabled.
Duplicating that setup in every Etch class would increase page CSS and make the two systems harder to keep in sync. The only extra global code is the Gutenberg editor reset, which does not load on the front end.
Updating the recipes
Importing a newer JSON file updates saved recipes with matching names, but it doesn’t rewrite CSS already inserted into an Etch class.
After updating the recipe file, remove the old effect declarations from any existing custom class and insert the updated recipes again. Newly created classes will use the current recipe definitions.
Troubleshooting
Nothing animates
Check the class name first. It must use the appropriate on-hover--, on-enter--, on-enter-all--, on-exit--, on-exit-all--, on-visible--, or on-visible-all-- prefix.
Then confirm that the matching effect family is enabled in the ACSS dashboard. Clear generated CSS and site caches after changing ACSS settings.
On Visible content appears but does not animate
Make sure the class contains the current Visible recipes. Visible effects use direct opacity, translate, scale, and filter properties. Old recipes that only set --animate-opacity, --animate-block, or --animate-scale will not create an ACSS On Visible transition.
The animation works, but the stagger does not
The stagger recipes depend on sibling-index(). Unsupported browsers ignore the stagger block, so all children animate at the same time. The main effect still works.

Leave a Reply