Image displayed incorrectly on Mobile due to theme settings

AI-generated summary

A user reported that images were displayed incorrectly on mobile due to theme settings, specifically with the Material theme. Vaping_Community identified the issue was caused by custom CSS in the theme affecting image display. After testing in safe mode, they discovered the problem stemmed from a theme modification. By removing specific CSS properties like padding-left, border-radius, and padding-right, the issue was resolved. awesomerobot and codinghorror assisted in diagnosing the problem, and sam suggested using safe mode to isolate theme-related issues. The user acknowledged the helpful feedback and confirmed the fix.

Discourse Version: discourse (19b4116)

Seems to be a problem with only some image uploads.

The following CSS added to the mobile css sheet fixes it for me:

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: 100%;
}

I’m not sure what exactly is being reported here, can you verify @awesomerobot?

2 Likes

Hmm I’m not able to reproduce this (if I’m understanding correctly, the lightboxed image was wider than your screen?)… is it possibly related to customizations? Can you post an image you were having issues with here?

4 Likes

Is this theme related? Does this happen in safe mode? Using Safe Mode to troubleshoot issues with themes and plugins

3 Likes

Ok, so something is modifying the default theme..

The safe mode worked, i’ll try disabling all themes and see what happens, thanks for your help.

So the theme I installed and modified was called Material, it has somehow changed the default theme

Edit: Found it! If it wasn’t for the safe mode I would have been stumped for ages, thanks for your help, much appreciated.

.topic-body {
  -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  background-color: lighten($secondary, 10%);
  margin-top: 10px;
  padding-left: 20px;
  border-radius: 2px;
  padding-right: 20px;
  padding-top: 5px;
}

I removed:

  padding-left: 20px;
  border-radius: 2px;
  padding-right: 20px;
  padding-top: 5px;

I’m still unsure how this was affecting the default theme when all other themes were disabled.

1 Like