FKB Pro - נושא חברתי

Hi @Don,

Thanks as always for your great work on the FKB Pro theme!

I came across a minor CSS bug on mobile viewports (width < 40rem / < 640px) where Markdown percentage-scaled images (e.g., ![image|420x420, 40%](upload://...)) fail to scale down and instead stretch to 100% width. I have tested this with all theme components and custom CSS disabled (running only pure FKB Pro), and confirmed the issue persists.

The Cause

When Discourse parses a scaled image that triggers a lightbox wrapper, it outputs the scaled dimensions as HTML attributes (Presentational Hints with 0 specificity):

<a class="lightbox" ...>
  <img src="..." width="168" height="168" style="aspect-ratio: 168 / 168;">
</a>

However, on viewports under 40rem, FKB Pro applies the following rule:

@media (width < 40rem) {
  .post-stream .topic-post article .cooked .lightbox img {
    width: 100%;
  }
}

Because width: 100% overrides the HTML width="168" attribute, any smaller portrait or avatar images wrapped in .lightbox are forced to stretch to the full width of the post/blockquote container on mobile. (Images that don’t trigger the .lightbox wrapper scale down normally.)

Furthermore, because HTML width attributes have 0 specificity, users cannot easily override this in custom CSS using width: auto or width: revert, as the browser will discard the HTML width="168" attribute and fall back to the image’s intrinsic size (420px).

Suggested Fix

Could you consider removing width: 100% from .cooked .lightbox img under 40rem (since Discourse core already handles responsive bounding via max-width: 100%; height: auto;), or scoping it so it doesn’t override images that have explicit width attributes set via Markdown scaling?

Thanks for looking into this!