Skip to content

Media

Images, video and illustrations in a fixed aspect ratio, with captions and a labelled placeholder for photos still to come.

Media, caption and placeholder

Illustrations are drawn with noodle tokens, so they re-colour with it.
A placeholder says exactly which photo belongs here.

Installation

Everything ships in one stylesheet. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">

Prefer to own the files? /r/media.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-mediaA frame with an aspect ratio (--ratio, default 16/10) that crops its <img>, <video> or <svg> to fill.
mn-media-square · mn-media-portrait · mn-media-wide · mn-media-auto1/1, 4/5, 21/9 or the content’s own ratio.
mn-media-flatNo radius (for full-bleed images).
mn-media-placeholderA hatched stand-in whose text describes the photo to shoot or choose. Give it role="img" and the same text as aria-label.
mn-captionA caption under the media, inside a <figure>.

Accessibility

  • Every meaningful image needs alt text that says what it shows; decorative images use alt="".
  • Use <figure> and <figcaption class="mn-caption"> when a caption belongs to the image.
  • Replace placeholders before launch: they describe the image you need, which also makes good alt text.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page