Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cssanimationio

yesiamrocks822SEE LICENSE IN LICENSE5.5.0

A Powerful CSS Animation Library with GSAP Support for Advanced Motion Design.

css, animation, CSS animation library, scroll animation, gsap animation, text animation, pure CSS animations, letter animation effects, CSS keyframe animations, animate text with CSS

readme

CSS Animation Library for Developers and Ninjas — cssanimation.io

A Powerful CSS Animation Library with GSAP Support for Advanced Motion Design.

CSS NPM jsDelivr GitHub issues GitHub stars Live Demo Contributor Covenant

GSAP Support

cssanimation.io is a lightweight, modular CSS animation library built for front-end developers, creative coders, and UI ninjas. Get access to A Rich Set of Ready-to-Use Animation Classes (both pure CSS and GSAP-powered!) to bring your interfaces to life. From simple fades and zooms to dynamic letter effects and 3D transitions, we’ve got your motion design needs covered.

You're in control. Just apply the class names where you want them. Zero setup. No JavaScript needed (unless you want GSAP). Just clean, reusable animations that "just work."

Why Developers Love It

  • Extensive Library of Pre-built Animations: Easily add fades, zooms, rotates, bounces, skews, and much more.
  • GSAP support: Integrate powerful animations with GreenSock for advanced control.
  • Text, Element, & Letter Animations: Bring life to individual letters, words, or entire elements.
  • Super Easy to Use: Just add a class and your animation is live. Seriously!
  • Highly Customizable: Tweak animation properties to fit your design perfectly.
  • Zero JavaScript Dependencies (for CSS-only): Keep your project lean and fast.
  • Modern Dev Friendly: Works great with Tailwind CSS, React, and your favorite build tools.

🛠️ Get Started: Installation

Choose the method that fits your workflow best.

Install via NPM

npm i cssanimationio

Import Everything (Core Library, CSS Utility Classes & Letter Animation):

import 'cssanimationio';

Individual Imports (if you only need specific parts):

CSS only

// Core CSS animations
import 'cssanimationio/css';

// Utility CSS classes (like speed, delay, easing)
import 'cssanimationio/utility';

For Letter Animations (JavaScript required for this part):

//letter-by-letter, word-by-word, and line-by-line animations
import 'cssanimationio/letter';

Install via CDN

Quickly add cssanimation.io to your HTML. Include these lines in your <head>tag:

<head>
  <link href="https://cdn.jsdelivr.net/npm/cssanimationio@latest/dist/cssanimation.min.css" rel="stylesheet" />
  <link href="https://cdn.jsdelivr.net/npm/cssanimationio@latest/dist/cssanimation-utility.min.css" rel="stylesheet" />
</head>

🧩 How to Use It

Once installed, simply add the base.cssanimation to your element, along with your chosen animation class like .ca__fx-FadeIn for fade in animation.

<h1 class="cssanimation ca__fx-FadeIn">cssanimation</h1>

That's it! You've got a CSS animated element. Super! 🎉

For the demo and list of animation class name click here.

Understanding Our Class Prefixes

We use clear prefixes to help you find the right animation or utility class.

Prefix Description Example Usage
ca__fx- Visual FX animations (pure CSS) <h1 class="ca__fx-BounceX">
ca__u- Utility classes (pure CSS spacing, layout, etc.) <h1 class="ca__u-SpeedChill">

🔡 Amazing Text & Letter Animations

Want to animate text beautifully, responsively, and with zero dependencies (for the core CSS parts)?

ca-letteranimation.js plugin is a lightweight, CSS-only enhancement script that brings letter-by-letter, word-by-word, and line-by-line animations to your projects. It's designed to work seamlessly with cssanimation.io, for robust and customizable text effects.

Key Features

  • Highly customizable: Control animations directly with HTML attributes.
  • Animate Letters, Words, and Lines: Independent control for precise effects.
  • Custom CSS Animation Classes: Use any cssanimation.io class you like.
  • Sequential Animation Logic: Units wait for the previous one to complete.
  • Random & Reverse Effects: Get creative with animation order.
  • Smart Handling: Safely handles whitespace and provides animation class fallbacks.

