This directory demonstrates how to implement CSS animations and effects in WordPress using the Block Editor without any plugins.
https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/rfluethi/WordPress-Playgrounds/main/css-animations-example/blueprint.jsonFor a complete step-by-step tutorial on implementing these CSS animations, see the CSS Animations Tutorial.
This WordPress Playground demonstrates various CSS animation techniques that can be applied to blocks in the WordPress Block Editor:
- Button Press Animation - Buttons that lift on hover and press down when clicked
- Color Change on Hover - Text that changes color when you hover over it
- Background Effects - Elements that get highlighted backgrounds on hover
- Image Zoom Effects - Images that scale and get shadows on hover
- Service Card Animations - Interactive cards with multiple hover effects
The blueprint includes these ready-to-use CSS classes:
button-press- Button interaction effectshover-color- Color change on hoverhover-bg- Background highlight on hoverimage-zoom- Image scaling and shadow effectsservice-card- Multi-effect card animationsshadow-zoom- Scale and shadow combinationfade-in- Fade in animationslide-in- Slide in from leftpulse- Pulsing animationrotate- Rotation on hoverbounce- Bouncing animation
- CSS Classes: The animations are applied using CSS classes like
button-press,hover-color,image-zoom - Block Editor Integration: Each class can be applied to any WordPress block via the "Additional CSS class(es)" field
- Pure CSS: No JavaScript or plugins required - just CSS transitions and keyframe animations
- Block Theme Integration: CSS is automatically injected via the Additional CSS feature
blueprint.json- WordPress Playground blueprint that loads the democss-animations-example.xml- WXR export containing the demo content with applied CSS classescss-animations-example-tutorial.md- Detailed tutorial on implementing these effectsREADME.md- This documentation file
This example is perfect for:
- WordPress developers learning CSS animations in the Block Editor
- Content creators who want to add visual effects to their pages
- Educators teaching modern CSS techniques in WordPress
- Designers exploring interaction possibilities in WordPress
The blueprint:
- Installs and activates a custom Block Theme for optimal CSS support
- Imports the WXR content with pre-configured blocks and CSS classes
- Injects CSS animation styles directly into WordPress via
wp_update_custom_css_post() - Provides immediate visual feedback for all animation effects
- Automatically redirects to the CSS animations demo page
All animations use modern CSS features like transition, transform, and @keyframes for smooth, performant effects that work across all modern browsers.
