Skip to content

Commit

Permalink
Add touch-action utilities (#5603)
Browse files Browse the repository at this point in the history
Co-Authored-By: Mattèo Gauthier <[email protected]>

Co-authored-by: Mattèo Gauthier <[email protected]>
  • Loading branch information
adamwathan and MatteoGauthier authored Sep 26, 2021
1 parent 2959b83 commit e602a3d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,21 @@ export default {

cursor: createUtilityPlugin('cursor'),

touchAction: ({ addUtilities }) => {
addUtilities({
'.touch-auto': { 'touch-action': 'auto' },
'.touch-none': { 'touch-action': 'none' },
'.touch-pan-x': { 'touch-action': 'pan-x' },
'.touch-pan-left': { 'touch-action': 'pan-left' },
'.touch-pan-right': { 'touch-action': 'pan-right' },
'.touch-pan-y': { 'touch-action': 'pan-y' },
'.touch-pan-up': { 'touch-action': 'pan-up' },
'.touch-pan-down': { 'touch-action': 'pan-down' },
'.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
'.touch-manipulation': { 'touch-action': 'manipulation' },
})
},

userSelect: ({ addUtilities }) => {
addUtilities({
'.select-none': { 'user-select': 'none' },
Expand Down
6 changes: 6 additions & 0 deletions tests/basic-usage.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@
.cursor-pointer {
cursor: pointer;
}
.touch-pan-y {
touch-action: pan-y;
}
.touch-manipulation {
touch-action: manipulation;
}
.select-none {
user-select: none;
}
Expand Down
1 change: 1 addition & 0 deletions tests/basic-usage.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<div class="clear-left"></div>
<div class="container"></div>
<div class="cursor-pointer"></div>
<div class="touch-pan-y touch-manipulation"></div>
<div class="hidden inline-grid"></div>
<div class="divide-gray-200"></div>
<div class="divide-opacity-50"></div>
Expand Down

0 comments on commit e602a3d

Please sign in to comment.