22
Hit 100 lines of CSS for the first time and it humbled me fast
I was building a simple landing page for a friend's dog walking service, nothing crazy, just a hero image and some text. By the time I got the nav bar, the mobile menu, and the hover effects done, I checked my stylesheet and it was at 100 lines. I thought I was doing something wrong because every tutorial makes CSS look so clean, but mine was a mess of comments and trial stuff. Has anyone else hit that wall where the code technically works but you know it's ugly? How do you decide when to refactor vs just moving on?
1 comments
Log in to join the discussion
Log In1 Comment
leo_lopez26d ago
Wait, you hit 100 lines and thought that was bad? I hit 50 lines on a button once. Just a button. Had like 14 hover states for no reason.
Here's the thing, every dev I know has a graveyard of trial CSS in their file. Comments that say "fix this later" and later never comes. Ugly code that works is still working code.
My rule is simple. If it works and I can still read it after a coffee break, move on. Refactor only when you add new stuff and the old tricks break something.
Honestly, 100 lines for a whole landing page sounds pretty tight to me. My last dog walking site was 400 lines and the dog was wearing a hat in the hero image. That hat cost me like 60 lines alone.
7