Letter Animation Installation

If you're already using cssanimation.io via NPM, you're all set!

For plain HTML, include the ca-letteranimation.js, plugin just before your closing </body> tag:

<script src="https://cdn.jsdelivr.net/npm/cssanimationio@latest/dist/ca-letteranimation.js"></script>

Letter Animation Usage

Every animated text block needs the .cssanimation class along with a ca__lt-* attribute to define how it animates.

1. Letter-by-Letter Animation

Animate text one letter at a time with different sequencing styles:

➜ Sequential (in order): ca__lt-sequence

<h1 class="cssanimation" ca__lt-sequence="ca__fx-FadeIn">Letters Animate</h1>

➜ Randomized order ca__lt-random

<p class="cssanimation" ca__lt-random="ca__fx-BounceInTop">Randomized entry!</p>

➜ Reverse (last letter first) ca__lt-reverse

<h3 class="cssanimation" ca__lt-reverse="ca__fx-MoveFromTop">Backwards Flow</h3>

2. Word-by-Word Animation ca__lt-word

<h2 class="cssanimation" ca__lt-word="ca__fx-FadeIn">Each word animates uniquely</h2>

3. Line-by-line Animation ca__lt-line

<p class="cssanimation" ca__lt-line="ca__fx-FadeIn">
  First line<br />
  Second line<br />
  Third line
</p>

Split lines by periods "." or by <br> / \n. Use ca__lt-separator="dot" for period separation.

<p class="cssanimation" ca__lt-line="ca__fx-FadeIn" ca__lt-separator="dot">Step 1. Step 2. Step 3.</p>

You don't need to add ca__lt-separator for <br> or newlines, this is the default behavior.

🔥You can assign different animation classes and delays to each word and line! Space-separate your class names and delay values.

<h2 class="cssanimation" ca__lt-word="ca__fx-FadeIn ca__fx-MoveFromTop ca__fx-MoveFromBottom ca__fx-MoveFromRight">
  Each word animates uniquely
</h2>
<p class="cssanimation" ca__lt-line="ca__fx-BlurIn ca__fx-BounceFromTop ca__fx-BounceX">
  First line<br />
  Second line<br />
  Third line
</p>



⏱️ ca__lt-delay in Detail

The ca__lt-delay attribute specifies the delay before each animated unit (letter, word, or line) begins its animation. The values are in milliseconds (ms).

Single Value: If you provide a single value, that delay will be applied to every unit.

<h1 class="cssanimation" ca__lt-sequence="ca__fx-FadeIn" ca__lt-delay="100">Each letter delays by 100ms</h1>

Multiple Values: This is where it gets powerful! You can provide multiple space-separated values. These values will be applied sequentially to each unit. If you provide fewer delay values than there are units, the last delay value will repeat for the remaining units.

<h2 class="cssanimation" ca__lt-word="ca__fx-FadeIn" ca__lt-delay="0 200 400">
  First word, then 200ms, then 400ms, then 400ms
</h2>

This allows you to create rhythmic or staggered entry effects easily, like ca__lt-delay="50 100 100" as in your example. The first unit gets 50ms delay, and all subsequent units get 100ms delay.



ca__lt-base-duration in Detail

The ca__lt-base-duration attribute provides a simple way to set a global default animation duration for all units (letters, words, or lines) in milliseconds (ms).

This value is used to explicitly set the duration for all units, overriding any animation-duration or transition-duration that might be detected from the CSS classes applied to the element.

<h3 class="cssanimation" ca__lt-sequence="ca__fx-PopIn" ca__lt-base-duration="750">Global base duration</h3>

Precedence:

  1. ca__lt-base-duration (global override)
  2. CSS-defined duration (auto-detected from your animation class if ca__lt-base-duration is absent)
  3. Internal library default (if no duration is specified anywhere)

This means ca__lt-base-duration gives you a convenient way to set a project-wide or component-wide default duration without needing to edit CSS.

🏷️ Supported Attributes for Text Animations Plugin

