In my Next.js project with Tailwind styling, I encountered an issue when using the globals.css
file for more complex non-Tailwind CSS styling on a component.
To better understand the problem, you can view the Code Sandbox here: https://codesandbox.io/p/sandbox/muddy-pine-hx86sf. Essentially, I am trying to achieve this transition when clicking on a list item.
However, in both the Sandbox and my local Next.js development environment, the transition is being skipped and the new background color is applied immediately without playing out the transition.
I'm uncertain if I'm misunderstanding how CSS transitions work or if this issue is related to Next.js or my lack of understanding in dynamically applying CSS to elements.
- I attempted manually applying the class that changes the background position
active-location-item
using Firefox DevTools, which made the transition work. - I tried different CSS selectors but still faced the same issue of no transition occurring.
- I confirmed in DevTools that the class is indeed applied when the item is clicked.
Any assistance on this matter would be greatly appreciated!