q2's css for mermaid subgraph diagrams is broken

Open Beginner friendly
#1,095 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
css, rust
Domain
frontend

Research direction

Start by locating the q2 theme CSS rule for [id^=mermaid-] foreignObject and compare it with the Connect workaround described in the issue. Reproduce with Mermaid 12.2.0 using a graph LR diagram containing a subgraph on a Bootstrap themed site. Done when the subgraph title no longer forces the diagram into a thin strip.

Written by the indexing model from the issue text.

Description

Mermaid subgraph titles inflate diagrams to a sliver

q2's theme CSS includes [id^=mermaid-] foreignObject{display:flex;align-items:center;justify-content:center;font-size:1rem}.
With the bundled mermaid 12.2.0, every subgraph title then measures 16384px wide, so a diagram with subgraphs scales down to a thin strip.
Repro: any graph LR with a subgraph in a website using a Bootstrap theme.
Connect works around it with [id^="mermaid-"] .cluster-label foreignObject { display: block; }.

Dominant language
Rust
Stars
302
Forks
22
Avg merge
5h 2m
Merged PRs (30d)
213

Getting set up

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.

More from quarto-dev/q2

All issues in quarto-dev/q2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.