Attribute Description
ca__lt-sequence Animates letter-by-letter, in order.
ca__lt-random Animates letter-by-letter, in a randomized order.
ca__lt-reverse Animates letter-by-letter, in reverse order (last letter first).
ca__lt-word Animates word-by-word.
ca__lt-line Animates line-by-line.
ca__lt-delay Accepts one or more delay values (e.g., 100 300 500) in milliseconds per unit.
ca__lt-base-duration Optional base animation duration per unit (in ms)
ca__lt-separator Use dot to split on periods ( . ). Default: line breaks (<br> or \n)

💡Developer Tips

  • The .cssanimation class is always required for baseline styling and to activate text animations.
  • You can provide fewer classes or delay values than units; the last value will simply repeat for the remaining units, making it easy to apply a pattern.
  • If you pass more classes or values than needed, the extra elements are skipped, and a warning might be logged to your console to help with debugging.
  • Delay and duration values are parsed safely; non-numeric strings will fall back to default behaviors to prevent errors.
  • Animation duration is determined in this order of precedence: ca__lt-base-duration > CSS-detected duration > internal default.

Example: Full Setup

<h2 class="cssanimation" ca__lt-word="fadeIn bounce slide rotate" ca__lt-delay="200 300 400" ca__lt-duration="1000">
  Animate each word smoothly
</h2>

📦 Modular Import

Want to keep your bundle size minimal? Only import the effects you actually use!

HTML

<link rel="stylesheet" href="./dist/modules/ca__FadeIn.css" />

CSS or SCSS

@import './dist/modules/ca__fx-fadeIn.css';

JavaScript (Webpack/Vite/Rollup)

import './dist/modules/ca__fx-fadeIn.css';

Available Modules

Each module is generated from ./dist/cssanimation.css and follows the naming convention: ca__fx-[animationName].css. Check out the ./dist/modules/ folder to see them all!

Module File
Blur In ./dist/modules/ca__fx-blurIn.css
Blur Out ./dist/modules/ca__fx-blurOutLeft.css
Jello ./dist/modules/ca__fx-jello.css
Jitter ./dist/modules/ca__fx-jitter.css
Quiver ./dist/modules/ca__fx-quiver.css
...and more See ./dist/modules/ folder

🧰 Utility Class

cssanimation.io also provides a powerful set of pre-built utility classes to fine-tune your animations. Use them alongside the .cssanimation base class and your chosen animation class.

This includes:

  • .ca__u-speed*: Control animation speed (e.g., .ca__u-speedChill).
  • .ca__u-ease*: Set easing functions (e.g., .ca__u-easeSnappy).
  • .ca__u-loop*: Define repeat settings (e.g., .ca__u-loopTriple).
  • .ca__u-delay*: Add animation delays (e.g., .ca__u-delay3).

Check out the full list and details in cssanimation-utilities.md.

🎉 That’s It!

Elevate with GSAPAnimation

Looking to go beyond CSS with scroll triggers, advanced sequencing, and even more control?

👉 Check out GSAPAnimation

It's a lightweight GSAP toolkit built to extend cssanimation.io with JavaScript superpowers.

  • ca__gx-FadeIn: Our "Gold Standard" GSAP animations.
  • ca-gsap-options='{}': Easily pass GSAP options directly to your animation functions.
  • ca__gx-lt: For powerful per-letter motion (sequence, random, reverse).
  • Zero-setup: Plug-and-play with any HTML — no complex JS setup needed.
<h1 ca-gsap="ca__gx-FadeIn" ca__gx-lt="sequence">cssanimation.io GSAP</h1>

Explore GSAPAnimation for more magic»



CSS vs. GSAP – Which Animation Version Should You Use?

Feature / Capability CSS Version GSAP Version
Technology Pure CSS JavaScript (GSAP)
Performance Great for simple UI effects Optimized for complex, smooth animations
Control Fine-grained control via CSS Fine-grained control via JS (timing, easing)
Animation Types Predefined class-based animations Class-based with dynamic GSAP tweening
Letter Animation Support ✅ Sequence & Random ✅ Sequence only (random coming soon)
Looping & Repeating infinite class Full loop control via JS (e.g. repeat, yoyo)
Configuration Minimal setup Script includes + optional JS tweaks
Customization Moderate (via utility classes) High — control properties on the fly
Size Very lightweight (no JS needed) Heavier due to JS dependency
Dependencies None Requires GSAP (TweenMax)
CDN Available? ✅ Yes ✅ Yes
NPM Ready? ✅ Yes (cssanimationio) ✅ Yes (cssanimationio)
Use Case Examples Hover states, hero sections, banners Interactive animations, scroll triggers, custom flows

