r/tailwindcss • u/sebbetrygg • May 15 '24
Don't be afraid to use regular CSS when Tailwind is acting up. Huge time saver...
0
Upvotes
1
May 15 '24
I CANNOT STRESS THIS ENOUGH!
Recently I made a div that follows my cursor while also spinning as an animation. It was position absolute and top n left values were dynamically updated using css variables. Now here comes the trouble part: I needed the div's center to be aligned with cursor. Easy, -translate-x-1/2 n -translate-y-1/2. BUT! Doing so made the div rotate rather than spin because tailwind uses css variables in transform property to apply these rather than directly using translate: -50%;
1
u/facefart May 19 '24
Tailwind also supports arbitrary properties too, so it, technically, has 100% CSS spec coverage.
18
u/Severe-Interest May 15 '24
Don't be afraid to give advice without explaining / justifying. Huge time saver...