# Make your stats count up with zero JavaScript

DevFeed: [Make your stats count up with zero JavaScript](<https://devfeed.tech/articles/make-your-stats-count-up-with-zero-javascript-122216.md>)

Original publisher: [Read original article](<https://markodenic.tech/make-your-stats-count-up-with-zero-javascript/>)

Author: Marko

Published: 2026-11-07T11:05:15Z

Content type: tutorial

Language: en

Sources: [Marko Denic Tech](<https://devfeed.tech/sources/marko-denic-tech.md>)

Topics: [Web Development](<https://devfeed.tech/topics/web-development.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [accessible](<https://devfeed.tech/tags/accessible.md>), [agent-memory](<https://devfeed.tech/tags/agent-memory.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [alt-text](<https://devfeed.tech/tags/alt-text.md>), [animate](<https://devfeed.tech/tags/animate.md>), [animation](<https://devfeed.tech/tags/animation.md>), [blog-for-developers](<https://devfeed.tech/tags/blog-for-developers.md>), [browser](<https://devfeed.tech/tags/browser.md>), [browser-support](<https://devfeed.tech/tags/browser-support.md>), [build-faster](<https://devfeed.tech/tags/build-faster.md>), [code-productivity](<https://devfeed.tech/tags/code-productivity.md>), [code-smarter](<https://devfeed.tech/tags/code-smarter.md>), [content-monetization](<https://devfeed.tech/tags/content-monetization.md>), [css](<https://devfeed.tech/tags/css.md>), [css-animation](<https://devfeed.tech/tags/css-animation.md>), [css-performance](<https://devfeed.tech/tags/css-performance.md>), [custom](<https://devfeed.tech/tags/custom.md>), [developer-growth](<https://devfeed.tech/tags/developer-growth.md>), [developer-resources](<https://devfeed.tech/tags/developer-resources.md>), [email-newsletter-for-coders](<https://devfeed.tech/tags/email-newsletter-for-coders.md>), [front-end-development](<https://devfeed.tech/tags/front-end-development.md>), [github-profile-automation](<https://devfeed.tech/tags/github-profile-automation.md>), [html-tips](<https://devfeed.tech/tags/html-tips.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [javascript-tricks](<https://devfeed.tech/tags/javascript-tricks.md>), [learn-to-code](<https://devfeed.tech/tags/learn-to-code.md>), [library](<https://devfeed.tech/tags/library.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [property](<https://devfeed.tech/tags/property.md>), [responsive-design-tips](<https://devfeed.tech/tags/responsive-design-tips.md>), [scroll](<https://devfeed.tech/tags/scroll.md>), [static](<https://devfeed.tech/tags/static.md>), [stats](<https://devfeed.tech/tags/stats.md>), [ui](<https://devfeed.tech/tags/ui.md>), [web-dev-newsletter](<https://devfeed.tech/tags/web-dev-newsletter.md>), [web-development](<https://devfeed.tech/tags/web-development.md>), [web-development-tips](<https://devfeed.tech/tags/web-development-tips.md>), [weekly-dev-tips](<https://devfeed.tech/tags/weekly-dev-tips.md>), [workflow-optimization](<https://devfeed.tech/tags/workflow-optimization.md>), [zero](<https://devfeed.tech/tags/zero.md>)

## AI overview

CSS can animate whole-number stats from zero without a counter library or a JavaScript animation loop: register `--num` with `@property` using `syntax: '<integer>'`, animate it toward a per-element `--to` value, and display it through `counter()`. The example keeps the real number in the HTML for screen readers, search engines, and visitors without CSS; empty generated-content alt text prevents reading duplicate animated digits. A reduced-motion rule shortens the animation so the value still reaches its endpoint. For stats below the fold, the article pauses the CSS animation and uses an `IntersectionObserver` to start it when the container becomes visible. The approach prints integers without thousands separators; decimal values need a workaround or can remain static. The excerpt says `@property` works in Chrome, Edge, Safari, and Firefox, while older browsers show the final number without animation.

## Source excerpt

Static numbers are easy to scroll past. Register one custom property as an integer and CSS counts your stats up from zero, no library and no JavaScript loop.