<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u" -->

---
title: Is the sticky thing stuck? Is the snappy item snapped? A...
description: An exploration of experimental CSS state queries (scroll-state container queries) and new JavaScript scroll-snap events, both available in Chrome...
canonical: https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Is the sticky thing stuck? Is the snappy item snapped? A look at state queries in CSS | daily.dev
og:description: An exploration of experimental CSS state queries (scroll-state container queries) and new JavaScript scroll-snap events, both available in Chrome...
og:url: https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u
og:image: https://api.daily.dev/og/posts/Y0Za55S4U.png
og:image:alt: Is the sticky thing stuck? Is the snappy item snapped? A look at state queries in CSS
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.

# Is the sticky thing stuck? Is the snappy item snapped? A look at state queries in CSS

**[utilitybend](https://daily.dev/sources/utilitybend)** · 10 min read · 0 upvotes · 0 comments

## Summary

An exploration of experimental CSS state queries (scroll-state container queries) and new JavaScript scroll-snap events, both available in Chrome Canary/upcoming Chrome releases. Demonstrates using state queries to detect when a sticky header becomes 'stuck' and add a shadow, and when a scroll-snap item becomes 'snapped' to trigger style changes, including a combo with CSS anchor positioning for a moving frame effect. Also covers the scrollsnapchanging and scrollsnapchange JavaScript events expected in Chrome 129, with code demos and closing thoughts on why a pseudo-class approach was not chosen instead.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://utilitybend.com/blog/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css>

## Questions this post answers

### How do I detect if a sticky element is currently stuck using CSS state queries?

Set container-type: scroll-state on the sticky element's container, then use a container query like @container scroll-state(stuck: top) inside a descendant to apply styles, such as a box-shadow, when the container is stuck to the top. Other stuck values include none, left, right, bottom, and their logical property equivalents (inset-block-start, inset-inline-end, etc.). This is an experimental feature available in Chrome Canary behind the Experimental web platform features flag.

_daily.dev surfaces experimental CSS features like this so you can try them before they ship broadly._

### How can I tell when a scroll-snap item has been snapped using CSS?

Set container-type: scroll-state on the list item, then use @container scroll-state(snapped: inline) or snapped: block on a child element to apply styles once that item snaps, such as changing its background color. This state query approach can also pair with CSS anchor positioning by assigning an anchor-name inside the snapped state to move an overlay frame to match the snapped item's position.

_developers experimenting with scroll-snap effects can track proposals like this via daily.dev._

### What new JavaScript events does Chrome 129 add for scroll snapping?

Chrome 129 introduces scrollsnapchanging and scrollsnapchange events for scroll-snap containers. The scrollsnapchanging event fires multiple times during scrolling as new snap points are selected but before the snap completes, while scrollsnapchange fires once after a scroll completes and indicates the newly snapped element via event.snapTargetBlock.

_track browser API rollouts like these on daily.dev before they hit your production scroll interactions._

## Similar posts on daily.dev

- [Lessons Learned Rewriting a Sticky Detector – Master.dev Blog](https://daily.dev/posts/lessons-learned-rewriting-a-sticky-detector-master-dev-blog-obcjiecys) · Frontend Masters · 6 upvotes · 0 comments
- [Scrollytelling on Steroids With Scroll-State Queries](https://daily.dev/posts/scrollytelling-on-steroids-with-scroll-state-queries-sbctcignf) · CSS-Tricks · 4 upvotes · 0 comments
- [Directional CSS with scroll-state\(scrolled\)](https://daily.dev/posts/directional-css-with-scroll-state-scrolled--okqxocp8h) · Una Kravets · 29 upvotes · 2 comments

---

Tags: [#css](https://daily.dev/tags/css), [#google-chrome](https://daily.dev/tags/google-chrome)

[View this post on daily.dev](https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u)

```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":"Is the sticky thing stuck? Is the snappy item snapped? A look at state queries in CSS","url":"https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u"},"datePublished":"2026-09-20T07:43:19.794Z","dateModified":"2026-09-20T07:43:43.149Z","description":"An exploration of experimental CSS state queries (scroll-state container queries) and new JavaScript scroll-snap events, both available in Chrome...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/21c3f70f20a0f4245eeec92ec9150fb1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/21c3f70f20a0f4245eeec92ec9150fb1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"utilitybend","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":"utilitybend","logo":"https://media.daily.dev/image/upload/s--hONVFSz4--/f_auto,q_auto/v1789890196/logos/utilitybend?_a=BAMAMicg0","url":"https://daily.dev/sources/utilitybend"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,google-chrome","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"utilitybend","item":"https://daily.dev/sources/utilitybend"},{"@type":"ListItem","position":3,"name":"Is the sticky thing stuck? Is the snappy item snapped? A look at state queries in CSS"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/is-the-sticky-thing-stuck-is-the-snappy-item-snapped-a-look-at-state-queries-in-css-y0za55s4u#faq","mainEntity":[{"@type":"Question","name":"How do I detect if a sticky element is currently stuck using CSS state queries?","acceptedAnswer":{"@type":"Answer","text":"Set container-type: scroll-state on the sticky element's container, then use a container query like @container scroll-state(stuck: top) inside a descendant to apply styles, such as a box-shadow, when the container is stuck to the top. Other stuck values include none, left, right, bottom, and their logical property equivalents (inset-block-start, inset-inline-end, etc.). This is an experimental feature available in Chrome Canary behind the Experimental web platform features flag. daily.dev surfaces experimental CSS features like this so you can try them before they ship broadly."}},{"@type":"Question","name":"How can I tell when a scroll-snap item has been snapped using CSS?","acceptedAnswer":{"@type":"Answer","text":"Set container-type: scroll-state on the list item, then use @container scroll-state(snapped: inline) or snapped: block on a child element to apply styles once that item snaps, such as changing its background color. This state query approach can also pair with CSS anchor positioning by assigning an anchor-name inside the snapped state to move an overlay frame to match the snapped item's position. developers experimenting with scroll-snap effects can track proposals like this via daily.dev."}},{"@type":"Question","name":"What new JavaScript events does Chrome 129 add for scroll snapping?","acceptedAnswer":{"@type":"Answer","text":"Chrome 129 introduces scrollsnapchanging and scrollsnapchange events for scroll-snap containers. The scrollsnapchanging event fires multiple times during scrolling as new snap points are selected but before the snap completes, while scrollsnapchange fires once after a scroll completes and indicates the newly snapped element via event.snapTargetBlock. track browser API rollouts like these on daily.dev before they hit your production scroll interactions."}}]}
```

