Add scroll-behavior utilities (#5388)

This commit is contained in:
Luke Warlow 2021-09-11 14:13:28 +01:00 committed by GitHub
parent f332bee41b
commit 3b81c5329b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -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' },

View File

@ -364,6 +364,9 @@
.overscroll-contain {
overscroll-behavior: contain;
}
.scroll-smooth {
scroll-behavior: smooth;
}
.truncate {
overflow: hidden;
text-overflow: ellipsis;

View File

@ -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>