Nothing

SVG Import Mapping

Current static SVG-to-Grida mapping, its usvg normalization boundary, and remaining model gaps.

SVG Import Mapping

This page records the static SVG → Grida IR property projection and its known gaps. The projection uses usvg for pre-processing.

This page describes the static projection. usvg simplifies the SVG DOM before that projection sees it: <use> is resolved, CSS is computed, <defs> are inlined, and transforms are flattened. The tables below map that simplified tree, not raw SVG.

Animation cannot use that normalized tree as its only source of truth. The selected SVG Animation Profile 0 baseline through the current cumulative Profile 6 require a separate frontend to retain animation-bearing source and one-to-one target identity before static normalization. Animated processing is a separate conformance surface from the static importer described here.

Elements

SVG Elementusvg TypeGrida IR NodeStatusNotes
<svg>Tree (root)Scene + InitialContainerviewBox → scene size
<g>GroupGroupNodeRecblend_mode, opacity, clip
<rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>PathPathNodeRecusvg pre-converts shapes to paths
<path>PathPathNodeRecFill + stroke + transform
<image>ImageImageNodeRecEmbedded raster data
<text>TextTextChunkTextSpanNodeRec⚠️Single-style spans; mixed-style partial
<clipPath>Group clipGroupNodeRec.clip⚠️Basic rectangular clips
<mask>MaskLayerMaskTypeLuminance + Alpha
<filter>--LayerEffects⚠️Not fully mapped from usvg
<marker>----Not mapped
<pattern>----No pattern fill IR
<symbol>(resolved by usvg)--Transparent — usvg inlines
<use>(resolved by usvg)--Transparent — usvg inlines
<defs>(resolved by usvg)--Transparent — usvg inlines
<foreignObject>----Not supported
<switch>----Not supported

Paint

SVG Featureusvg TypeGrida IRStatusNotes
Solid fill colorPaint::ColorPaint::Solid
Fill opacityFill.opacitypaint alpha
Fill ruleFillRuleFillRule (NonZero, EvenOdd)
Linear gradientPaint::LinearGradientPaint::LinearGradient
Radial gradientPaint::RadialGradientPaint::RadialGradient
Gradient stopsStop { offset, color, opacity }GradientColorStop
spreadMethod (pad)----Default
spreadMethod (reflect/repeat)----Only pad supported
Pattern fillPaint::Pattern--No IR equivalent

Stroke

SVG AttributeGrida IR FieldStatusNotes
stroke-widthStrokeWidth::Uniform
stroke-linecapStrokeCap (Butt, Round, Square)
stroke-linejoinStrokeJoin (Miter, MiterClip, Round, Bevel)
stroke-miterlimitStrokeMiterLimit
stroke-dasharrayStrokeDashArray
stroke-dashoffset--Not mapped
stroke-opacitypaint alpha

Transform

SVG FeatureGrida IRStatusNotes
transform (2D affine)AffineTransformusvg resolves nested transforms
3D transforms--2D only

Effects

SVG FeatureGrida IRStatusNotes
opacity (group/element)node.opacity
Blend modes (all 16)LayerBlendModeFull mapping
<feGaussianBlur>FeLayerBlur⚠️Not fully wired from usvg filter chain
<feDropShadow>FilterShadowEffect⚠️Not fully wired
<feColorMatrix>--No IR equivalent
<feComposite>--No IR equivalent
<feMorphology>--No IR equivalent
<feTurbulence>FeNoiseEffect⚠️IR exists, mapping incomplete

Text

SVG FeatureGrida IRStatusNotes
<text> contentTextSpanNodeRec.text
font-familyTextStyleRec.font_family
font-sizeTextStyleRec.font_size
font-weightTextStyleRec.font_weight
font-styleTextStyleRec.font_style_italic
text-anchorSVGTextAnchorStart, Middle, End
fill on textTextSpanNodeRec.fills
<textPath>--Text on path not supported
Multi-span mixed styles--⚠️Partial; each <tspan> becomes separate TextSpan
dominant-baseline--No baseline offset IR
letter-spacingTextLetterSpacing⚠️May not be mapped from usvg
word-spacingTextWordSpacing⚠️May not be mapped from usvg

IR Gaps (SVG features blocked by missing IR)

  1. Pattern fills -- <pattern> has no IR equivalent
  2. SVG filter primitives -- feColorMatrix, feComposite, feMorphology, etc.
  3. Gradient spread modes -- reflect/repeat not supported
  4. Text on path -- <textPath> needs path-follow layout
  5. Stroke dash offset -- stroke-dashoffset not in StrokeStyle

On this page