3 ms·
TBH, I hate these kinds of articles. Instead of titling it something like "Things to be aware of with CSS background-image", or even the catchier "Don't use CSS
by hn_throwaway_99 7y ago
TBH, I hate these kinds of articles. Instead of titling it something like "Things to be aware of with CSS background-image", or even the catchier "Don't use CSS background-image for a foreground image", it uses a much broader, click-baity unwarranted title about "anti-pattern".
I'm glad that background-images aren't indexed by search engines, or made available to screen readers, and I obviously know they aren't downloaded before the CSS that references them is. I think all of those as good things, because I use background-image just for that - things that not primary. When I print, if excluding background images makes the page unreadable, I think of it as using background images wrong.
Calling a widely used, useful feature an "anti-pattern" just because some people may use it wrong is ludicrous.
- caiocaiocaio 7y agoIt may be an anti-pattern, but is it considered harmful?
- dymk 7y agoWell, it is a common anti pattern, in the way it’s usually used. A quick search on github for uses corroborates this.
- dang 7y agoOk, but the title isn't the article, and there are other things to discuss here. https://news.ycombinator.com/item?id=20545932 https://news.ycombinator.com/item?id=20545932