File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 22
33Interact with [ CSS scroll-snap] ( https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scroll_Snap ) .
44
5+ Zero dependencies.
6+
7+ Automatically accounts for ` scroll-padding ` .
8+
59## Install
610
711``` shell
@@ -10,7 +14,7 @@ yarn add scroll-snap-api
1014npm install --save scroll-snap-api
1115```
1216
13- Or import directly
17+ Or use directly
1418
1519``` js
1620import * as scrollSnapApi from ' https://cdn.pika.dev/scroll-snap-api' ;
Original file line number Diff line number Diff line change 11export declare type Axis = 'x' | 'y' ;
22export declare type ScrollDirection = 'left' | 'right' | 'up' | 'down' ;
3- export declare type ScrollSnapAlignment = 'start' | 'end' | 'center' ;
4- export declare type ScrollSnapAlignValue = 'none' | ScrollSnapAlignment ;
5- export declare type SnapPositionList = Record < ScrollSnapAlignment , number [ ] > ;
3+ export declare type ScrollSnapAlignment = 'start' | 'end' | 'center' | 'none' ;
4+ export declare type SnapPositionList = Record < Exclude < ScrollSnapAlignment , 'none' > , number [ ] > ;
65export declare function scrollSnapToNext ( element : HTMLElement , direction : ScrollDirection , scrollToOptions ?: ScrollToOptions ) : void ;
76export declare function getScrollPadding ( element : HTMLElement ) : Record < Axis , {
87 before : number ;
You can’t perform that action at this time.
0 commit comments