Uh oh!
There was an error while loading. Please reload this page.
Add CSS isolation support to SVG Frame - #233
Conversation
arnavsharma990
commented
Mar 3, 2026
Note: The issue description(#228 ) mentions that an ideal solution could allow arbitrary CSS styles on This PR intentionally focuses only on supporting the |
There was a problem hiding this comment.
Pull request overview
Adds support for the CSS isolation property on the SVG root element via Frame, allowing callers to control blending/stacking behavior of rendered SVG output.
Changes:
- Introduces
doodle.svg.effect.IsolationADT (Auto,Isolate) withtoCSSrendering. - Extends
doodle.svg.effect.Framewith an optionalisolationfield and awithIsolationbuilder. - Updates SVG root tag rendering to emit
isolation: ...in the inlinestylewhen configured.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| svg/shared/src/main/scala/doodle/svg/effect/Isolation.scala | Adds an ADT representing CSS isolation values and CSS serialization. |
| svg/shared/src/main/scala/doodle/svg/effect/Frame.scala | Adds optional isolation to the public Frame API plus a builder method. |
| svg/shared/src/main/scala/doodle/svg/algebra/Svg.scala | Appends isolation into the generated root <svg>style attribute. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Refactor SVG style attribute building to use List of fragments joined with space, eliminating trailing space when isolation is not set - Remove unused imports in SvgSpec - Add tests for svgTag style generation: - No isolation: output has no trailing space or isolation property - With Isolation.Isolate: isolation property emitted - With background + isolation: both properties present - With Isolation.Auto: auto value emitted - FixedSize variants of the above
noelwelsh
left a comment
There was a problem hiding this comment.
Documentation is missing.
| package svg | ||
| package effect | ||
| sealed abstract class Isolation extends Product with Serializable { |
There was a problem hiding this comment.
We are (slowly) moving to Scala 3 style, so use an enum here.
Adds support for the CSS isolation property on Frame.
Closes#228