Email or username:

Password:

Forgot your password?
Top-level
Adam Argyle

@fcalderan gets even easier with scroll-state(sticky) queries!

```css
.stuck-top {
container-type: scroll-state;
position: sticky;
top: 20px;

> nav {
transition:
box-shadow .3s var(--ease-3),
margin .3s var(--ease-3),
border-radius .3s var(--ease-3);

@container scroll-state(stuck: top) {
box-shadow: var(--shadow-5);
border-radius: 10px;
margin: 20px;
}
}
}
```
try them in Canary: codepen.io/argyleink/pen/vYPzd

article out soon!

2 comments
lbineau

@argyleink @fcalderan finally! Is it a chrome only feature or other browsers plan to implement it too?

Go Up