Live data from Hacker News

Defensive CSS

defensivecss.dev

71–73 of 73 posts

Re: Defensive CSS

#71
post #37

Earlier quoted context omitted.

What a odd one to single out and complain about it.

"Not making content inaccessible" is one of most fundamental principles of front-end work. The famous "CSS is awesome" coffee mug shows the correct default when something is not working like expected: the content is still visible. Defensive CSS should be intended to fail gracefully, and clipping it doesn't do that. (i.e. when it breaks it'll look bad but the content should still be available.) I read this bit and I f…

I disagree.

If I'm reading a list of names like in a contacts app (e.g the example), I find it much easier and a better experience to skim entries if they have equal height and spacing. Having the trailing characters of a long last name being replaced with ellipsis is completely worth it to get the speed of skimming the list.

If I actually need to interact with the person that has the long name I'm going to click their entry and get their full details anyway.

Re: Defensive CSS

#72
post #34
post #27

A good offence is the best defence, which is why I prefer offensive CSS.

That's a very !important statement right there.

Paraphrasing Ian Gillian from Deep Purple about stage monitor volume, "Make everything more !important than everything else."

Re: Defensive CSS

#73

I constantly struggle with CSS grids when compared to, say, just using Bootstrap. I know Bootstrap comes with a lot of baggage, but the syntactic sugar is just so useful.

I mentioned this above. But in case you don't see it. https://cssgrid.io/

Thank you, that was really helpful.
Post reply on HN