Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,113 of 9,113 pages
About the help in other languages
All help pages

SVG images

SVG in designs and in content: design SVGs you ship yourself, SVG uploads by editors (accepted and sanitized since October 2026, never scaled), what that means for templates, and how to keep SVGs accessible and…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/svg-images.md

On this page

SVG images

This page is for designers who use SVG for logos, icons and illustrations. It answers: how design SVGs and uploaded SVGs differ, what the kernel does to uploaded SVGs, and how templates must treat them.

Contents

  1. Design SVGs
  2. SVGs uploaded by editors
  3. What this means for your templates
  4. SVG and dark mode
  5. Accessible SVG

Design SVGs

SVG files in your design's images/ are your own files: you made them, you trust them. Link them with ezimage like any image, or use them as CSS backgrounds and masks. Remove editor metadata and hidden layers before shipping (an SVG optimizer does this), and give the file a viewBox so it scales.

SVGs uploaded by editors

Since 15 October 2026 the image datatype accepts SVG (.svg, .svgz) uploads (settings/image.ini [ImageUploadSettings]):

AllowedMIMETypes[]=image/svg+xml
# enabled (default) or disabled
SanitizeSVG=enabled

An SVG can carry script, so the kernel never stores an upload as it came: expSvgSanitizer keeps only allow-listed elements, attributes and CSS, and the stored file is its output. Uploaded SVGs are served with headers that stop them from running anything when opened directly. SanitizeSVG=disabled refuses SVG uploads; there is no way to store one unsanitized. Details: SVG images (behavior change).

What this means for your templates

  • An SVG is never scaled. Every alias of an SVG image is the sanitized file itself (comment in settings/image.ini). Its displayed size comes from your CSS or the width and height attributes, not from the alias.
  • Give SVG images in content a size in CSS, for example max-width: 100%; height: auto; and a width from the context, so a huge viewBox does not take the whole page.
  • Show content SVGs with <img> (as the datatype template does), never by pasting their markup into the page: in an <img>, an SVG cannot run script or read the page.

SVG and dark mode

  • A design SVG drawn as a CSS mask, or written inline into the markup with fill="currentColor", follows the text color and therefore the theme.
  • An SVG in an <img> cannot see the page's colors. For logos, ship a light and a dark file and switch with <picture> and prefers-color-scheme, or choose colors that work on both backgrounds.

Accessible SVG

  • In <img>: an alt as for any image.
  • Inline decorative SVG: aria-hidden="true" and focusable="false".
  • Inline meaningful SVG: role="img" and a <title> as its first child, or aria-label.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x