Compare commits

1 Commits

Author SHA1 Message Date
47979718eb Fix responsive message images
All checks were successful
Trigger cinny-mobile / dispatch (push) Successful in 2s
Constrain image attachments to their parent while preserving their aspect ratio.
2026-08-25 00:02:45 +10:00
2 changed files with 3 additions and 3 deletions

View File

@@ -262,7 +262,7 @@ export function MImage({ content, renderImageContent, outlined }: MImageProps) {
<AttachmentBox <AttachmentBox
style={{ style={{
width: toRem(width), width: toRem(width),
height: toRem(height), aspectRatio: `${width} / ${height}`,
['--media-h' as string]: `${height}px`, ['--media-h' as string]: `${height}px`,
}} }}
data-paarrot-media-height={height} data-paarrot-media-height={height}

View File

@@ -8,7 +8,7 @@ export const Attachment = recipe({
color: color.SurfaceVariant.OnContainer, color: color.SurfaceVariant.OnContainer,
borderRadius: config.radii.R400, borderRadius: config.radii.R400,
overflow: 'hidden', overflow: 'hidden',
maxWidth: toRem(400), maxWidth: `min(100%, ${toRem(400)})`,
}, },
variants: { variants: {
outlined: { outlined: {
@@ -33,7 +33,7 @@ export const AttachmentHeader = style({
export const AttachmentBox = style([ export const AttachmentBox = style([
DefaultReset, DefaultReset,
{ {
maxWidth: toRem(400), maxWidth: `min(100%, ${toRem(400)})`,
maxHeight: toRem(400), maxHeight: toRem(400),
overflow: 'hidden', overflow: 'hidden',
}, },