Hacker News new | past | comments | ask | show | jobs | submit login

But how is class="border-solid border-black" better than style="border:solid black"? It's hard to imagine that you'll change the border-black or border-solid classes to do something else, so some is clearly just a different inline style.



People do that (not me) because you can easily change all elements that have that specific border type. You might change the radius or thickness, could add an outline or at least see what it looks like applied to everything. border-solid wont change but it follows the same approach for consistency.


You can change the class to be white and then say it's for historical reasons later.


Border-solid can indeed be inlined but black is a color i think not all agreed on. I like #252325 but some will go for #030303.

Also, it's like building your new and shiny app with i18n in mind. Do you really need translations when you are the only user? Probably not, but development is also about trying to predict what will happen next. classes helps you to grow.


'black' is a named web colour, no? In 1999. #000000 [1]

Or aside from re-writing standards, I don't get the point about translations. I go for classes on elements, like

    <h1>

    h1: var(--c0-b);
That means colours can be swapped around like an i18n language, by changing the palette that sits in the CSS file. Putting 'black' inline be it in actual inline css. or pseudo inline css that seems to be the case with the library here, is the exact opposite of an analogy to i18n in mind and seems a great step back, back to pre stylesheet days, in the power of abstraction.

[1] https://www.w3.org/TR/REC-html40/types.html#h-6.5




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: