Skip to content

Commit 3b81c53

Browse files
authored
Add scroll-behavior utilities (#5388)
1 parent f332bee commit 3b81c53

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/corePlugins.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,13 @@ export let overscrollBehavior = ({ addUtilities }) => {
11101110
})
11111111
}
11121112

1113+
export let scrollBehavior = ({ addUtilities }) => {
1114+
addUtilities({
1115+
'.scroll-auto': { 'scroll-behavior': 'auto' },
1116+
'.scroll-smooth': { 'scroll-behavior': 'smooth' },
1117+
})
1118+
}
1119+
11131120
export let textOverflow = ({ addUtilities }) => {
11141121
addUtilities({
11151122
'.truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' },

tests/raw-content.test.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@
364364
.overscroll-contain {
365365
overscroll-behavior: contain;
366366
}
367+
.scroll-smooth {
368+
scroll-behavior: smooth;
369+
}
367370
.truncate {
368371
overflow: hidden;
369372
text-overflow: ellipsis;

tests/raw-content.test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
<div class="outline-none outline-black"></div>
9797
<div class="overflow-hidden"></div>
9898
<div class="overscroll-contain"></div>
99+
<div class="scroll-smooth"></div>
99100
<div class="p-4 py-2 px-3 pt-1 pr-2 pb-3 pl-4"></div>
100101
<div class="place-content-start"></div>
101102
<div class="placeholder-green-300"></div>

0 commit comments

Comments
 (0)