Article Forum: Article preview image is loaded via background-image

Kirby

Well-known member
If an article forum ist set to show a preview of the articles, the preview image is being referenced via inline CSS background-image.

This seems bad for various reasons:
  • Lazy loading via loading="lazy" cannot be used, insteand browsers seem to load all images immediately
    Especially if there are many articles on one page that do contain large images, this can sigificantly affect page loading time
  • Google doesn't seem to treat images used for styling as "first class" content
  • Inline CSS does make it hard to use restrictive CSP

As this image clearly isn't used as a design/GUI element but content, it should be an <img>
 
Last edited:
Upvote 4

Chris D

XenForo developer
Staff member
Being a fairly new system this was clearly a conscious design decision. I don't think it's a reasonable definition of a bug at the moment but we will consider it as a suggestion for the future.
 

Kirby

Well-known member
I don't think it's a reasonable definition of a bug at the moment but we will consider it as a suggestion for the future.
With all due respect, I fail to see how this is not a bug given the impact this design decision has on performance, SEO, security and accessibility.

But so be it, another "not-bug" bug I have to fix for our sites ;)
(Though luckily we only use articles on one installation so far).
 

briansol

Well-known member
double sad face.

Article images are content.
Image Content, per the W3c, shall be expressed in img tags,not as background/style/design/layout types.
 

Chris D

XenForo developer
Staff member
It's something on our radar for the near future but I am setting the expectation that it is not something that is going to change in a third point release.

We have a lengthy public beta period which is the optimal time to cast judgement on the approaches and design decisions we have taken and certain things become difficult or undesirable to change beyond that until the next major release. With all due respect.
 
Top