7
Am I the only one who hates CSS custom properties for everything?
Been seeing everyone use CSS variables for literally every color and spacing value. I get it for big design systems. But for a simple landing page or a one-off component? Stop. I had to debug a client project last Wednesday where they nested custom properties 5 layers deep just to change a button color. Took me an hour to trace back one hex value. Sometimes plain old hex codes work fine. Why make it complicated when it doesn't need to be? Anyone else find over-engineering with variables more trouble than it's worth?
2 comments
Log in to join the discussion
Log In2 Comments
miller.susan7d agoTop Commenter
Oh man, five layers deep for a button color? That's insane... I literally gasped when I read that part. Some people get so carried away with "future-proofing" they forget we have to actually maintain this stuff. I spent three hours last month untangling a mess where someone used custom properties inside calc() inside var() references just to set a basic margin. It's like they're trying to show off how clever they are but really they're just making a nightmare for whoever comes after them. Plain hex codes and hardcoded values aren't the enemy, they're your friend when you just need something to work and be easy to find.
9
grant5697d ago
Three hours? Man, @miller.susan you got off light. I saw a stylesheet once where someone wrapped a font-size in three transform functions just to adjust it by 2 pixels. It was like they were trying to invent a new kind of math instead of just typing "14px". People treat CSS like it's a puzzle game instead of something you gotta ship and walk away from. Hardcoding a color or margin isn't lazy, it's considerate for the next person who has to touch it.
3