Add CSS isolation support to SVG Frame#233
Add CSS isolation support to SVG Frame#233arnavsharma990 wants to merge 2 commits intocreativescala:mainfrom
Conversation
|
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.
- 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
Adds support for the CSS isolation property on Frame.
Closes #228