Hacker News new | ask | show | jobs
by megous 1175 days ago
The only time I can imagine coupling content and styling together is if you have mostly non-repetitive elements in the content (rare, I think, maybe some very "designed" landing page, or whatnot), or you have other ways to repeat the elements without writing the styles out each time for each element. (And at that point you've just moved the problem of having to invent names for CSS classes to having to invent names for bunch of "components" and their properties)
1 comments

Any UI beyond trivial lists will couple style and content.

You have a card? Boom, you need to couple styles for the title, for the content, for the footer etc.

You have a form? Boom, you need to couple styles with the form.

The idea that styles are somehow decoupled from content is funny idea that very rarely works out in practice.

You missed the point.

Would you copy paste around:

<form class="asd fasdf e4rwe sfdg sdfgbbv cxvbxcs asdf asdf wer wer gfdghdfgh fgh">

20x around your static website and keep it updated manually when someone "from design" wants to change the "form" look?

Or would you just <form class="classic-form"> and describe the style of that class of form in a single place?

I know what I'd do. :)