Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

When dev and prod disagree about your CSS

DEV Community·Dipta·17 days ago
#3jf00QfH
#css#frontend#nextjs#rule#fullscreen#order
Reading 0:00
15s threshold

This started right after we shipped a production release of our feature. One of our engineers was running through the change to confirm everything looked right, and the issue caught his eye — since it's a UI thing, it was easy to spot. The CSS width of some components was broken. In the development environment everything had been fine, working perfectly. But in production it wasn't. He reported it. So I started digging. The first instinct was the wrong one. I dropped an !important on the rule, the width snapped back to what it should be, and I almost called it a day. Then I realized I'd just patched a symptom without understanding the cause — and a bug that behaves differently between dev and prod is exactly the kind of bug that comes back six months later in a different file. So I rolled the !important back out and tried to actually figure out what was happening. What was colliding The element in question was a form label.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More