You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-conditional-5/scroll_state_explainer.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,13 +152,13 @@ a carousel.
152
152
Query whether a container has [scrollable overflow](https://drafts.csswg.org/css-overflow-3/#scrollable-overflow-region).
153
153
Can be used to indicate there is content to scroll to in a given direction.
154
154
155
-
### Direction
155
+
### Scrolled
156
156
157
-
Query the most recent direction of [scrolling](https://drafts.csswg.org/cssom-view/#scrolling).
157
+
Query the direction of [the most recent relative scroll](https://drafts.csswg.org/css-scroll-snap-1/#scroll-types).
158
158
For instance:
159
159
160
160
```css
161
-
@container scroll-state(direction: top) {
161
+
@container scroll-state(scrolled: top) {
162
162
.scrolling-up {
163
163
translate: 00;
164
164
}
@@ -167,8 +167,8 @@ For instance:
167
167
168
168
#### Workaround
169
169
170
-
A workaround solution to create queries based on scrolling direction is
171
-
described in [Solved by CSS Scroll-Driven Animations: hide a header when
170
+
A workaround solution to create queries based on scrolling direction
171
+
is described in [Solved by CSS Scroll-Driven Animations: hide a header when
172
172
scrolling down, show it again when scrolling up](https://www.bram.us/2024/09/29/solved-by-css-scroll-driven-animations-hide-a-header-when-scrolling-up-show-it-again-when-scrolling-down/),
173
173
uses a `transition-delay` trick to get the active scroll direction.
174
174
@@ -181,10 +181,11 @@ scrolling.
181
181
182
182
#### Active scroll direction
183
183
184
-
The proposed `direction` feature matches the state of the most recent
185
-
scroll direction. Web authors might also want to create queries based on the
186
-
current scroll direction, not only the most recent one, similar to [scrollend
0 commit comments