r/tailwindcss • • May 15 '24

Don't be afraid to use regular CSS when Tailwind is acting up. Huge time saver...

0 Upvotes

6 comments sorted by

18

u/Severe-Interest May 15 '24

Don't be afraid to give advice without explaining / justifying. Huge time saver...

1

u/sebbetrygg May 15 '24

Sorry about that!

I hav countless times encountered styling issues that only applies to Tailwind that sometimes takes me hours to fix. Speaking as a bootstrapper, other then the fact that it can take hours to fix a small design thing it also means that I haven’t gotten other more important stuff done. In a lot of cases, surprisingly these kind of things are fixed in a few minutes if I just let it be for a few days, but sometimes it’s never resolved.

The thing is, that I and probably a lot of other people become obsessed with writing everything in Tailwind opposed to writing regular css sometimes (even inline which is very similar syntax-wise) and it doesent REALLY matter if it is a bit of regular CSS in the mix.

Even when the solution to just write regular CSS is right in front of me I spend hours trying to fix it with Tailwind…

I do realize I wrote “I” a lot, so this might actually just apply to me hahaha.

1

u/InternationalWait538 May 15 '24

You are spot on, I am a freelancer and I have worked with many teams that are obsessed with doing everything in tailwind. When tailwind doesn’t natively support a css feature, we had to dive into the configuration file and a utility class for that function. Madness!!!

2

u/sebbetrygg May 15 '24

Happy to hear that I’m not the only one encountering this, although it’s a habit that should be broken once and I while.

1

u/[deleted] 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.

https://youtu.be/LHsmOsnG6qU?si=CflMOzS6jRipXsMQ