Accessibility: Respecting User Preferences

By default, cssanimation.io respects user system preferences. When prefers-reduced-motion: reduce is enabled in a user's operating system settings, animations are automatically turned off for a more comfortable user experience.

License

cssanimation.io is licensed under the Parity Public License.

Contribute

We welcome issues, pull requests, and suggestions! 🤝 Help us make animations even more magical for everyone.

Built with ❤️ by Pavel Connect on LinkedIn

changelog

[v5.5.0] - 2025-06-11

New Features

  • Live Preview Support
    Introduced the ability to dynamically reapply caLetterAnimation(el) on elements. This enables live animation previews when DOM or attribute values change, perfect for visual editors or dev playgrounds.

  • Runtime Reinitialization
    caLetterAnimation can now safely be re-invoked on the same element. All animation units (letters, words, lines) are recalculated and replayed based on current attributes.

  • Dynamic Attribute Parsing
    Automatically parses and updates:

    • ca__lt-sequence
    • ca__lt-random
    • ca__lt-reverse
    • ca__lt-word
    • ca__lt-line
  • ca__lt-separator Support
    When ca__lt-line is used, users can now add ca__lt-separator="dot" to animate lines split by . instead of <br> or \n.

  • Multi-Class + Delay Handling
    Accepts multiple space-separated animation classes (e.g., ca__fx-FadeIn ca__fx-BounceIn) and delay sequences (100 200 300) mapped across units.

  • Global Duration Control
    Full support for ca__lt-base-duration allows global timing override (in milliseconds), improving consistency across animations.

Improvements

  • Safer attribute parsing and fallback logic to prevent JS errors.
  • Improved compatibility with design tools and runtime environments.
  • Modularized internal logic for future extensibility.

Developer Notes

This release powers use cases like:

  • UI animation playgrounds
  • Visual text preview builders
  • Runtime-reactive design systems

It works seamlessly in both static and JS-driven environments, with no dependencies beyond the base CSS.

[5.4.0] - 2025-06-11

Added

  • New Elastic CSS Animations: Introduced 10 new, unique, and highly responsive CSS-only elastic animations for enhanced UI interactivity.
    • elasticBounce: A classic bounce effect, ideal for elements appearing or landing.
    • springyEffect: A generalized spring-like scale and squash effect.
    • wobbleAnimation: Horizontal translational wobble with slight rotation.
    • jiggleTransform: A playful rotation and subtle scale jiggle.
    • stretchCollapse: Vertical stretch and subsequent subtle collapse effect.
    • reboundMotion: Upward movement followed by a firm rebound to origin.
    • snapBackEase: An expanding entrance with a subtle overshoot and snap back.
    • flexiShrink: A quick shrink animation with an elastic overshoot.
    • bouncyScale: A large scale-in effect with a pronounced bounce at the end.
    • pulseElastic: A continuously pulsing elastic effect, suitable for attention-grabbing elements.

[5.3.0] – 2025-06-10

Added

🎯 Bounce Animation Suite — 10 new motion effects inspired by natural movement, UI interaction, and playful energy:

  • ca__fx-spring — quick springy bounce with snappy return
  • ca__fx-boing — exaggerated cartoon-style bounce
  • ca__fx-hop — fast and light hop
  • ca__fx-lift — elegant upward float and return
  • ca__fx-popUp — subtle UI-style pop (great for buttons, tooltips)
  • ca__fx-rebound — bounce + recoil like a soft collision
  • ca__fx-jump — straight vertical jump motion
  • ca__fx-launch — powerful upward launch with overshoot
  • ca__fx-elasticRise — squishy bounce using vertical scaling
  • ca__fx-levitate — smooth infinite hovering/levitation

All animations are pure CSS and support timing/intensity overrides via CSS variables for easy theming and control.

5.2.1

