Image block: a Size (small, medium, large), centered

- image_size (101): blank the column's full width, else up to 20, 32
  or 48rem, centered and never wider than the column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 05:58:49 -06:00
parent c26e662406
commit a0eb9d7e49
7 changed files with 39 additions and 2 deletions

View file

@ -76,6 +76,9 @@ import { usePresenting } from '../lib/presenting.ts'
const BODY = 'var(--color-muted)'
/* An image block's Size (101): its widest, centered. */
const IMAGE_SIZE = { small: 'max-w-[20rem]', medium: 'max-w-[32rem]', large: 'max-w-[48rem]' } as const
export default function ContentBlocks({
blocks,
accent = BRAND,
@ -579,7 +582,7 @@ function Block({
/>
)
return (
<figure>
<figure className={block.image_size ? `mx-auto ${IMAGE_SIZE[block.image_size]}` : undefined}>
{block.href ? <Anchor href={block.href}>{img}</Anchor> : img}
<Caption text={text} />
</figure>