Images & SVG¶
What it is¶
Void provides styled image handling and a flexible way to embed SVG content, all driven by the standard attr_list extension so you can attach component classes directly to Markdown images.
When to use it¶
Standard images need no classes β the glass treatment applies automatically.
Reach for the image classes when you want a circular crop, a ghosted/dimmed
look, a banner, or a thumbnail. Use .void-svg when you want to drop raw
SVG into a bordered glass panel.
In Markdown¶
Images get the glass treatment automatically: rounded corners, subtle border, and maximum width constraint.
{ width="120" }
Attach any class directly to an image with the {.class} suffix β no HTML
needed (see CSS Classes in Markdown):
| Class | Effect |
|---|---|
void-img-round |
Circular crop |
void-img-ghost |
Dimmed/desaturated |
void-image--banner |
Full-width banner (max-height 380px, cover) |
void-image--thumbnail |
Small 220px thumbnail |
{ .void-img-round width="140" }
{ .void-img-ghost }
{ .void-image--banner }
For a caption, use a small HTML <figure>:
<figure class="void-figure">
<img src="img.png" alt="Void logo" width="96">
<figcaption>Figure 1 β The Void logo</figcaption>
</figure>
Configuration¶
Image lightbox¶
Click any content image (not wrapped in a link) to open a full-viewport preview
overlay. Close with the Γ button, clicking the backdrop, the Esc key, or
scrolling; navigate multiple openable images with the β / β arrow keys. The
overlay works with zero dependencies β no extra pip packages.
The .void-svg container¶
Wrap raw SVG in a .void-svg container to get a bordered glass panel that
centers and scrolls the artwork. Use void-svg--bare for a borderless,
transparent container when you don't want the glass panel look.
Live preview / screenshot¶
Image lightbox¶
- Images inside a
<a>(e.g. linked thumbnails) are deliberately left alone. - The overlay respects
prefers-reduced-motionand locks body scroll while open.
Figure with caption¶
Inline SVG component¶
Dividers & badges¶
A decorative divider component:
Status badges:
Under the hood¶
- Default images get
--void-glass-borderrounding plus aborder-radiusfrom the radius tokens;width/heightattributes pass through intact. .void-img-round,.void-img-ghost,.void-image--banner,.void-image--thumbnailare defined incomponents.scss..void-svgand.void-dividerare simple glass panels; badges are.void-badgewith--success/--warning/--error/--accentstates.
Accessibility notes¶
- Keep meaningful
alttext on every image; decorative SVGs should carryaria-hidden="true"androle="img"only when they convey content. - The lightbox is keyboard-operable (Esc closes, arrows navigate), locks
background scroll, and honors
prefers-reduced-motion.