counting-dynamic-scale — Claude Code rule: counter and font scaling
counting-dynamic-scale animates numeric counters while growing font size via GSAP. Useful for dramatizing stats and metrics in hero sections.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/counting-dynamic-scale.mdWhat counting-dynamic-scale does
This rule specifies an animation pattern where a numeric counter advances while its font size scales upward in tandem. Both actions run within a single GSAP timeline using a proxy state object inside onUpdate, updating text content and inline font size every frame without drift.
The layout structure contains a fixed-width wrapper, an animated suffix element, and a label. The rule schedules the suffix entrance right after the number stops rolling, while the accompanying label fades in halfway through the sequence. Deceleration curves like power2.out or power3.out are preferred for natural braking.
Without font-variant-numeric: tabular-nums, changing digit widths cause aggressive horizontal jitter during the run. That makes tabular numbers mandatory for this pattern, along with having GSAP available in the target page.
What it helps with
- synchronize numeric increments with scaling typography
- eliminate layout shifts when digits roll during count animations
- choreograph metric labels and suffixes alongside number tweens
Example prompts for the agent
- Build a landing page hero counter where font size scales up dynamically with the number
- Set up three coordinated metric counters using the counting-dynamic-scale rule
How to install counting-dynamic-scale
Manually: put the files in place
.claude/rules/counting-dynamic-scale.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/counting-dynamic-scale.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/counting-dynamic-scale.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/counting-dynamic-scale.mdManually: put the files in place
.clinerules/counting-dynamic-scale.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about counting-dynamic-scale
How to install counting-dynamic-scale in Claude Code?
Add the rule markdown file to your project repository at .claude/rules/counting-dynamic-scale.md.
What does counting-dynamic-scale do?
It structures a GSAP animation that scales up font size alongside an incrementing number to communicate visual weight.
Why is tabular-nums mandatory for this counter?
Proportional numbers vary in width, so skipping tabular-nums makes the container twitch horizontally as digits cycle rapidly.