<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz" -->

---
title: Nobody told me CSS could do this | daily.dev
description: A hands-on walkthrough of building scroll-triggered, one-time-fire animations using only CSS, no JavaScript. Covers custom properties toggled via container...
canonical: https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Nobody told me CSS could do this | daily.dev
og:description: A hands-on walkthrough of building scroll-triggered, one-time-fire animations using only CSS, no JavaScript. Covers custom properties toggled via container...
og:url: https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz
og:image: https://api.daily.dev/og/posts/rWPB9fZwZ.png
og:image:alt: Nobody told me CSS could do this
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Nobody told me CSS could do this

**[Kevin Powell](https://daily.dev/sources/kevinpowell)** · 9 min read · 52 upvotes · 5 comments

## Summary

A hands-on walkthrough of building scroll-triggered, one-time-fire animations using only CSS, no JavaScript. Covers custom properties toggled via container style queries, keyframe animations driven by animation-timeline: view, controlling entry points with animation-range, fixing repeated triggering using animation-play-state, and adding a staggered delay effect using auto-fit grid column selectors. Ends with browser support notes using @supports for animation-timeline: view and adding prefers-reduced-motion for accessibility.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=onraoQExbHw>

## Questions this post answers

### How do I create scroll-triggered animations in CSS without JavaScript?

Use a two-layer element structure where the outer element has a custom property like --in-view set to false, and a keyframes animation that switches it to true using animation-timeline: view. Then use a container style query on the inner card to detect when --in-view is true and apply the desired visual change, such as opacity, scale, or an outline.

_Developers exploring pure CSS scroll animations can find implementation walkthroughs like this on daily.dev._

### How do I stop a CSS scroll-driven animation from re-triggering every time I scroll up and down?

Move the animation off the container style query and instead control it with animation-play-state set to paused or running based on visibility. This runs the animation once toward its end state and pauses it there when the element leaves the viewport, preventing it from resetting or replaying repeatedly as the user scrolls back and forth.

_Anyone tuning scroll animation behavior can track these CSS techniques on daily.dev._

### How do I add a staggered delay to CSS grid items animating on scroll in an auto-fit grid?

Use container queries based on inline-size with the grid's known minimum column size and gap to detect how many columns are currently rendered, then set a custom property like --stagger on items in each column position. Multiply --stagger by a base duration in the animation-delay property so later columns animate in slightly after earlier ones.

_Developers refining staggered grid animations can keep up with CSS layout techniques on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@matchpoint** · 0 upvotes

> ![GIF](https://static.klipy.com/ii/925f17378dd1893b674a723c07535afe/45/22/8BlBsYdi.gif)

**@cale** · 0 upvotes

> ![GIF](https://static.klipy.com/ii/935d7ab9d8c6202580a668421940ec81/22/fc/pcyHZjqE.gif)

**@paoloap** · 0 upvotes

> what does the dashboard tell you that you act on? most editorial trackers end up recording decisions rather than changing them.

## Similar posts on daily.dev

- [Scroll-driven CSS animations](https://daily.dev/posts/scroll-driven-css-animations-uw6plcluy) · Flavio Copes · 142 upvotes · 6 comments
- [A First Look at Scroll-Triggered Animations](https://daily.dev/posts/a-first-look-at-scroll-triggered-animations-evfbfrvso) · CSS-Tricks · 26 upvotes · 1 comments
- [Scroll-Driven Animations • Josh W. Comeau](https://daily.dev/posts/scroll-driven-animations-josh-w-comeau-e7cur5pha) · Josh W Comeau · 432 upvotes · 36 comments
- [How to create awesome staggered animations in CSS](https://daily.dev/posts/how-to-create-awesome-staggered-animations-in-css-k09m57ftt) · LogRocket · 52 upvotes · 1 comments

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Nobody told me CSS could do this","url":"https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz"},"datePublished":"2026-08-26T13:16:23.121Z","dateModified":"2026-09-14T08:22:08.443Z","description":"A hands-on walkthrough of building scroll-triggered, one-time-fire animations using only CSS, no JavaScript. Covers custom properties toggled via container...","image":"https://i.ytimg.com/vi/onraoQExbHw/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/onraoQExbHw/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Kevin Powell","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kevin Powell","logo":"https://media.daily.dev/image/upload/s--XK5Rf0kM--/f_auto/v1717745137/logos/kevinpowell","url":"https://daily.dev/sources/kevinpowell"},"commentCount":5,"discussionUrl":"https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":52},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":5}],"keywords":"css","timeRequired":"PT9M","video":{"@type":"VideoObject","name":"Nobody told me CSS could do this","description":"A hands-on walkthrough of building scroll-triggered, one-time-fire animations using only CSS, no JavaScript. Covers custom properties toggled via container...","thumbnailUrl":"https://i.ytimg.com/vi/onraoQExbHw/sddefault.jpg","uploadDate":"2026-08-26T13:16:23.121Z","duration":"PT9M","url":"https://api.daily.dev/r/rWPB9fZwZ","embedUrl":"https://www.youtube.com/embed/onraoQExbHw"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kevin Powell","item":"https://daily.dev/sources/kevinpowell"},{"@type":"ListItem","position":3,"name":"Nobody told me CSS could do this"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz","comment":[{"@type":"Comment","text":"","datePublished":"2026-08-28T10:44:27.942Z","url":"https://daily.dev/posts/rWPB9fZwZ#c-ZlqV83435","author":{"@type":"Person","name":"Numb Code","url":"https://daily.dev/matchpoint","image":"https://lh3.googleusercontent.com/a/ACg8ocJ86YIewk804FajHaEbzIBiQa9RFZVR0fs-vBpSZ3ObyDY6Qz8=s96-c"}},{"@type":"Comment","text":"","datePublished":"2026-08-29T10:07:50.046Z","url":"https://daily.dev/posts/rWPB9fZwZ#c-1qxDqYBam","author":{"@type":"Person","name":"Cale","url":"https://daily.dev/cale","image":"https://avatars.githubusercontent.com/u/211212128?v=4"}},{"@type":"Comment","text":"what does the dashboard tell you that you act on? most editorial trackers end up recording decisions rather than changing them.","datePublished":"2026-08-31T20:28:21.162Z","url":"https://daily.dev/posts/rWPB9fZwZ#c-XNBzz0fGt","author":{"@type":"Person","name":"Paolo Perrone","url":"https://daily.dev/paoloap","image":"https://lh3.googleusercontent.com/a/AGNmyxaOowFqs19Msmo4AtbOanvSwkOb705dhJ-u3fFQ0Nw=s96-c"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/nobody-told-me-css-could-do-this-rwpb9fzwz#faq","mainEntity":[{"@type":"Question","name":"How do I create scroll-triggered animations in CSS without JavaScript?","acceptedAnswer":{"@type":"Answer","text":"Use a two-layer element structure where the outer element has a custom property like --in-view set to false, and a keyframes animation that switches it to true using animation-timeline: view. Then use a container style query on the inner card to detect when --in-view is true and apply the desired visual change, such as opacity, scale, or an outline. Developers exploring pure CSS scroll animations can find implementation walkthroughs like this on daily.dev."}},{"@type":"Question","name":"How do I stop a CSS scroll-driven animation from re-triggering every time I scroll up and down?","acceptedAnswer":{"@type":"Answer","text":"Move the animation off the container style query and instead control it with animation-play-state set to paused or running based on visibility. This runs the animation once toward its end state and pauses it there when the element leaves the viewport, preventing it from resetting or replaying repeatedly as the user scrolls back and forth. Anyone tuning scroll animation behavior can track these CSS techniques on daily.dev."}},{"@type":"Question","name":"How do I add a staggered delay to CSS grid items animating on scroll in an auto-fit grid?","acceptedAnswer":{"@type":"Answer","text":"Use container queries based on inline-size with the grid's known minimum column size and gap to detect how many columns are currently rendered, then set a custom property like --stagger on items in each column position. Multiply --stagger by a base duration in the animation-delay property so later columns animate in slightly after earlier ones. Developers refining staggered grid animations can keep up with CSS layout techniques on daily.dev."}}]}
```

