News for hackers. Stuff that matters.
Re:Learn CSS by nailer on Friday May 21, 2021 @05:12PM (#27240033)
You’re misunderstanding the relationship between components and styles.

Login box and messages are separate components, but they share padding metrics, border styles, a palette, etc.

Have you used tailwind before?

Re:Learn CSS by deergomoo on Saturday May 22, 2021 @09:00AM (#27246078)
I use Tailwind almost exclusively these days.

My argument is that using the “mr-1 pl-2” utilities on both a login box and a message would be no more copy pasting than creating a stylesheet with “.login-box { margin-right: 0.25rem; padding-left: 0.5rem; }” and “.message { margin-right: 0.25rem; padding-left: 0.5rem; }”.

And if you’re suggesting that you would create a single CSS class with those properties to apply to both the login box and the message, then it’s my opinion that that is a broken abstraction that falls apart as soon as your designer asks if you can make the spacing in the login box a little looser.