Added

  • New Vibe Animations Group (ca__fx-*) — subtle to intense shake/motion effects:
    • ca__fx-jiggle — playful wobble with tilt
    • ca__fx-quiver — light trembling
    • ca__fx-tremor — slow, heavy shaking
    • ca__fx-rumble — rapid seismic jitter with rotation
    • ca__fx-wiggle — smooth side-to-side rocking
    • ca__fx-rattle — short, rapid left/right vibration
    • ca__fx-buzz — tight, fast micro-movement (like a phone vibration)

All effects use pure CSS with customizable --duration and --intensity variables for full control.

5.1.1

Fixes

  • Build Script Compatibility:
    • Resolved ReferenceError: require is not defined errors across all Node.js utility scripts (e.g., postcss.config.js, tools/extract-class-names.js, tools/build-animation-index.js, tools/generate-animation-demo.js, tools/generate-animation-preview.js, tools/export-modules.js).
    • This was achieved by either converting scripts to full ES Module syntax or explicitly marking them as CommonJS (.cjs) where required by specific tool loaders (like stylelint.config.cjs).
    • Standardized internal file path resolution to use import.meta.url and path.resolve(__dirname, ...) for consistent behavior in ES Module environments.
  • Stylelint Configuration & Execution:
    • Fixed ERR_REQUIRE_CYCLE_MODULE error by ensuring stylelint.config.js was correctly named stylelint.config.cjs and reverted to CommonJS export syntax for cosmiconfig compatibility.
    • Resolved Error: ENOENT: no such file or directory by updating package.json scripts to correctly reference stylelint.config.cjs.
    • Addressed Unknown rule no-empty-first-line by removing the unrecognized rule from the configuration.
    • Disabled the keyframe-block-no-duplicate-selectors rule to prevent unnecessary linting errors in compiled animation keyframes.
    • Corrected import-notation errors in dist/modules/ca__modules-index.css by updating tools/export-modules.js to generate @import url(...) syntax.
  • CSS Generation & Linting Exclusions:
    • Updated tools/export-modules.js to automatically inject /* stylelint-disable */ and /* stylelint-enable */ comments around foundational CSS blocks (:root, .cssanimation, .cssanimation span, .infinite, @media (prefers-reduced-motion: reduce)) in all generated module files (src/modules/*.css). This allows for targeted linting of animation-specific rules while ignoring universal styles.
    • Cleaned up dist/cssanimation.css to resolve a CssSyntaxError: All rules have already been disabled by removing conflicting Stylelint disable comments.

Build System Improvements

  • Targeted Linting: Stylelint now exclusively targets compiled, un-minified CSS files within the dist folder (dist/**/*.css), automatically ignoring .min.css files globally.
  • Refined Class Pattern: The selector-class-pattern in Stylelint configuration is now strictly applied to prefixed ca__ classes, matching the output of the PostCSS build process.
  • Streamlined Module Export: The tools/export-modules.js script provides a more robust and automated process for separating animations into individual CSS files, including common base styles and meta-comments.

Version 5.1.0 - 2025-06-09

Features

  • Modernized JavaScript Build Pipeline:
    • Introduced Rollup.js for efficient JavaScript bundling, resulting in smaller, optimized output files.
    • Integrated Terser via @rollup/plugin-terser for robust JavaScript minification.
    • Automatically injects dynamic, versioned header comments (parsed from package.json) into both un-minified (.js) and minified (.min.js) output files.
  • Infrastructure Modernization (ES Modules):
    • Project-wide migration of all internal Node.js build and utility scripts to ES Module (import/export) syntax. This includes postcss.config.js, and all scripts within the tools/ directory (extract-class-names.js, build-animation-index.js, generate-animation-demo.js, generate-animation-preview.js).

