Skip to content

Commit

Permalink
feat(tailwind): add hoverOnlyWhenSupported and new animations
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Dec 21, 2024
1 parent 7f9c191 commit 690f3d2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const typography = require('@tailwindcss/typography');

/** @type {import('tailwindcss').Config} */
module.exports = {
future: {
hoverOnlyWhenSupported: true,
},
content: [
"./components/**/*.{jsx,tsx}",
"./contexts/**/*.{jsx,tsx}",
Expand Down Expand Up @@ -103,6 +106,13 @@ module.exports = {
'100%': { opacity: 1 },
},
},
[`.animate-fade-out`]: {
animation: 'fade-out var(--animation-duration, 200ms) var(--animation-delay, 0ms) forwards ease-in-out',
'@keyframes fade-out': {
'0%': { opacity: 1 },
'100%': { opacity: 0 },
},
},
});
addUtilities({
[`.animate-slide-y-in`]: {
Expand All @@ -112,6 +122,13 @@ module.exports = {
'100%': { transform: 'translateY(0)' },
},
},
[`.animate-slide-y-out`]: {
animation: 'slide-y-out var(--animation-duration, 200ms) var(--animation-delay, 0ms) forwards ease-in-out',
'@keyframes slide-y-out': {
'0%': { transform: 'translateY(0)' },
'100%': { transform: 'translateY(var(--animation-distance, 100%))' },
},
},
});
addUtilities({
[`.animate-slide-x-in`]: {
Expand Down

0 comments on commit 690f3d2

Please sign in to comment.