typst / typst/typst

Support styling color of Typst's SVG output with CSS

Open
#7,696 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request styling svg
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

i have the understanding that there is no way of setting the color of a typst-exported svg with css. not sure what the design looks like here, but i guess a function returning color would suffice.

Use Case

i'm cooking up a little Rust crate for embedding typst svgs in rustdoc output, but as i understand it, i can't color the text properly w.r.t. theming.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Typst's SVG export path and examining how exported SVG elements currently encode colors. Determine whether CSS-based color styling can be supported without breaking existing output, then verify the result in a rustdoc-style embedding where the SVG text follows the surrounding theme.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
compilers, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.