Skip to content

Implement SVG opacity support #28

@rowland

Description

@rowland

Problem

Our renderer currently warns with svg: <style>: opacity is not yet implemented; rendering as opaque. Assets that rely on opacity, fill-opacity, or stroke-opacity lose intended transparency.

What implementation would require

  • Carry opacity values all the way through style parsing and style inheritance, including internal stylesheet classes and inline style attributes.
  • Audit the renderer so per-node opacity is applied consistently to fill, stroke, and text.
  • Expose PDF transparency support if needed, likely via ExtGState entries for fill/stroke alpha and a way to scope those settings safely.
  • Decide how combined opacity, fill-opacity, and stroke-opacity multiply together.
  • Add visual tests covering partially transparent shapes and text over other content.

Workarounds

  • Export fully opaque SVG variants where acceptable.
  • Flatten translucent artwork to PNG if the design depends on layered transparency.
  • When only a few assets use opacity for subtle effects, replace those effects with solid-color approximations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions