Skip to content

Commit

Permalink
content: Use object-fit: scale-down to fit images, vs. contain
Browse files Browse the repository at this point in the history
This matches the behavior of Zulip web.

The meaning of this value is that the image is either scaled
according to `contain`, or not scaled at all, whichever makes it
smaller.

In other words, we still scale down all the images we were scaling
down, but we stop scaling any images up, which tended to look a bit
silly.  If the user wants to see the image scaled up, they can
always tap to see it in the lightbox.

This case is about to become more common with the advent of
thumbnailing: when we get a message where the server hasn't yet
gotten to producing a thumbnail, we'll show a placeholder image.
That placeholder is a 30x30 SVG, which looks rather odder if
scaled up to 160px high.
  • Loading branch information
gnprice committed Jul 17, 2024
1 parent 2ae8d8e commit f6dc144
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webview/static/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ time {
.twitter-image img {
width: 100%;
height: 160px;
object-fit: contain;
object-fit: scale-down;
}

.message_inline_video {
Expand Down

0 comments on commit f6dc144

Please sign in to comment.