From 3b81c5329baf02ae3f23c891be99cc026a993692 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Sat, 11 Sep 2021 14:13:28 +0100 Subject: [PATCH] Add scroll-behavior utilities (#5388) --- src/corePlugins.js | 7 +++++++ tests/raw-content.test.css | 3 +++ tests/raw-content.test.html | 1 + 3 files changed, 11 insertions(+) diff --git a/src/corePlugins.js b/src/corePlugins.js index 1113d0d5ff2f..fab1b56c7830 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -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' }, diff --git a/tests/raw-content.test.css b/tests/raw-content.test.css index 0c466140dbbd..75ea33b87906 100644 --- a/tests/raw-content.test.css +++ b/tests/raw-content.test.css @@ -364,6 +364,9 @@ .overscroll-contain { overscroll-behavior: contain; } +.scroll-smooth { + scroll-behavior: smooth; +} .truncate { overflow: hidden; text-overflow: ellipsis; diff --git a/tests/raw-content.test.html b/tests/raw-content.test.html index 1e97f5fdf4ce..2cb65ed46810 100644 --- a/tests/raw-content.test.html +++ b/tests/raw-content.test.html @@ -96,6 +96,7 @@
+