Re:Learn SVG with 25 examples – How to code images in HTML
by johnfn on Thursday December 07, 2023 @07:18PM
(#38563740)
Yeah and, worse comes to worst, you can just use foreignObject to bounce back to HTML, do something with flexbox, and then go back to SVG!
Re:Learn SVG with 25 examples – How to code images in HTML
by epiccoleman on Friday December 08, 2023 @08:14AM
(#38568604)
Yeah - foreignObject is super interesting, I had never heard of it before this thread. I even have a potential use case for it one of my projects, definitely need to check it out.
The problem, of course, is that there's not really a good way to do dynamic sizing if you want to be able to change the aspect ratio, which is where layout engines like Grid and Flex become so useful in HTML / CSS. But in my (fairly limited) experience, if I'm reaching for SVG it's because I need the tight control that comes with it, so it hasn't been an issue for my own projects.