Refactor

  • ES Module Conversion: All affected Node.js scripts were refactored from CommonJS require() to ES Module import syntax.
  • Path Resolution: Standardized file path resolution within scripts using import.meta.url and path.resolve(__dirname, ...), replacing older CommonJS __dirname patterns for compatibility and robustness.
  • Header Comment Consistency: Ensured both CSS and JavaScript build processes output header comments in the universally recognized /*! format for reliable preservation by minifiers.

Fixes

  • Build Script Errors: Resolved ReferenceError: require is not defined errors that occurred after setting "type": "module" in package.json.
  • Missing Headers: Fixed issues preventing the dynamic header comment block from being correctly added and preserved in both minified CSS and JavaScript output files.

Version: 5.0.0

Major Text Animation Overhaul

New Features

  • Letter-by-Letter, Word-by-Word, and Line-by-Line Animations Introducing granular text animations:
    • Letter-by-Letter Animation: Animate each letter sequentially, randomly, or in reverse.
    • Word-by-Word Animation: Animate text one word at a time.
    • Line-by-Line Animation: Animate text line by line, with support for custom separators.
  • Flexible Animation Class Support: No longer limited to .ca__le* classes. Now, any CSS animation class can be used with text animations, providing greater flexibility.
  • Enhanced Timing Control with ca__lt-delay and ca__lt-base-duration Fine-tune animation timing:
    • ca__lt-delay: Specify delays (in milliseconds) for each unit (letter, word, or line).
    • ca__lt-base-duration: Set a base duration for animations, overriding default durations.

Example Usage

<h1 class="cssanimation" ca__lt-sequence="ca__fx-FadeIn">Animate Me</h1>

<p class="cssanimation" ca__lt-word="ca__fx-SlideUp" ca__lt-delay="100">Word by word animation with delay</p>

<h2 class="cssanimation" ca__lt-line="ca__fx-FlipIn" ca__lt-separator="dot">First sentence. Second sentence.</h2>

Migration Instructions

Version 5.0.0 introduces a significant overhaul of how text-based animations (Letter-by-Letter, Word-by-Word, Line-by-Line) are configured. This version moves away from a reliance on the .ca__le*CSS class to a more flexible and powerful attribute-based approach.

  • Simplified HTML Markup: Previously, letter animations required .ca__le* classes. Now, simply add the ca__lt-* attribute to your HTML elements:

Previous

<h1 class="cssanimation ca__lt-FadeIn sequence">Animate Me</h1>

Now

<h1 class="cssanimation" ca__lt-sequence="ca__fx-FadeIn">Animate Me</h1>

Attribute-Based Control

New animation control attributes: Customize animations directly in HTML using attributes:

  • ca__lt-sequence: Animate letters in order
  • ca__lt-random: Animate letters randomly
  • ca__lt-reverse: Animate letters in reverse
  • ca__lt-word: Word-by-word animation
  • ca__lt-line: Line-by-line animation
  • ca__lt-delay: Delay between items in ms
  • ca__lt-base-duration: Override default duration
  • ca__lt-separator: Define custom separators for line animations (e.g., "dot" for periods).

Additional Enhancements

  • Improved Documentation: Comprehensive guides and examples are available in the README, detailing usage and customization options.
  • Demo Page Updates: The demo page now showcases the new animation features with updated examples and interactive previews.

For detailed examples and further information, please refer to the official documentation.

Let me know if you need assistance with integrating these new features into your project!

Version: 4.1.0

Features

  • Support for ca__lt-duration Attribute

    • Developers can now manually specify base animation duration using:
      ca__lt-duration="2000"
  • Auto-Detect Animation Duration from CSS

    • If ca__lt-duration is not provided, the script will:
      1. Read the animation-duration from the first animation class
      2. Fallback to 1000ms if unavailable
  • Robust Delay Handling with parseDelaySteps()

    • Malformed or non-numeric delay values in ca__lt-delay are ignored safely
    • Fallbacks to default values when necessary
  • Improved Sequential Timing Logic

    • processSequentialBy() now:
      • Adds currentUnitDelay + baseDuration to create true chained animations
      • Supports precise per-unit timing (e.g. 300 500 800)
      • Applies consistent cumulative offset behavior across words/lines
  • Better Code Readability & Maintenance

    • Delay and duration logic abstracted into reusable utilities
    • Cleaner and more modular for future additions (e.g. easing, loop, scroll-trigger)

Example Usage

<h2 ca__lt-word="fadeIn bounce slide" ca__lt-delay="300 800 200" ca__lt-duration="1500">
  Each word animates with precise delay and duration
</h2>

Version: 4.0.0

Major Update: GSAP Integration Moved to New Repo

This release removes all GSAP-related code, build logic, and dependencies from the cssanimation.io package.

What's Changed:

  • 🧹 Removed rollup.config.js and the build:gsap script
  • 🗃️ Deleted all GSAP output files from /dist (e.g., cssanimation-gsap.*)
  • 📦 Removed GSAP from devDependencies and peerDependencies
  • 🎯 Updated package.json exports to reflect CSS-only assets
  • 🔗 Added crosslink in README.md to gsapanimation — a dedicated repo for GSAP triggers, letter animation, and ScrollTrigger support

New Structure Moving Forward:

  • cssanimation.io: Pure CSS animation classes.
  • gsapanimation: JavaScript-based enhancements powered by GSAP

This cleanup makes cssanimation.io lighter, faster, and more focused. Perfect for storytelling sites, Tailwind projects, and CSS-only workflows.

Version: 3.1.2

Documentation

  • Enhanced GSAP Letter Animation Guide
  • Added detailed usage instructions for the ca__gx-lt attribute supporting sequence, reverse, and random values.
  • Includes updated examples, automatic span-wrapping explanation, and simplified ca-gsap usage syntax.

Changed

  • index.js now loads full cssanimation.io stack (CSS + letter animations + GSAP) in one import
  • Removed direct UMD imports from ESM entry to prevent bundler issues
  • Improved DX: using import 'cssanimationio' now auto-initializes animations
  • Enhanced debug tooling with optional window.__CA_DEBUG flag

Version: 3.1.1

Added

  • removeLetterAnimationHints() utility in gsap-letteranimation.js to clean up GPU-related styles after animations complete.

Changed

  • Updated animateFadeIn and animateFadeInLeft:
    • Automatically remove will-change, backface-visibility, and transform-style inline styles after animations.
    • Preserves any user-provided onComplete callbacks.
    • Improves memory efficiency for long-running or high-volume animation use.

Notes

  • Applies to both block and letter-based animations (ca__gx-lt).
  • No developer setup required — cleanup is built-in and automatic.

Version: 3.1.0

Added

  • Automatic prefixing of GSAP animation map keys using ca__gx- in gen-animation-map.mjs

Changed

  • Internal map generation now uses consistent naming with cssanimation.io
  • All animation names can now be referenced uniformly across utility, GSAP, and data-attribute APIs

Version: 3.0.3

Added

  • Modular export system for animations
    A new Node.js script automatically extracts animation blocks from ./dist/cssanimation.css and creates:

    • Individual module files using PascalCase naming (e.g., ca__LetterFadeIn.css)
    • Metadata headers in each file with module info and usage examples
  • ca__index.css auto-generated a central file that imports all animation modules.

📁 Example Output

./dist/modules/
├── ca__LetterFadeIn.css
├── ca__BounceUp.css
├── ca__ZoomSlideLeft.css
├── ca__index.css

Version: 3.0.2

Added

ca__lt-delay attribute support Developers can now control the delay between animated letters directly from HTML markup:

  • Example: <div class="ca__lt-sequence" ca__lt-delay="200">Hello</div>
  • No JS changes required

Improved

  • Code updated to check for this attribute while preserving default delay behavior
  • Fully backward compatible

Version: 3.0.1

Enhancements

  • PascalCase Class Prefixing:
    • All class names now auto-convert to PascalCase format.
    • Helps maintain consistency, improves readability, and avoids naming collisions.

Prefixing Rules by File Type

File Prefix Example Before Example After
cssanimation.css ca__fx- .bounce-in .ca__fx-BounceIn
cssanimation-utility.css ca__u- .grid-helper .ca__u-GridHelper
Classes starting with le ca__lt- .le-shake-text .ca__lt-ShakeText

Safe-Guarded Classes

These global classes are excluded from prefixing:

  • .cssanimation
  • .cssanimation span
  • .infinite

Developer Notes

  • Class name logic lives in postcss/prefixer.js
  • Ensure to run npm run prefix:css:all before build to apply changes
  • Follow consistent class naming in raw .css files to avoid malformed output

Version: 3.0.0

Added

  • GSAP Animation Engine: Introduced a new modular engine (cssanimation-gsap.js) that enables GSAP-powered animations using HTML attributes.
    • Usage via data-gsap="bounce" and data-gsap-options='{ "y": 30, "duration": 1.5 }'
    • Supports all GSAP animation properties like x, y, opacity, scale, ease, repeat, etc.
    • Compatible with Vite, Webpack, and plain HTML via UMD build.
  • Generated Animation Map: Auto-generated generated-animation-map.js maps data-gsap names to animation functions for scalable modularity.
  • Error Handling: Robust JSON validation for data-gsap-options with helpful console messages to aid developers.
  • New NPM Build Targets:
    • dist/ca__gsap/cssanimation-gsap.umd.js – UMD-compatible build for browser use
    • src/animations/ – Modular animation definitions
  • Developer Tools:
    • Auto-copying of animations and ca__gsap folders in build
    • Added generate:map script to manage animation mapping
    • Improved package.json scripts and dev dependencies

Changed

  • Restructured src/animations/ to follow one-module-per-animation best practice.
  • Added gsap as a peerDependency to avoid forced version locks.
  • Updated README with GSAP usage examples for:
    • NPM + Vite/ESM setup
    • Plain HTML via <script> + CDN

Breaking Changes

  • GSAP is now a required peer dependency. Developers must install GSAP themselves: bash npm install cssanimationio gsap

Version: 2.2.1

Added

  • Support for .ca__le* letter animation classes in the class extraction tool
  • A new dedicated section in cssanimation-reference.md titled "Letter Animations Class"
  • Automated placement of the letter class section after cssanimation.css for improved logical flow

Changed

  • Improved extract-class-names.js script structure and maintainability
  • Enhanced code readability with extensive inline comments to help future contributors

Output Example

## cssanimation.css

- `.ca__ease-in`
- `.ca__delay-500`

## Letter Animations Class

- `.ca__leFadeIn`
- `.ca__leZoomOut`

## cssanimation-utility.css

Version: 2.2.0

Added

  • Scoped Class Naming
    Introduced .ca__sequence and .ca__random class names to replace .sequence and .random. This avoids conflicts with third-party styles or libraries and improves maintainability across large projects and frameworks.

  • HTML-Aware Text Animation
    Updated the animation engine to traverse DOM nodes recursively. Now it wraps only pure text characters in <span> tags for animation while leaving nested HTML elements (like <span> icons, <strong>, etc.) untouched.

Compatibility

  • Fully tested in latest versions of:

    • Chrome, Firefox, Safari, Edge, Opera
    • iOS & Android mobile browsers
  • Compatible with:

    • React (via useEffect or DOM ref)
    • jQuery
    • Vanilla JS / Web Components

Migration Notes

  • Replace old class references:

    - <div class="sequence">
    - <div class="random">
    * <div class="ca__sequence">
    * <div class="ca__random">

Version: v2.0.4

Production Build & Modular Structure Refinement

Released: May 2025 Tag: v2.0.4 Focus: Clean publish, modular structure, and future-friendly folder refactor

What’s New

  • Dist-Only Publishing to NPM Package is now cleaner and production-focused. Only the dist/ folder is published, reducing size and removing dev clutter.

  • New Folder Structure Modular CSS animations (e.g., fade.css, rotate.css, zoom.css) have been moved into a new dist/modules/ directory for better organization.


Version: v2.0.3

Production-Ready Build – Only dist/ Published

Released: May 2025 Tag: v2.0.3 Focus: Clean publish and future-friendly folder refactor

Release Summary

This release refines the package for real-world usage and distribution by publishing only the compiled assets in the dist/ folder. It ensures consumers get exactly what they need—no build tools, no source clutter, just pure animations.

What’s New in v2.0.3:

  • dist/-only NPM package Reduced package size by excluding source files, configs, and dev tools — only production-ready assets are now shipped.
  • Cleaned Up File Structure Improved maintainability by restructuring with a modular CSS build system and separating utility/animation modules.

Optimized NPM Publish

Updated the package.json files field to explicitly include:

  • dist/
  • README.md
  • LICENSE