-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the issue
It's first time I'm using React Bits. I'm using Next.js, Typescript, and tailwind v4.
I'm using the component like the docs, but the animation is not working. Until i see some commented code on ShinyText.tsx:
tailwind.config.js
module.exports = {
theme: {
extend: {
keyframes: {
shine: {
'0%': { 'background-position': '100%' },
'100%': { 'background-position': '-100%' },
},
},
animation: {
shine: 'shine 5s linear infinite',
},
},
},
plugins: [],
};
A bit confuse because there are no tailwind.config.js or tailwind.config.ts on my directory. I'd try to create it manually and didn't work. I think v4 of tailwind not using tailwind.config.js or tailwind.config.ts anymore.
until I found this: https://tailwindcss.com/docs/theme#defining-animation-keyframes
I change the code and place it on globals.css:
@keyframes shine {
0% {
background-position: 100%;
}
100% {
background-position: -100%;
}
}
:root {
--animate-shine: shine 5s linear infinite;
}
.animate-shine {
animation: var(--animate-shine);
}
after that, the animation is working properly
Reproduction Link
Steps to reproduce
Validations
- I have checked other issues to see if my issue was already reported or addressed
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working