Hacker News new | ask | show | jobs
by lawn 702 days ago
> FWIW for a Button, your engineer should just encapsulate all the “ridiculous” styling into a <Button /> element.

And pray you never have to tweak or debug that element.

Hiding away bad code where you don't have to look at it doesn't stop it from being bad.

2 comments

Open the browser tools, select the element, view the styles and look what class cause the problem. Nothing else would you do, if you had a problem in styles css file.
If you can’t follow a DOM tree through some custom components to debug uhhhh… maybe practice more.
The point was, obviously, that the styling string doesn't go away if you hide it inside an element.
Then I’m failing to see why it’s “bad” other than the verbosity/visual noise, which does in fact go away if you hide it (this is the point of abstraction in general, of course)