Skip to content

Commit

Permalink
Add scroll-behavior utilities (#5388)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Sep 11, 2021
1 parent f332bee commit 3b81c53
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,13 @@ export let overscrollBehavior = ({ addUtilities }) => {
})
}

export let scrollBehavior = ({ addUtilities }) => {
addUtilities({
'.scroll-auto': { 'scroll-behavior': 'auto' },
'.scroll-smooth': { 'scroll-behavior': 'smooth' },
})
}

export let textOverflow = ({ addUtilities }) => {
addUtilities({
'.truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' },
Expand Down
3 changes: 3 additions & 0 deletions tests/raw-content.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@
.overscroll-contain {
overscroll-behavior: contain;
}
.scroll-smooth {
scroll-behavior: smooth;
}
.truncate {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
1 change: 1 addition & 0 deletions tests/raw-content.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<div class="outline-none outline-black"></div>
<div class="overflow-hidden"></div>
<div class="overscroll-contain"></div>
<div class="scroll-smooth"></div>
<div class="p-4 py-2 px-3 pt-1 pr-2 pb-3 pl-4"></div>
<div class="place-content-start"></div>
<div class="placeholder-green-300"></div>
Expand Down

0 comments on commit 3b81c53

Please sign in to comment.