Skip to content

Commit 9b21133

Browse files
authored
Merge pull request #2075 from wadefletch/master
Add overscroll features (Resolves #1957)
2 parents e29e960 + 55134d4 commit 9b21133

File tree

6 files changed

+164
-0
lines changed

6 files changed

+164
-0
lines changed

__tests__/fixtures/tailwind-output-ie11.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6133,6 +6133,42 @@ video {
61336133
-webkit-overflow-scrolling: auto;
61346134
}
61356135

6136+
.overscroll-auto {
6137+
overscroll-behavior: auto;
6138+
}
6139+
6140+
.overscroll-contain {
6141+
overscroll-behavior: contain;
6142+
}
6143+
6144+
.overscroll-none {
6145+
overscroll-behavior: none;
6146+
}
6147+
6148+
.overscroll-y-auto {
6149+
overscroll-behavior-y: auto;
6150+
}
6151+
6152+
.overscroll-y-contain {
6153+
overscroll-behavior-y: contain;
6154+
}
6155+
6156+
.overscroll-y-none {
6157+
overscroll-behavior-y: none;
6158+
}
6159+
6160+
.overscroll-x-auto {
6161+
overscroll-behavior-x: auto;
6162+
}
6163+
6164+
.overscroll-x-contain {
6165+
overscroll-behavior-x: contain;
6166+
}
6167+
6168+
.overscroll-x-none {
6169+
overscroll-behavior-x: none;
6170+
}
6171+
61366172
.p-0 {
61376173
padding: 0;
61386174
}

__tests__/fixtures/tailwind-output-important.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7813,6 +7813,42 @@ video {
78137813
-webkit-overflow-scrolling: auto !important;
78147814
}
78157815

7816+
.overscroll-auto {
7817+
overscroll-behavior: auto !important;
7818+
}
7819+
7820+
.overscroll-contain {
7821+
overscroll-behavior: contain !important;
7822+
}
7823+
7824+
.overscroll-none {
7825+
overscroll-behavior: none !important;
7826+
}
7827+
7828+
.overscroll-y-auto {
7829+
overscroll-behavior-y: auto !important;
7830+
}
7831+
7832+
.overscroll-y-contain {
7833+
overscroll-behavior-y: contain !important;
7834+
}
7835+
7836+
.overscroll-y-none {
7837+
overscroll-behavior-y: none !important;
7838+
}
7839+
7840+
.overscroll-x-auto {
7841+
overscroll-behavior-x: auto !important;
7842+
}
7843+
7844+
.overscroll-x-contain {
7845+
overscroll-behavior-x: contain !important;
7846+
}
7847+
7848+
.overscroll-x-none {
7849+
overscroll-behavior-x: none !important;
7850+
}
7851+
78167852
.p-0 {
78177853
padding: 0 !important;
78187854
}

__tests__/fixtures/tailwind-output-no-color-opacity.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6385,6 +6385,42 @@ video {
63856385
-webkit-overflow-scrolling: auto;
63866386
}
63876387

6388+
.overscroll-auto {
6389+
overscroll-behavior: auto;
6390+
}
6391+
6392+
.overscroll-contain {
6393+
overscroll-behavior: contain;
6394+
}
6395+
6396+
.overscroll-none {
6397+
overscroll-behavior: none;
6398+
}
6399+
6400+
.overscroll-y-auto {
6401+
overscroll-behavior-y: auto;
6402+
}
6403+
6404+
.overscroll-y-contain {
6405+
overscroll-behavior-y: contain;
6406+
}
6407+
6408+
.overscroll-y-none {
6409+
overscroll-behavior-y: none;
6410+
}
6411+
6412+
.overscroll-x-auto {
6413+
overscroll-behavior-x: auto;
6414+
}
6415+
6416+
.overscroll-x-contain {
6417+
overscroll-behavior-x: contain;
6418+
}
6419+
6420+
.overscroll-x-none {
6421+
overscroll-behavior-x: none;
6422+
}
6423+
63886424
.p-0 {
63896425
padding: 0;
63906426
}

__tests__/fixtures/tailwind-output.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7813,6 +7813,42 @@ video {
78137813
-webkit-overflow-scrolling: auto;
78147814
}
78157815

7816+
.overscroll-auto {
7817+
overscroll-behavior: auto;
7818+
}
7819+
7820+
.overscroll-contain {
7821+
overscroll-behavior: contain;
7822+
}
7823+
7824+
.overscroll-none {
7825+
overscroll-behavior: none;
7826+
}
7827+
7828+
.overscroll-y-auto {
7829+
overscroll-behavior-y: auto;
7830+
}
7831+
7832+
.overscroll-y-contain {
7833+
overscroll-behavior-y: contain;
7834+
}
7835+
7836+
.overscroll-y-none {
7837+
overscroll-behavior-y: none;
7838+
}
7839+
7840+
.overscroll-x-auto {
7841+
overscroll-behavior-x: auto;
7842+
}
7843+
7844+
.overscroll-x-contain {
7845+
overscroll-behavior-x: contain;
7846+
}
7847+
7848+
.overscroll-x-none {
7849+
overscroll-behavior-x: none;
7850+
}
7851+
78167852
.p-0 {
78177853
padding: 0;
78187854
}

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import objectPosition from './plugins/objectPosition'
4646
import opacity from './plugins/opacity'
4747
import outline from './plugins/outline'
4848
import overflow from './plugins/overflow'
49+
import overscroll from './plugins/overscroll'
4950
import padding from './plugins/padding'
5051
import placeholderColor from './plugins/placeholderColor'
5152
import pointerEvents from './plugins/pointerEvents'
@@ -155,6 +156,7 @@ export default function({ corePlugins: corePluginConfig }) {
155156
opacity,
156157
outline,
157158
overflow,
159+
overscroll,
158160
padding,
159161
placeholderColor,
160162
placeholderOpacity,

src/plugins/overscroll.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default function() {
2+
return function({ addUtilities, variants }) {
3+
addUtilities(
4+
{
5+
'.overscroll-auto': { 'overscroll-behavior': 'auto' },
6+
'.overscroll-contain': { 'overscroll-behavior': 'contain' },
7+
'.overscroll-none': { 'overscroll-behavior': 'none' },
8+
'.overscroll-y-auto': { 'overscroll-behavior-y': 'auto' },
9+
'.overscroll-y-contain': { 'overscroll-behavior-y': 'contain' },
10+
'.overscroll-y-none': { 'overscroll-behavior-y': 'none' },
11+
'.overscroll-x-auto': { 'overscroll-behavior-x': 'auto' },
12+
'.overscroll-x-contain': { 'overscroll-behavior-x': 'contain' },
13+
'.overscroll-x-none': { 'overscroll-behavior-x': 'none' },
14+
},
15+
variants('overscroll')
16+
)
17+
}
18+
}

0 commit comments

Comments
 (0)